Repository navigation
Refuse an endpoint outside the provider's E2EE coverage with 403 and say why - #230
Merged
Merged
Conversation
…swer
Each provider's E2EE covers some endpoints only. Teep refused audio
transcription with E2EE enabled with a message that named no reason
("audio transcription requires TLS-level E2EE (pinned provider)"), and
had no route for NEAR's image edits, privacy and responses endpoints,
which NEAR's E2EE does not cover either.
With E2EE enabled, an endpoint outside the provider's E2EE coverage is
now refused, for every provider alike, and the user sees why.
Changes:
- RequestEncryptor declares its coverage (CoversE2EE). The declarations
state the existing behavior: NEAR covers chat, completions (NEAR AI
direct only), embeddings, image generation, rerank and score; Tinfoil
EHBP covers chat, embeddings, responses and speech; Chutes covers chat
and embeddings; Venice and E2EE v2 cover chat.
- With E2EE enabled, a request on an uncovered endpoint is refused with
HTTP 403 before anything is sent. The error has type
e2ee_not_covered, names the provider and the endpoint, and states
what the user sets to send it without E2EE: e2ee = false, and
e2ee_usable in allow_fail where the policy enforces it. It states
attested TLS only for a provider that uses TLS binding. One warning
is logged, with no request content. This replaces the audio refusal.
With E2EE enabled, a provider without an encryptor covers no
endpoint.
- New routes for /v1/privacy/classify, /v1/privacy/redact,
/v1/images/edits and /v1/responses on neardirect and nearcloud, and
audio on nearcloud. They are plain routes with e2ee = false, and
refused with E2EE enabled.
- The dashboard counts the refusals for each provider and lists the
endpoints that its E2EE covers and does not.
- The API support document states the rule, the new routes and a
section on why teep refused a request.
To verify: go test ./internal/proxy -run
'TestUncoveredEndpoint|TestNotCovered|TestE2EECoverage'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Tinfoil and Chutes encryptors ignored their endpoint argument, so their CoversE2EE declaration was the only check of which endpoints they encrypt. A wrong entry there would send a body that the provider cannot use through EHBP or Chutes E2EE with no other check to stop it. Each encryptor now checks its own CoversE2EE first and returns e2ee.ErrEndpointNotCovered before it reads the key or the body. A test runs every endpoint type through each production encryptor and fails when the declaration and the encryption disagree. The dashboard also lists the endpoints that each provider's E2EE covers, next to those it does not. To verify: go test ./internal/proxy -run TestEncryptorsRefuseUncoveredEndpoints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai-13rac1
force-pushed
the
e2ee-uncovered-endpoints-2
branch
from
November 14, 2026 05:00
6c03c92 to
dd94aec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Each provider's E2EE protocol supports some endpoints only.
/v1/images/edits,/v1/privacy/classify,/v1/privacy/redactand/v1/responses. NEAR's E2EE does not support these endpoints either. On 2026-11-14,/v1/privacy/classifydid not decrypt an encrypted input: the model classified the ciphertext.Change
RequestEncryptordeclares the endpoints that it supports (CoversE2EE). The declarations state the existing behavior:e2ee_not_covered, withproviderandendpointfields.e2ee = false, pluse2ee_usableinallow_failwhere the policy enforces that factor. It calls the TLS connection attested only for a provider that uses TLS binding./v1/privacy/classify,/v1/privacy/redact,/v1/images/editsand/v1/responsesfor NearDirect and NearCloud, and audio transcription for NearCloud. With E2EE enabled, teep refuses them.e2ee.ErrEndpointNotCoveredfor an endpoint outside it, before it reads the key or the body. Before this change, the Tinfoil and Chutes encryptors ignored the endpoint.docs/api_support.mdstates the rule and lists the new routes. A new section, "Why teep refused my request", explains the refusal.Effect
The refused endpoints with E2EE enabled:
The user gets one answer that names the provider, the endpoint and the setting. Previously, audio transcription was refused with an unclear message, and the NEAR endpoints had no route.
To verify
TestUncoveredEndpointRefusedsends each refused endpoint through the HTTP handler and checks the 403 body and the counter.TestE2EECoveragechecks the coverage of every provider and the dashboard lists.TestEncryptorsRefuseUncoveredEndpointsruns every endpoint type through each production encryptor and fails when the declaration and the encryption disagree.This branch builds on the NEAR completions change and merges after it.
Checklist
make checkpasses.make integrationandmake reportspass.