Architecture¶
How Nanorix produces AuditProofs for regulated data workloads.
Core concept¶
A capsule is a sealed ephemeral workspace — an isolated Linux-namespace environment where regulated data lives, works, and dies. Customers route sensitive data (PHI, PII, financial, credentials) through capsules: upload data, run computation with their own code, get results out, then destroy. Every capsule whose destruction completes produces an AuditProof: signed, independently verifiable evidence of what happened to the data, including its destruction.
The capsule is the product. The AuditProof is the evidence.
Capsule lifecycle¶
┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│ create │ → │ execute │ → │ destroy │ → │ AuditProof │
└─────────────┘ └──────────────┘ └─────────────┘ └──────────────┘
POST POST DELETE GET
/v1/capsules /v1/capsules/ /v1/capsules/ /v1/proofs/
:id/exec :id :id
- Create. Customer declares
data_classification("PHI"/"PII"/"financial"/"credentials"/"general") and the capsule'sjurisdiction("us"/"ca"/"gb"/"au"/"in"/"eu-fr"/"eu-de"/"eu-nl"), which the AuditProof signs. When the create names none it is the account's declared jurisdiction where that names one country ("UK"is"gb"); an account declared"EU"or"OTHER"names it on each create, and a create that does not is refused. The account's own jurisdiction ("US"/"EU"/"UK"/"CA"/"AU"/"IN"/"OTHER"), declared at signup, selects theregulatory_contextframeworks. Optional: reference a Capsulefile (frozen environment definition) bycapsulefile_id. - Execute. Customer uploads input files, runs commands inside the capsule, downloads output files. When an egress profile with rules is bound to the capsule, the designed route out is an egress proxy that checks each outbound destination against that profile's host allowlist and, when the Capsulefile declares one, its egress declaration. SDK-routed HTTPS requests are designed to go through the sealed daemon, a per-capsule sidecar that writes each request as a
SealedHttpRequestactivity event in the AuditProof. - Destroy. Customer issues
DELETE /v1/capsules/:id. The files in the capsule's tmpfs workspace are overwritten in multiple passes and the workspace is unmounted, the namespace is torn down and the capsule's keys are destroyed. The 8-step destruction chain covers those steps (namespace teardown, tmpfs unmount, multi-pass DoD 5220 wipe, key incineration, forensic verification), and the signed AuditProof is emitted. - AuditProof. Customer retrieves the signed proof via
GET /v1/proofs/:id(authenticated, same organization only; the proof is the response'scdpfield) or, with no authentication,GET /v1/capsules/:id/cdp/verify, which serves the same full proof to anyone who holds the capsule ID (rate-limited;?format=presentationreturns the summary). Anyone with the proof can verify it offline using thenanorix-verifyCLI or the offline verifier modules in the Python + TypeScript SDKs.
Defense-in-depth (Linux isolation)¶
Each capsule runs inside a stack of Linux kernel isolation primitives:
| Layer | Mechanism | Effect |
|---|---|---|
| 6 | Seccomp-BPF | Refuses any syscall outside an allowlist: 110 calls on x86_64 and 88 on arm64 for a sealed capsule, plus 11 socket calls when the capsule has egress or is given the runtime's local socket |
| 5 | Cgroup v2 or v1 | Memory limits, in a cgroup v2 group or, on hosts such as Cloud Run gen2 that mount the memory, pids and cpu controllers as cgroup v1, in cgroup v1 memory, pids and cpu groups. No swap: on cgroup v2 the capsule's memory.swap.max is 0; on cgroup v1 a capsule is refused unless the host reports no swap when it is created. After an out-of-memory kill, the capsule's other processes are killed too: on cgroup v2 by memory.oom.group, on cgroup v1 by the runtime once the command returns. |
| 4 | Network namespace | Sealed by default: an empty network namespace with no route out. When an egress profile with rules is bound, the designed route out is an egress proxy that checks each destination against that profile's allowlist and, when the Capsulefile declares one, its egress declaration |
| 3 | UTS and PID namespaces | Fixed capsule hostname; the host's hostname is not visible. Each command runs as PID 1 of its own PID namespace, so its /proc lists only its own processes. |
| 2 | Mount namespace and root filesystem | Each command gets its own mount namespace and its own root filesystem: the host's system directories read-only, an otherwise empty /dev with six device nodes, the capsule's own tmpfs directories (/workspace, /data, /tmp, /dev/shm) and a fresh /proc. The host's other paths and other capsules' directories are not mounted, with one exception: a capsule with an egress profile bound may also get a read-only directory that holds the socket of its own sealed HTTP daemon. |
| 1 | User namespace | Created for each command; the command holds no Linux capabilities when it starts, which the startup self-test checks. If the kernel refuses to create it, the command does not run. The API process that sets capsules up runs as root. Where the API runs as root, which includes the hosted service and the documented Kubernetes profiles, each capsule leases its own non-root user and group ID for its life, and each command drops to them before its user namespace is made, so the host kernel's file-permission checks treat the command's processes as that unprivileged user. Capsules run only after a startup self-test sees a probe command hold the leased IDs with no supplementary groups and be refused when it opens /proc/sysrq-trigger, and again when it opens /proc/sys/kernel/core_pattern, for writing. The command's /proc is mounted read-write; the refusal comes from the kernel's permission checks against the leased user, not from a read-only mount. |
| 0 | Crypto shredding | Multi-pass overwrite + Ed25519 attestation |
The kernel enforces these primitives. Nanorix doesn't reimplement isolation — we compose what the Linux kernel already provides and bind the result into a cryptographic proof.
AuditProof structure¶
The AuditProof is an 8-step SHA-512 hash chain plus an Ed25519 signature over the canonical hash, which covers the chain (for 1.0, over the final chain hash). Each step covers the destruction of one subsystem.
Step 1: eee_namespace method: procfs_verification
Step 2: eee_tmpfs method: mountinfo_verification
Step 3: eee_memory method: dod_5220_multipass_wipe
Step 4: dire_keys method: ed25519_key_destruction
Step 5: dire_identity method: credential_incineration
Step 6: fgx_forensic method: merkle_tree_verification
Step 7: rzl_audit method: hash_chain_validation
Step 8: capsule_destroy method: capsule_lifecycle_verification
Each step's hash is computed over the previous step's hash plus the step's subsystem, the literal destroy, the fixed method for that step position and the document's destroyed_at, joined by single null bytes (‖ 0x00 ‖). Step 8 is amended when the proof carries receipt or parent roots; see the AuditProof specification:
chain_hash[i] = SHA-512(
chain_hash[i-1] ‖ 0x00 ‖ subsystem ‖ 0x00 ‖ "destroy" ‖ 0x00 ‖ method ‖ 0x00 ‖ timestamp
)
chain_hash[0] = SHA-512("") (genesis hash)
For cdp_version 2.1 and 2.2 the Ed25519 signature is over the canonical hash (the SHA-512 of the RFC 8785 view, which includes the chain and the activity trail), and only 1.0 signs step 8's chain_hash (final_hash); in both cases the signed message is the ASCII hex string (128 bytes — not raw binary). This is required for cross-implementation verifier compatibility: Rust + Python + TypeScript verifiers compute byte-identical hashes against the same canonical input.
The full canonical-JSON form bound into the signature uses RFC 8785 JCS (JSON Canonicalization Scheme) via serde_jcs. This guarantees: re-canonicalize the same logical JSON object on any supported platform, get the same bytes, get the same hash, get the same signature verification result.
Activity trail¶
The runtime emits ActivityEvent variants for the operations it performs or mediates (lifecycle, files, egress, sealed-daemon requests and the others listed below) into the AuditProof's own activity_trail, an array bound into the AuditProof's canonical hash. The agent's own calls go to the activity record the customer keeps; when the capsule opts in, the AuditProof holds only that record's root. Variants currently shipped:
CapsuleStarted— capsule init. Carries the Capsulefile identity (id, version andcapsulefile_content_hash), the bound egress profile's id and name, the Capsulefile's egress declaration, the network mode and the region label. The customer'sdata_classificationdeclaration is recorded in the AuditProof's capsule context, andjurisdictionin the signed record, not in this event.FileUploaded/FileDownloaded— per-file filename, size and SHA-512 content hash, one variant per direction.ExecutionStarted/ExecutionCompleted/ExecutionOomKilled— per-exec lifecycle bounds.SealedHttpRequest— per HTTPS request made through the sealed daemon. Carries request canonical hash, response body hash, TLS metadata (version, cipher suite, peer certificate subject common name and SHA-256 fingerprint, validation outcome), duration.StreamingEgressStarted/StreamingEgressChunk/StreamingEgressCompleted/StreamingPolicyViolation— per-chunk SHA-512 + RFC 6962 Merkle root for SSE / chunked-transfer responses.PostgresQueryExecuted/RedisCommandExecuted/MqttMessagePublished/DicomCStoreCompleted/RawTcpConnectionCompleted— per-protocol attestation for non-HTTP TCP egress.McpToolInvoked— per MCPtools/callinvocation. Carriesserver_uri,tool_name,tool_args_hash(SHA-512 of canonical JSON of arguments),tool_result_hash(SHA-512 of canonical JSON of result content),duration_msandoutcome; aclient_session_idslot is reserved and not populated today.BatchRecordProcessed/BatchCompleted— per-record outcome + Merkle-root binding for batched-into-capsule pipelines.MemoryArtifactLoaded/MemoryArtifactPersisted— for multi-capsule agents using the memory artifact pattern.InputProvenanceVerified/InputProvenanceRejected— when input manifests with cryptographic provenance are declared.SecretsInjected/SecretsInjectionRejected— for env-vars-as-secrets declarations.DestructionInitiated— final event before the destruction chain runs.
Egress model¶
By default, a capsule runs in an empty network namespace with no route out. Outbound access comes from an egress profile: a named host allowlist the customer creates through the egress-profiles API. On the Developer tier, an account's single egress profile with rules is applied to every capsule automatically; on the Team tier, each capsule can select its own profile. When a profile with rules is bound, the capsule gets a network namespace whose designed route out is the egress proxy.
The egress layer for a capsule with an egress profile with rules bound:
- Checks each connection that takes the proxy route against the host allowlist of the capsule's bound egress profile and, when the Capsulefile declares
egress_declaration, against that declaration too. The declaration is checked at capsule creation, where every domain pattern in the profile must appear in it (POST /v1/capsules), and the proxy checks it again on each connection as a second check behind the create-time one. A Capsulefile with no declaration leaves the profile alone to decide. The profile's rules are read once when the capsule is created and that snapshot is what the proxy uses. A refused request is answered with403and counted in the AuditProof'spolicy_denial_summaryasproxy_request_denied. A request whose head the proxy cannot read (a line over its length cap, too many header lines, a head that ends early or is not valid text, or one not sent within the head timeout) is answered400or closed, and is not counted. A legacy NAT mode exists for development only; it has no egress proxy, so neither the declaration nor the profile's host names are checked there. - Refuses cloud metadata, loopback, link-local, unspecified, multicast, broadcast, reserved and documentation destinations, and private ranges unless the operator opts in (
egress.allowPrivateDestinationsin the Helm chart,NANORIX_EGRESS_ALLOW_PRIVATE=truein the environment). When an egress rule is created, an IP literal in one of these ranges, or a loopback or cloud metadata name, is refused with a 400. On every connection the proxy resolves the host once, checks each address it resolved to, and connects only to an address it checked, so a second DNS answer cannot redirect the connection. The opt-in admits private ranges only; the cloud metadata addresses stay refused with it. - Gives the capsule no IPv6 path. IPv6 is switched off on both ends of the capsule's network link before the link comes up, and the capsule's network namespace drops all IPv6 except on loopback, so the capsule keeps
::1for its own use. On a node booted withipv6.disable=1, where the kernel carries no IPv6 at all, these steps are skipped. - Accepts no inbound connection, datagram or ICMP message on the proxy route: the capsule's IPv4 input takes only TCP segments from the egress proxy's address and port that cannot open a connection, and drops every other packet. The development-only legacy NAT mode has its own, wider rules.
- (For MCP-aware capsules) enforces the Capsulefile's
mcp_policy.allowed_toolswhitelist andmcp_policy.prohibited_toolsblocklist on outbound JSON-RPCtools/callenvelopes, rejecting a disallowed call before it is forwarded. - Records each request made through the sealed daemon (the designed path for SDK-routed requests) as a
SealedHttpRequestactivity event with the cryptographic shape (request canonical hash, response body hash, TLS metadata, duration).
Tool-policy inspection reads the transport bytes rather than trusting the client library, so a call made with raw httpx, requests or urllib that carries a well-formed JSON-RPC tools/call envelope reaches the same check. A capsule whose Capsulefile declares no mcp_policy is unrestricted at the tool level and behaves exactly as before the check existed.
The tool check is fail-open on unparseable bodies
A body the daemon cannot parse as a single JSON-RPC tools/call object is forwarded without a tool-level check — including a content-encoded (compressed) body, a spec-legal JSON-RPC batch array, and a malformed envelope. mcp_policy is therefore defense-in-depth against honest clients and misconfiguration, not a containment boundary against an adversarial or non-conforming one. The destination check above runs independently and is not affected by this.
Which build enforces this
Tool-policy enforcement was wired in the runtime release that introduced the mcp_policy daemon threading. If you operate Nanorix in your own infrastructure (BYOC), a build predating that release accepts mcp_policy and does not enforce it — the field is still validated and bound into the Capsulefile content hash, but the runtime will not reject a disallowed tool call. Check your deployed runtime version before relying on it as a control. Denied calls are rejected on the wire and are not recorded in the AuditProof, so the proof evidences which tools ran rather than which were blocked.
TLS pins are enforced on the sealed daemon; the OCSP choice is not honoured yet. tls_pinned_certs and tls_ocsp_check are declared through the API (not declarable from the Capsulefile YAML in V1) and bound into the Capsulefile content hash, so a change forces a re-finalize and is covered by the artifact. Capsulefile upload, POST /v1/capsulefiles/validate and capsule create check tls_pinned_certs with the sealed daemon's own pin parser, so a pin list it could not enforce is refused there (reported, for validate). For a request sent through the capsule's sealed HTTP daemon, a pinned host's certificate is accepted only when its SHA-256 matches the pin, and a plain http request to a pinned host is refused before any connection; other hosts are validated against system roots. A matching certificate is accepted with no chain, hostname or expiry check, so remove a pin when its certificate is retired. Pins apply to the sealed daemon only: a call through the egress proxy, which is where a standard HTTP library's traffic goes (an https call through its CONNECT tunnel with the workload's own TLS, or a plain http call it forwards), is not pin-checked, and a plain http call there to a pinned host is not refused. tls_ocsp_check is accepted and bound into the content hash but not honoured: the daemon runs with OCSP fetching off for every capsule, so revocation checking there is stapling-only.
Which build enforces this
Pin enforcement is in the build that checks pins with the sealed daemon's own pin parser at Capsulefile upload, POST /v1/capsulefiles/validate and capsule create. If you operate Nanorix in your own infrastructure (BYOC), a build from before that one accepts tls_pinned_certs and does not enforce it: capsules validate against system roots whatever the pins say. Check your deployed runtime version before relying on pinning as a control. After upgrading, capsule create refuses a Capsulefile whose stored pins that parser rejects; create a new Capsulefile.
Metadata + customer attestation¶
Capsules can carry customer-defined metadata (open string-keyed map) — Nanorix prescribes no structured keys (no patient_id, no matter_id, etc.). Customer-defined vocabulary; 4 KB total limit; the nanorix:* prefix is reserved.
For per-event customer attestation, a Capsulefile can declare signing_config with per_event: true and a customer_signing_endpoint — an HTTPS service the customer hosts. At write time a localhost name, or an address literal in a refused range, is refused; on every call the resolved address is checked as well. Redirects are not followed, private addresses are refused unless the install sets the private-network switch (NANORIX_EGRESS_ALLOW_PRIVATE), and loopback, link-local and cloud metadata addresses are always refused. Events the API writes as they happen (capsule start, input provenance checks, exec start and end, file upload and download, secrets injection, memory loads, diagnostic-mode and timeout events) each trigger one POST to that endpoint with the event's SHA-512 message hash; the customer's signing service returns a signature. A response labelled with an algorithm other than Ed25519 is refused; the signature itself is not checked. Events added at destroy (such as egress summaries, heartbeat ticks, policy-denial summaries, sealed HTTP requests and the other protocol records, batch events, memory persists and destruction_initiated) and those the LLM proxy writes are not sent for signing. Nanorix fire-and-buffers: signatures that arrive are absorbed at capsule destroy into the per-event attestation slot of the capsule's AuditRecord, which sits outside the signed canonical hash, and an event whose signing call fails is left without an attestation rather than delaying the capsule.
Each attestation in the AuditRecord carries an algorithm, a public key, a signature and a random event id. It does not name the event it covers or carry that event's message hash, and the signature is made over the server's own serialization of the trail entry, which can differ from the activity record the proof carries. Nanorix stores what the customer's signing service returns without checking the signature, and the slot is outside the signed hash, so anyone holding the file can add or change entries; the offline verifier accepts any populated entries. A reader can try each signature against each activity entry with the entry's public key; entries whose stored form differs from what was signed, capsule_started among them, match none. Nothing in the proof shows that a key is the customer's.
Compliance context¶
The nanorix.compliance SDK module produces a regulatory_context reference map relating an AuditProof's activity trail to specific articles of regulatory frameworks: HIPAA Security Rule §164.312, GDPR Articles 5 / 9 / 25 / 30 / 32, SOC 2 Trust Services Criteria CC6 + CC7. The module uses related_to language only — never asserts compliance status. Customer's compliance officer makes the final determination.
The reference module is a static map — Nanorix does not execute compliance evaluations against customer data. The reference frame is the customer's audit prep tool, not a substitute for an audit.
What this means in practice¶
- The design thesis: route the regulated fraction of your operations (typically a minority of workloads) through capsules, and let that fraction carry the bulk of your compliance evidence burden.
- The customer's ML/AI workloads, business logic, and data shape are theirs — Nanorix does not inspect, classify, or score data content.
- The customer holds compliance authority. Nanorix produces evidence; the customer's compliance team interprets it.
- Verifiers (regulators, auditors, customers' compliance partners) can replay the AuditProof offline using the Rust CLI, the Python SDK module, or the TypeScript SDK module — all three reproduce identical hash chains via RFC 8785 + RFC 6962.
Where to go next¶
- Quickstart: Get your first AuditProof in 5 minutes
- Reference Capsulefile bundles: five copy-paste pipelines (med-AI extraction / claims / eDiscovery / voice / long-running agent) — distributed via design-partner program; contact [email protected]
- Verification: Verify an AuditProof offline
- Threat model: What Nanorix attests to + what it doesn't
- Regulatory context: Compliance frameworks supported
- API reference: All endpoints + schemas