From 1e351ea1e2aaf585f64039b0dd815789db3b3d70 Mon Sep 17 00:00:00 2001 From: AI 13rac1 Date: Sat, 14 Nov 2026 03:34:36 +0000 Subject: [PATCH] Add rules for provider names and unsupported E2EE endpoints Code has applied rules to one provider by comparing its name, and AGENTS.md had no rule for an endpoint that the provider's E2EE protocol does not support. The first rule limits name checks to provider construction and asks for a field that every provider sets. The second rule refuses an unsupported endpoint while E2EE is enabled, and states what the user sets to use it without E2EE. The code-review instructions get the same two checks. Co-Authored-By: Claude Opus 5.5 --- .github/instructions/code-review.instructions.md | 4 ++++ AGENTS.md | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/.github/instructions/code-review.instructions.md b/.github/instructions/code-review.instructions.md index 7a2fbb2f..c0b401a7 100644 --- a/.github/instructions/code-review.instructions.md +++ b/.github/instructions/code-review.instructions.md @@ -65,6 +65,10 @@ Flag any code that: - Accepts unknown, ambiguous, or semantically invalid configuration that should have been rejected at startup. - Uses special cases to handle the tests or test environment, including bypassing factor validation. - Adds exemptions to teeplint for new code. +- Sends a request to an endpoint that the provider's E2EE protocol does not + support while E2EE is enabled, instead of refusing it. +- Compares a provider's name outside provider construction, instead of reading + a field that every provider sets. Error paths MUST fail closed. They may also log, clean up, zero key material, invalidate caches, and record metrics, but must never silently continue or diff --git a/AGENTS.md b/AGENTS.md index 58d2cf65..1e6801d0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -181,6 +181,10 @@ Reference implementations to mirror when adding providers or verification logic: - **Attestation verification:** `internal/proxy/proxy.go:fetchVerified` and `internal/verify/verify.go:runEvidence` - **Proxy handler:** `internal/proxy/proxy.go:handleChat` +### Provider-Independent Rules + +Only provider construction selects code by provider name. Outside it, no check compares a provider's name. When one provider needs a rule, add a field that every provider sets, such as `UsesTLSBinding`, and apply the rule to every provider that sets it. + ### Follow Go Conventions - Follow Effective Go idioms and best practices. @@ -228,6 +232,7 @@ The word "gate" refers only to a physical fence. Do not use it for checks, condi - NEVER weaken or bypass factor validation, unless it has been explicitly disabled via `--offline`, `--force`, or an `allow_fail` policy. - NEVER fall back to plaintext, accept or use empty keys, or perform unauthenticated cryptography. +- NEVER send a request to an endpoint that the provider's E2EE protocol does not support while E2EE is enabled; refuse it. To use such an endpoint, the user sets `e2ee = false` and adds `e2ee_usable` to `allow_fail`. The request then uses TLS, which attestation binds only for a provider that uses TLS binding. - NEVER convert an error into successful or less strictly validated behavior through a fallback path. - NEVER add exemptions to teeplint for new code. - Tests MUST NOT special-case production code to bypass security behavior.