Repository navigation
endpoint.headers_env and credential-named headers refused; playbook after #7 - #8
Merged
Merged
Conversation
…#7 Follow-up to #6: - `endpoint.headers_env` maps a header name to an environment variable, read when the backend is built and never written to the recipe; an unset variable fails before any request. A name set in both `headers` and `headers_env` is refused. - A static `endpoint.headers` name that looks like a credential (key, token, secret, auth, cookie, ...) is refused when the recipe loads, since the recipe is committed and its hash quoted. Anti-accident only: a secret under an innocent name still passes. `x-client-id` keeps working. - The playbook now covers servers without reply-token logprobs (the prompt_logprobs rung from #7, raw-mode recipes) and the two new refusals. Its examples and the Makefile's help use the reproducible Gemma recipe, and the sample answer is labelled illustrative. The Qwen3.8 router recipe stays as the example of `endpoint.headers`. - SKILL.md and ADR-0004 describe `headers_env` and the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #6 (thanks to @gilwo for the headers support, playbook and Makefile).
What
endpoint.headers_env: header name → environment variable, read when the backend is built and never written to the recipe. An unset variable fails before any request (endpoint.headers_env sends X-Api-Key from $GATEWAY_KEY, which is not set). A name set in bothheadersandheaders_envis refused.endpoint.headerscontaining key, token, secret, password, auth, cookie, credential, session or signature is refused when the recipe loads, pointing toheaders_env(andapi_key_envfor Authorization). The recipe is committed and its hash quoted, so a secret there would travel with it. This guard prevents accidents only: a secret under an innocent name still passes.x-client-idkeeps working.prompt_logprobswith a raw-mode recipe), and §8's "no readout is possible" row no longer says no recipe setting helps. It adds rows for the two new refusals.make helpuserecipes/gemma-4-e4b-it.llamacpp.yaml, and the sample answer is labelled illustrative (AGENTS.md: a number in a document comes from a recorded run).recipes/qwen38-27b.vllm.yamlstays as the example ofendpoint.headers.headers_envand the refusal.Evidence
headers_envin the hash, overlap refused, value sent from the environment, unset variable fails, reserved names refused throughheaders_env), all red before the change.uv run pytest -m "not live and not encoder": 167 passed.ruff checkandruff format --check: clean.jevify probeon a recipe withheaders: {X-Api-Key: …}and on one whoseheaders_envnames an unset variable: both fail with the messages the playbook lists.make helpprints the Gemma example.Not tested
headers_envagainst a live gateway: covered by an httpx mock transport only.🤖 Generated with Claude Code