Skip to content

feat: let confidential requests require attested inference - #26

Open
Marketen wants to merge 2 commits into
mainfrom
feat/browser-verified-privacy
Open

Marketen wants to merge 2 commits into
mainfrom
feat/browser-verified-privacy

Conversation

@Marketen

Copy link
Copy Markdown
Contributor

Web chat is going to claim, for private models: "Nobody can read your prompt — not Nexus, not the model provider." The browser can verify that its prompt reaches this enclave encrypted. It can't see what the enclave does next. Today the enclave may send the prompt to the Router (nexus/auto), the PII analyzer, or a non-attested fallback provider, all outside attested code. This PR lets the client rule that out.

Behavior

A confidential request may set "require_attested_inference": true in its encrypted envelope. The enclave then lets only attested code read the prompt:

  • Chat completions only; any other endpoint is refused.
  • No Router: a router model ID is refused rather than resolved.
  • No PII masking, which would send the prompt to the analyzer.
  • Only providers whose adapter declares AttestedTransport() (today Tinfoil, which verifies the provider enclave's attestation and encrypts to it over EHBP). The primary model and the fallback are each checked, both before the credit hold and again at send time.
  • An attested provider that returns no transport proof fails the request; the answer isn't delivered without evidence.
  • No server-side Tinfoil proof is stored for these requests. The client keeps its own, and a server copy would only be a permanent record of which account used a private model when.

Anything it can't serve that way gets 422 attested_inference_unavailable, and nothing is sent upstream.

The flag lives inside the encrypted body, so nothing between the client and the enclave can add or strip it. Every release with the confidential endpoint (v0.1.60–v0.1.72) decodes the envelope with DisallowUnknownFields, so an older enclave rejects the flag rather than ignoring it. Rolling the enclave back fails closed.

What leaves the enclave for these requests: Metering reservations and failures carry IDs, counts, error type and code, never message text.

Rollout

Nothing changes for requests without the flag. Web chat sends it only once PRIVATE_CHAT_GATEWAY_URL is set on the control plane (dappnode-nexus, off by default), and that must happen after the enclave runs a release containing this PR.

Validation

  • go test ./...
  • New tests cover each refusal: router, non-chat endpoint, non-attested primary, non-attested fallback, missing proof (stream and non-stream), PII skipped, no proof stored. Each check was removed in turn to confirm a test fails.
  • Envelope decoding: the flag is honoured only from the decrypted body, and unknown fields are still rejected.

🤖 Generated with Claude Code

Marketen and others added 2 commits November 16, 2026 16:09
A confidential request can now set "require_attested_inference": true
inside its encrypted envelope. The enclave then lets only attested code
read the prompt: itself and a provider whose attestation it verifies
before sending anything. It refuses routers, which send the prompt to the
Router outside the enclave; skips PII masking, which sends it to the
analyzer; checks every provider target, fallback included, for an
attested transport before holding credit or sending; and discards an
answer that arrives without a transport proof. A request it can't serve
that way returns 422 attested_inference_unavailable.

The field travels inside the EHBP-encrypted body, so nothing between the
client and the enclave can add or remove it. Gateways that predate it
reject the envelope as unknown, so asking for it fails closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client of an attested-inference request verifies the enclave itself
and keeps its own proof, so a stored Tinfoil transport proof would only be
a lasting record of which account used a private model, and when.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant