Alpha · We're looking for development partners. Build with us →
Menu
Last updated: October 2026 — Applies to the Cascade Protocol CLI 0.28 and the published vocabularies. The section on the Swift SDK describes a private, archived codebase.

Security Architecture Overview

The Cascade Protocol follows a local-first architecture. Core operations run on the user's machine. There are no backend services or cloud databases. No CLI command contacts a network to validate, convert, query, import or write. Three commands do, only when you run them: advisory feed pull fetches the feed URL you give it, pod extract posts narrative text to a cascade-agent server (on your own machine by default), and agent sends your prompts and the output of the commands it runs, which can include health data, to the AI provider you configure.

Design Principles

  • Local processing. The CLI and MCP server work on the local filesystem. The MCP server itself makes no outbound calls, but the AI client that connects to it sends what it reads to its model. With a cloud model, that data leaves the device.
  • Open source. The spec, CLI, agent, TypeScript and Python SDKs and conformance suite are public (Apache-2.0 for code, CC BY 4.0 for the spec). The Swift SDK is not public.
  • No telemetry. There are no analytics, crash reporting, phone-home behaviors, or tracking of any kind in the CLI or SDKs.
  • Minimal attack surface. The protocol defines data structure and serialization, not networking. There is no HTTP server, no database daemon, and no listening socket in default operation.

Data Flow Diagram

