Skip to content

endpoint.headers_env and credential-named headers refused; playbook after #7 - #8

Merged
fidecastro merged 1 commit into
mainfrom
fix/headers-env-and-playbook
Nov 5, 2026
Merged

fidecastro merged 1 commit into
mainfrom
fix/headers-env-and-playbook

Conversation

@fidecastro

Copy link
Copy Markdown
Owner

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 both headers and headers_env is refused.
  • Credential-named static headers refused: a name in endpoint.headers containing key, token, secret, password, auth, cookie, credential, session or signature is refused when the recipe loads, pointing to headers_env (and api_key_env for 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-id keeps working.
  • Playbook after Readout: a prompt_logprobs rung for servers without reply-token logprobs #7: §6 describes both ways jevify reads logprobs (reply token, or prompt_logprobs with 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.
  • Reproducible examples: the playbook and make help use recipes/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.yaml stays as the example of endpoint.headers.
  • SKILL.md and ADR-0004 describe headers_env and the refusal.

Evidence

  • Test first: 12 new tests (credential refusal ×6, headers_env in the hash, overlap refused, value sent from the environment, unset variable fails, reserved names refused through headers_env), all red before the change.
  • uv run pytest -m "not live and not encoder": 167 passed. ruff check and ruff format --check: clean.
  • Ran jevify probe on a recipe with headers: {X-Api-Key: …} and on one whose headers_env names an unset variable: both fail with the messages the playbook lists. make help prints the Gemma example.

Not tested

headers_env against a live gateway: covered by an httpx mock transport only.

🤖 Generated with Claude Code

…#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>
@fidecastro
fidecastro merged commit 3405892 into main Nov 5, 2026
5 of 6 checks passed
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