Skip to content

Add OHTTP-style anonymous inference endpoint#69

Draft
adambalogh wants to merge 1 commit into
mainfrom
claude/anonymous-inference-privacy-SgzWN
Draft

Add OHTTP-style anonymous inference endpoint#69
adambalogh wants to merge 1 commit into
mainfrom
claude/anonymous-inference-privacy-SgzWN

Conversation

@adambalogh
Copy link
Copy Markdown
Contributor

Implements RFC 9458 Oblivious HTTP encapsulation so clients can submit chat completions through an independent relay without exposing their IP to the enclave or their prompt to the relay. The HPKE X25519 keypair is generated alongside the existing RSA signing key and bound to the same nitriding registration digest, so the Nitro attestation document commits to both.

  • tee_gateway/ohttp.py: HPKE wrap/unwrap helpers (DHKEM(X25519)/HKDF-SHA256/ ChaCha20-Poly1305). Response keying derived per-context per RFC 9458 §4.2.
  • tee_gateway/tee_manager.py: HPKE keypair, key-config blob, attestation document now includes the HPKE public key.
  • tee_gateway/controllers/ohttp_controller.py: /v1/ohttp dispatches the decrypted request to the existing chat handler, scrubs identifying fields before forwarding upstream, refuses stream=true.
  • /v1/ohttp/config exposes the HPKE key config for client discovery.
  • Test coverage: round-trip, wrong-suite, truncated input, tampered ciphertext.

Implements RFC 9458 Oblivious HTTP encapsulation so clients can submit chat
completions through an independent relay without exposing their IP to the
enclave or their prompt to the relay. The HPKE X25519 keypair is generated
alongside the existing RSA signing key and bound to the same nitriding
registration digest, so the Nitro attestation document commits to both.

- tee_gateway/ohttp.py: HPKE wrap/unwrap helpers (DHKEM(X25519)/HKDF-SHA256/
  ChaCha20-Poly1305). Response keying derived per-context per RFC 9458 §4.2.
- tee_gateway/tee_manager.py: HPKE keypair, key-config blob, attestation
  document now includes the HPKE public key.
- tee_gateway/controllers/ohttp_controller.py: /v1/ohttp dispatches the
  decrypted request to the existing chat handler, scrubs identifying fields
  before forwarding upstream, refuses stream=true.
- /v1/ohttp/config exposes the HPKE key config for client discovery.
- Test coverage: round-trip, wrong-suite, truncated input, tampered ciphertext.

Known limitation: payment gating is not yet wired for this endpoint; a
blind-token layer will follow in a separate change.

https://claude.ai/code/session_01WyddtSz2rtiP61LtVJbsJy
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.

2 participants