[ User's Health Data ]  ——>  [ Cascade CLI / SDK (local process) ]  ——>  [ Local Pod (optionally encrypted at rest) ]
NO data sent to external APIs by core commands |  NO cloud storage |  NO telemetry |  NO analytics

Verifiable claim

Network behaviour can be checked by auditing the source code or running the CLI under a network monitor (e.g., Little Snitch, tcpdump, Wireshark). cascade capabilities lists the commands that use the network under securityModel.networkCalls.

PHI Handling

Protected Health Information (PHI) under HIPAA includes any individually identifiable health information. The Cascade Protocol stores PHI categories locally in the user's Pod as RDF/Turtle files, organized by data type.

PHI Categories

The protocol defines the following PHI-relevant data categories, each stored in its own directory within the Pod:

Category Pod Directory Vocabulary
Medicationsclinical/clinical:
Conditionsclinical/clinical:
Allergiesclinical/clinical:
Lab Resultsclinical/clinical:
Vital Signswellness/ or clinical/health: / clinical:
Immunizationsclinical/clinical:
Demographicsprofile/cascade:

Consent Model

There is no consent filtering today. Any agent connected to the MCP server can read the whole Pod. No sharing or consent controls are built.

An earlier design proposed a per-Pod consent.json file listing which data categories may be shared. It was never enforced, and the D-CONSENT-1 decision set it aside. The example below is kept only to show what was proposed.

// Proposed consent.json (never implemented)
{
  "version": "1.0",
  "categories": {
    "medications": { "share": true },
    "conditions": { "share": true },
    "allergies": { "share": true },
    "lab_results": { "share": false },
    "vital_signs": { "share": true },
    "immunizations": { "share": true },
    "demographics": { "share": false }
  },
  "defaultPolicy": "deny"
}

Implementation status

Nothing reads or enforces consent.json. The MCP server does not filter by category. Do not connect an agent to a Pod unless you are willing for it to read everything in it.

Data Minimization

Query operations accept a list of requested data types and return only matching records. This narrows a single query; it is not an access control. The MCP cascade_pod_query tool accepts all, and cascade_pod_read summarizes the whole Pod.

Provenance Model

Records in the Cascade Protocol carry provenance metadata based on the W3C PROV-O ontology. Provenance distinguishes how data was created and by whom. Lineage exists only where an importer or application writes it.

Provenance Types

Core defines these and several more provenance classes (for example PatientReported, EHRVerified and ScannedDocument). See the core vocabulary for the full list.

Type URI Description Example Source
ClinicalGenerated cascade:ClinicalGenerated Data originating from clinical or EHR systems Apple Health clinical records imported from a hospital
DeviceGenerated cascade:DeviceGenerated Data from wearable or medical devices Apple Watch heart rate, blood oxygen readings
SelfReported cascade:SelfReported Data entered directly by the patient Symptom diary entry, manually entered medication
AIExtracted cascade:AIExtracted AI-extracted from existing documents, and anything an agent writes through the MCP server Structured data parsed from a scanned lab report; an agent-written summary
AIAsserted cascade:AIAsserted Content from a general-purpose AI assistant, not grounded in clinical sources A claim imported from an AI chat, to be checked before relying on it

Provenance Attachment

Provenance is attached to every record as RDF triples using the cascade: and prov: namespaces. The following Turtle example demonstrates how provenance metadata is serialized:

@prefix cascade: <https://ns.cascadeprotocol.org/core/v1#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890>
    a clinical:Medication ;
    cascade:dataProvenance cascade:ClinicalGenerated ;
    cascade:schemaVersion "1.5" ;
    prov:wasAttributedTo <https://id.cascadeprotocol.org/users/patient-123> ;
    prov:generatedAtTime "2026-01-15T10:30:00Z"^^xsd:dateTime ;
    clinical:drugName "Metoprolol" ;
    clinical:dosage "25 mg" ;
    clinical:frequency "twice daily" .

Verifying Provenance

Provenance can be checked by searching the Pod's Turtle files for cascade:dataProvenance triples, or by querying records with the CLI or the cascade_pod_query MCP tool. To look across all records:

# Query all records
cascade pod query ./my-pod --all

# List every provenance value in the Pod's files
grep -rh "cascade:dataProvenance" ./my-pod

# Or use the MCP server programmatically via cascade_pod_query

Audit Logging

The MCP server appends one entry per tool call to provenance/audit-log.ttl in the Pod. Only the MCP server writes this log; CLI commands run directly are not logged. It is a plain Turtle file: anyone who can write to the Pod folder can edit it, and it is not authenticated or tamper-evident. The log predicates below (cascade:AuditEntry, cascade:timestamp and the rest) are not yet declared in the core vocabulary.

Log Format

Each audit entry records the following fields:

Field RDF Property Description
Timestamp cascade:timestamp ISO 8601 datetime of the operation
Operation cascade:operation Type of operation: read, write, query, validate, convert
Data Types cascade:dataTypes RDF list of data types accessed (e.g., "medications", "conditions")
Agent ID cascade:agentId Identifier of the AI agent or tool that performed the operation
Record Count cascade:recordsAccessed Number of records read or written

Example Audit Entry

The following example shows the format the audit logger writes (from src/lib/mcp/audit.ts in the CLI). The agent ID is whatever the agent reports, or unknown-agent; it is not verified.

@prefix cascade: <https://ns.cascadeprotocol.org/core/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .

# Cascade Protocol Agent Audit Log
# Generated by cascade serve --mcp

<#audit-3f8a91c2-7b4d-4e6f-9a1c-2d3e4f5a6b7c> a cascade:AuditEntry ;
    cascade:timestamp "2026-02-15T14:30:22.451Z"^^xsd:dateTime ;
    cascade:operation "read" ;
    cascade:dataTypes ("medications" "conditions") ;
    cascade:agentId "claude-desktop-v1" ;
    cascade:recordsAccessed 12 .

<#audit-8c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f> a cascade:AuditEntry ;
    cascade:timestamp "2026-02-15T14:31:05.789Z"^^xsd:dateTime ;
    cascade:operation "write" ;
    cascade:dataTypes ("medications") ;
    cascade:agentId "claude-desktop-v1" ;
    cascade:recordsAccessed 1 .

Reviewing Audit Logs

Audit logs are standard Turtle files and can be read with any RDF tool or text editor.

# View the raw audit log
cat ./my-pod/provenance/audit-log.ttl

# Count total operations
grep -c "a cascade:AuditEntry" ./my-pod/provenance/audit-log.ttl

# Filter by agent
grep -A5 "agentId" ./my-pod/provenance/audit-log.ttl

Implementation detail

Audit entry IDs use crypto.randomUUID(), so IDs do not collide across server restarts and concurrent sessions. The server only appends to the log and never rewrites entries, but nothing stops another program or person from changing the file.

AI Agent Access

The Cascade Protocol exposes health data to AI agents via the Model Context Protocol (MCP). The MCP server (cascade serve --mcp) applies the controls below. It does not check consent or limit which records an agent can read, and the AI client sends what the agent reads to its model.

Path Containment

All file operations are validated against a boundary directory to prevent path traversal attacks. The implementation resolves both the target path and the Pod boundary to absolute paths, then verifies containment:

// From src/lib/mcp/tools.ts in cascade-cli
function validatePathBoundary(
  resolvedPath: string,
  boundary: string
): boolean {
  const normalizedPath = path.resolve(resolvedPath);
  const normalizedBoundary = path.resolve(boundary);
  return (
    normalizedPath.startsWith(normalizedBoundary + path.sep) ||
    normalizedPath === normalizedBoundary
  );
}

This check runs on every write operation. If the resolved target file path falls outside the Pod directory, the operation is rejected with an error.

Automatic AIExtracted Provenance

All data written through the MCP server is automatically tagged with cascade:AIExtracted provenance. This is set by the server — the agent cannot choose it. The provenance record includes:

  • Provenance type: Always AIExtracted for MCP-written data
  • Agent ID: Identifier the agent reports (e.g., "claude-desktop-v1"), not verified; defaults to "unknown-agent" if not provided
  • Timestamp: ISO 8601 datetime of the write operation
  • Reason: Optional free-text explanation for why the record was created
  • Confidence level: Optional float between 0.0 and 1.0 indicating the agent's confidence in the data
  • Source records: Optional URIs of existing records used to derive the new data
// Provenance metadata returned for every MCP write operation
{
  "type": "AIExtracted",
  "agentId": "claude-desktop-v1",
  "timestamp": "2026-02-15T14:31:05.789Z",
  "reason": "Summarized medication list for visit prep",
  "confidence": 0.92
}

Audit Trail

Each MCP tool invocation — read, write, query, validate, or convert — is appended to the Pod's audit log. See Audit Logging above for format details.

Encryption

Encryption responsibilities are deliberately separated across layers. The vocabularies and the serialization format define data structure and carry no encryption, so the same records can be stored sealed or in the clear. How a Pod is encrypted at rest is specified separately, in the Pod Encryption specification.

Cascade handles
Infrastructure handles

Protocol Layer (Vocabulary & Serialization)

The protocol vocabularies and Turtle serialization format do not include encryption. This is intentional. The protocol defines what data looks like, not how it is secured at rest.

Protocol Layer (Pod Encryption)

At-rest format, Draft 1.1. The Pod Encryption specification defines the sealed file layout (AES-256-GCM), the passphrase-derived key wraps (Argon2id), the plaintext header at settings/encryption.json, the limits a reader enforces before deriving any key, and how a Pod's key is changed. Cross-implementation vectors are in the conformance suite; see the implementer's guide.
What it does not hide or detect. File and directory names, the directory structure, file sizes and the header stay readable without a secret. Sealed files are not bound to their paths, so someone who can write to a Pod folder can swap sealed files or restore older copies of them undetected: an encrypted Pod is not tamper-evident or rollback-proof against such a writer (specification section 9.4).

Application SDK Layer (cascade-sdk-swift, private and archived)

AES-256-GCM with a keychain-held key. The Swift SDK seals data with CryptoKit's AES-256-GCM under a 256-bit key that it generates once per app and keeps in the platform keychain (iOS Keychain / macOS Keychain, this device only). The key is never written to the Pod or transmitted.
Not yet the Pod Encryption format. This is an earlier scheme with no header, no key wraps and no recovery secret. A Pod it seals cannot be opened by a reader of the Pod Encryption specification, and the SDK cannot open a Pod sealed to that specification. Moving the SDK to the specification is planned.

Infrastructure Layer

TLS in transit. If data is transmitted (e.g., future Solid Pod sync), transport encryption is the responsibility of the infrastructure layer.
Filesystem encryption. iOS and macOS provide full-disk encryption (Data Protection / FileVault). This provides an additional encryption layer beneath application-level Pod encryption.
Access control. Operating system permissions, app sandboxing, and keychain access groups are managed by the platform, not by the protocol.

Regulatory Considerations

Not legal advice

This section describes how the Cascade Protocol's technical architecture aligns with regulatory frameworks. It is not legal advice and does not constitute a compliance certification. Organizations building on the protocol should conduct their own regulatory assessment.

HIPAA (Health Insurance Portability and Accountability Act)

What Cascade helps with

Data types per query. Query operations can name the data types they want. There is no consent filtering, and an agent can ask for all data types.
MCP call log. The MCP server appends one line per call to provenance/audit-log.ttl, with a timestamp, the agent ID the agent reports, data types and record count. The file is not tamper-evident, and CLI commands run directly are not logged.
Provenance. Provenance tracking lets an application tell clinical, device, patient-reported and AI-extracted records apart. The protocol has no access control or consent model of its own.
Encryption at rest. The Pod Encryption format (Draft 1.1, opt-in in the CLI, passphrase-protected) seals Pod files with AES-256-GCM. File names and sizes stay visible. Whether a deployment satisfies the HIPAA Security Rule's encryption specification depends on how its keys are managed and on the rest of the deployment, which the protocol does not control.

What Cascade does NOT help with

Business Associate Agreements (BAAs). The protocol is a technical framework, not a business entity. BAAs must be established between covered entities and their business associates independently.
Breach notification. The protocol does not include breach detection or notification mechanisms. Organizations must implement their own incident response procedures.
Administrative safeguards. Workforce training, security officers, risk assessments, and contingency planning are organizational responsibilities outside the protocol's scope.

GDPR (General Data Protection Regulation)

What Cascade helps with

Data portability. Pod data is stored in open RDF/Turtle format. Users can export their entire Pod at any time — no proprietary format lock-in.
Right to erasure. Deleting a Pod removes all associated data. Copies of an encrypted Pod kept elsewhere (backups, shared copies) still open with the key that sealed them, so erasure also means deleting those copies.
Data minimization. Queries can name only the data types they need. There is no consent filtering, so minimization depends on the application or agent.
Reduced cross-border transfer risk. Local-first architecture means data stays on the user's device by default. Using a cloud AI model with the agent or MCP server is a transfer to that provider.

21st Century Cures Act

Patient access to data. The protocol helps people keep and use copies of the records they are entitled to. The Cures Act's information blocking rules bind EHR developers, providers and exchanges, not the protocol.
Interoperability. FHIR alignment and conversion support (cascade_convert MCP tool) enable data exchange between Cascade Pods and FHIR-compliant systems.
Open standards. Built on W3C RDF/OWL and PROV-O, with a Pod layout that follows Solid conventions. No proprietary formats.

Threat Model

Threats Cascade Mitigates

Unattributed agent writes. Writes through the MCP server are tagged with provenance (agent ID as reported, timestamp, optional confidence) and logged. This does not detect changes made to the files outside the server.
Path traversal attacks. The validatePathBoundary() function resolves all paths to absolute form and verifies they remain within the Pod directory before any filesystem operation.
Provenance forgery for agent-written data. The MCP server automatically sets provenance type to AIExtracted for all write operations. Agents cannot override this to claim data is ClinicalGenerated.

Threats Cascade Does NOT Mitigate

Limitations

The following threats are outside the protocol's scope. They must be addressed by the user's platform, infrastructure, or organizational security measures.

Data sent to an AI model provider. The MCP server makes no outbound calls, but whatever an agent reads is sent to its model. With a cloud model (for example Claude Desktop), that is the provider. Use a local model to keep data on the machine.
Agent reads the whole Pod. There is no consent filtering. Any agent connected to the MCP server can read everything in the Pod.
Tampering with Pod files. Anyone who can write to the Pod folder can change records or the audit log. Encrypted Pods are not tamper-evident either (Pod Encryption specification section 9.4).
Compromised local machine. If the user's device is compromised (malware, rootkit), the attacker has access to everything the user can access, including Pod data and any passphrase or key the user enters. The protocol cannot protect against a compromised runtime environment.
Social engineering. If a user is tricked into granting an untrusted agent access to their Pod or sharing their data, the protocol cannot prevent the resulting data exposure.
Physical access to device. An attacker with physical access to an unlocked device can read Pod files directly. Device-level security (passcode, biometrics, full-disk encryption) is the user's responsibility.
Vulnerabilities in the user's infrastructure. The protocol does not audit or secure the user's operating system, network configuration, or third-party software. A vulnerability in any of these could expose Pod data.
Supply chain attacks on dependencies. While the protocol minimizes dependencies, the tools and SDK do rely on third-party packages. A compromised dependency could introduce vulnerabilities. See Open Source Audit for dependency review guidance.

Open Source Audit

The spec, CLI, agent, TypeScript and Python SDKs and conformance suite are public (Apache-2.0 / CC BY 4.0) and available for independent audit. The Swift SDK is private and archived.

Repositories

Repository Description Language
spec Ontologies, SHACL shapes, JSON-LD contexts, normative documents, decision records Turtle, Markdown
cascade-cli CLI, MCP server, SHACL validator, FHIR / C-CDA / Apple Health import, pod encryption TypeScript
cascade-agent Plain-English front end and narrative extraction TypeScript
sdk-typescript TypeScript SDK TypeScript
sdk-python Python SDK Python
conformance Test fixtures, encryption vectors, reference patient Pod JSON, Turtle

Verifying No Telemetry

The absence of telemetry, analytics, or phone-home behavior can be checked by searching the codebase for network-related code. In the CLI, the network search finds the three commands that use the network on request (advisory feed pull, pod extract, agent) and the code that describes them; cascade capabilities lists them under securityModel.networkCalls. The analytics search should find no tracking code.

# Search for HTTP/network calls in the CLI
grep -r "fetch\|axios\|http\.\|https\.\|XMLHttpRequest\|net\.connect" \
  --include="*.ts" --include="*.js" \
  src/

# Search for analytics or tracking
grep -ri "analytics\|telemetry\|tracking\|phone.home\|beacon" \
  --include="*.ts" --include="*.js" \
  src/

Expected results

Apart from the three commands above, the CLI uses node:fs and node:path for local filesystem operations. Matches for words such as "tracking" may be ordinary code, so read each hit.

Dependency Audit

The CLI's main runtime dependencies and their purposes are listed below. All are open source. Run npm ls --omit=dev for the full tree.

CLI (TypeScript / Node.js)

Dependency Purpose
@modelcontextprotocol/sdkMCP server implementation for AI agent access
n3RDF/Turtle parsing and serialization
rdf-validate-shaclSHACL constraint validation
zodRuntime schema validation for MCP tool inputs
commanderCLI argument parsing
@the-cascade-protocol/agentThe cascade agent command

How to Audit

  1. Clone the repositories and review the source code directly. All code paths are auditable.
  2. Check dependencies with npm ls --omit=dev (CLI) for the full dependency tree.
  3. Run under network monitoring to confirm that commands other than the three listed make no outbound connections.
  4. Review the audit log after any agent interaction to see which MCP calls were made. Remember that the file is not tamper-evident.
← Back to Documentation