fix(dispatch): provider credential on its own mount, never among /sources (ISS-6) #114

Merged
janpeter merged 3 commits from fix/dispatch-provider-mount into master 2026-10-07 02:49:44 +02:00
Owner

Why (ISS-6)

The Claude review slot reported a file claude_oauth_token in /sources, next to the pinned documents it is told to read (dispatch requests 1734aa13… and 8082ebb0…). The broker copied operator sources (the child's provider credential) into the same attempt directory as the service-signed pins, and the child only left the name out of source_artifacts. The Codex slot had the same layout (codex_api_key, and M45's codex_chatgpt_auth).

The run-logs show models routinely running sha256sum /sources/* or wc -l /sources/*, so they opened the token file on most runs. They printed only a hash or a count.

Exposure check (2026-10-06, counts only, no values printed):

  • 121 stored reviewed replies and 115 run-logs: 0 token-shaped strings, and 0 substrings of the live credentials (compared on srv).
  • No tool call ever printed a credential's content.
  • JP's decision: no rotation.

What

  • Broker: the three provider-credential keys (PROVIDER_CREDENTIAL_SOURCES: codex_api_key, codex_chatgpt_auth, claude_oauth_token) go to <attempt>/provider/, mounted read-only at /run/provider. This applies only when they come in as operator sources; a signed pin always stays in /sources.
  • Child: it reads the credential from /run/provider. It refuses to run (DISPATCH_CHILD_SOURCE_REFUSED) when a credential name appears among /sources, which also turns a broker/image mismatch into a clear failure.
  • Unchanged: the host config (broker.json sources), the profiles (source_mount_keys), the refresher (#113) and the MCP prompts.
  • Docs: the operator doc (delivery, an ISS-6 section with the upgrade order, residual risk, proof and release) and the comments in Dockerfile.dispatch.

Tests

  • RED first: with only the test changes applied, 29 tests fail on master. That is the 6 new tests plus the existing tests adapted to the new layout.
  • npx tsc -p tsconfig.dispatch.json --noEmit: clean.
  • npx vitest run: 1157 passed, 8 skipped. The only failures are the 2 known macOS transcript-retention ones (BSD chmod), which also fail on master.
  • npm run test:dispatch-model-image on local Docker: CODEX, CODEX_CHATGPT and CLAUDE each pass 15/15 checks, including the new in-container check mounts:credential-apart: no credential name in /sources, the credential under /run/provider.
  • New invariant test: the broker test shows /sources holds exactly the signed pins (__dispatch_input and the document, or __repository_base), with the credential only under provider/.
  • The broker test fixture now copies operatorKeys. Without the copy, readCode also pushed __repository_base into the operator config.

Rollout (T-2034, needs a separate go)

Lockstep per slot: broker checkout, model image and a profile revision (new image_digest), then a broker and supervisor restart.

  • An old image behind the new broker fails with DISPATCH_CHILD_CREDENTIAL_MISSING.
  • A new image behind the old broker fails with DISPATCH_CHILD_SOURCE_REFUSED.

The supervisor image is unchanged. M45 T-2014 is already rolled out, so the Codex slot needs its own profile change.

Residual risk (B1, unchanged)

The model can still read /run/provider/*, or its CLI's env through /proc, because it runs as the same uid. The output scrubbing stays the barrier, and a credential-injecting gateway outside the child remains the later hardening.

Plan: Scrum4Me docs/plans/M41-credential-buiten-sources.md (ProductDoc PLANS/m41-credential-buiten-sources). Sprint S-2026-10-06-1, story ST-1637, task T-2033.

🤖 Generated with Claude Code

## Why (ISS-6) The Claude review slot reported a file `claude_oauth_token` in `/sources`, next to the pinned documents it is told to read (dispatch requests `1734aa13…` and `8082ebb0…`). The broker copied operator sources (the child's provider credential) into the same attempt directory as the service-signed pins, and the child only left the name out of `source_artifacts`. The Codex slot had the same layout (`codex_api_key`, and M45's `codex_chatgpt_auth`). The run-logs show models routinely running `sha256sum /sources/*` or `wc -l /sources/*`, so they opened the token file on most runs. They printed only a hash or a count. Exposure check (2026-10-06, counts only, no values printed): - 121 stored `reviewed` replies and 115 run-logs: 0 token-shaped strings, and 0 substrings of the live credentials (compared on srv). - No tool call ever printed a credential's content. - JP's decision: no rotation. ## What - **Broker:** the three provider-credential keys (`PROVIDER_CREDENTIAL_SOURCES`: `codex_api_key`, `codex_chatgpt_auth`, `claude_oauth_token`) go to `<attempt>/provider/`, mounted read-only at `/run/provider`. This applies only when they come in as operator sources; a signed pin always stays in `/sources`. - **Child:** it reads the credential from `/run/provider`. It refuses to run (`DISPATCH_CHILD_SOURCE_REFUSED`) when a credential name appears among `/sources`, which also turns a broker/image mismatch into a clear failure. - **Unchanged:** the host config (`broker.json` `sources`), the profiles (`source_mount_keys`), the refresher (#113) and the MCP prompts. - **Docs:** the operator doc (delivery, an ISS-6 section with the upgrade order, residual risk, proof and release) and the comments in `Dockerfile.dispatch`. ## Tests - **RED first:** with only the test changes applied, 29 tests fail on master. That is the 6 new tests plus the existing tests adapted to the new layout. - `npx tsc -p tsconfig.dispatch.json --noEmit`: clean. - `npx vitest run`: 1157 passed, 8 skipped. The only failures are the 2 known macOS `transcript-retention` ones (BSD `chmod`), which also fail on master. - `npm run test:dispatch-model-image` on local Docker: CODEX, CODEX_CHATGPT and CLAUDE each pass 15/15 checks, including the new in-container check `mounts:credential-apart`: no credential name in `/sources`, the credential under `/run/provider`. - New invariant test: the broker test shows `/sources` holds exactly the signed pins (`__dispatch_input` and the document, or `__repository_base`), with the credential only under `provider/`. - The broker test fixture now copies `operatorKeys`. Without the copy, `readCode` also pushed `__repository_base` into the operator config. ## Rollout (T-2034, needs a separate go) Lockstep per slot: broker checkout, model image and a profile revision (new `image_digest`), then a broker and supervisor restart. - An old image behind the new broker fails with `DISPATCH_CHILD_CREDENTIAL_MISSING`. - A new image behind the old broker fails with `DISPATCH_CHILD_SOURCE_REFUSED`. The supervisor image is unchanged. M45 T-2014 is already rolled out, so the Codex slot needs its own profile change. ## Residual risk (B1, unchanged) The model can still read `/run/provider/*`, or its CLI's env through `/proc`, because it runs as the same uid. The output scrubbing stays the barrier, and a credential-injecting gateway outside the child remains the later hardening. Plan: Scrum4Me `docs/plans/M41-credential-buiten-sources.md` (ProductDoc PLANS/m41-credential-buiten-sources). Sprint S-2026-10-06-1, story ST-1637, task T-2033. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Claude review slot found its own `claude_oauth_token` in /sources, next to
the pinned documents it is told to read (ISS-6). The broker copied operator
sources (the child's provider credential) and the service-signed pins into the
same attempt directory, and the child only left the name out of
source_artifacts. Models routinely run `sha256sum /sources/*`, so they opened
the file on most runs.

The three provider-credential keys now go to <attempt>/provider, mounted
read-only at /run/provider. The child reads them there and refuses to run when
a credential name appears among /sources (DISPATCH_CHILD_SOURCE_REFUSED), which
also turns a broker/image mismatch into a clear failure. A signed pin always
stays in /sources. Host config, profiles, the refresher and the prompts are
unchanged.

Tests: the broker test proves /sources holds exactly the signed pins
(`__dispatch_input` + documents, or `__repository_base`) with the credential
only under provider/; a mount test; the child refusal for each name; and the
model-image probe checks the real container's view. The broker fixture now
copies operatorKeys, which readCode otherwise also pushed into the operator
config.

Rollout is lockstep per slot: broker code, model image and profile revision
together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(dispatch): operator doc and image comments for the /run/provider mount
All checks were successful
CI / Compose config (pull_request) Successful in 5s
CI / Build-arg coverage (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 59s
e656a8a13f
Delivery, residual risk, upgrade order and proof for the provider credential on
its own mount (ISS-6): /sources holds only the signed pins, the child refuses a
credential name there, and broker code and model image move together per slot.
The B1 residual risk stays as it was: the model can still read its own
credential, so the gateway remains the later hardening.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
s4m-codex-reviewer left a comment

COMMENT

De diff op commit e656a8a13f is inhoudelijk conform T-2033. Geen blokkerende bevindingen in codekwaliteit, architectuur/patronen of documentatie gevonden. Volgens de safe-default blijft het verdict COMMENT vanwege beperkte onafhankelijke runtimeverificatie.

Findings

  • INFO — tests/dispatch-model-image.integration.ts:126 — De nieuwe containercheck is aangesloten voor de drie runtimevarianten, maar kon hier niet uitgevoerd worden: Docker ontbreekt. Ook Vitest start niet door een omgevingsfout bij het laden van de rolldown native binding (ERR_DLOPEN_FAILED: failed to map segment). Dit bewijst geen coderegressie; de groene suite en containerprobes uit de PR-beschrijving zijn niet onafhankelijk bevestigd.

Beoordeling en verificatie

Broker, containerargumenten en child-entrypoint gebruiken consistent de aparte read-only mount /run/provider. Gesigneerde pins blijven in /sources; credentialnamen daarin worden geweigerd. De tests dekken mountscheiding, mountinjectie, de drie credentialnamen en release-opruiming. De operatordoc beschrijft de broker/image-mismatch en het resterende risico correct.

Zelf uitgevoerd: TypeScript dispatch-typecheck geslaagd; git diff --check geslaagd. De PR is resolveerbaar en de actuele head-SHA komt overeen met de payload. Productstandaarden getoetst via de productdoc architecture/overview en de agent-guide; dispatchdetails via het gekoppelde taakplan en de operatordoc.

Plan-conformiteit

plan gekoppeld via pr_refs (product Scrum4Me). References: T-2034 (Scrum4Me), T-2014 (Scrum4Me), T-2033 (Scrum4Me), ST-1637 (Scrum4Me). Er zijn geen omitted onderdelen.

De code, tests, probe en operatordoc komen overeen met het plan van T-2033. De PR claimt geen volledige afronding van ST-1637 of ST-1632: de uitrol van T-2034 en de Scrum4Me-documentatie/ISS-6-afhandeling van T-2035 zijn vervolgwerk en vormen daarom geen blokkerende finding voor deze PR.

# COMMENT De diff op commit e656a8a13fe2d87dd60572ffdaf49a580e17255d is inhoudelijk conform T-2033. Geen blokkerende bevindingen in codekwaliteit, architectuur/patronen of documentatie gevonden. Volgens de safe-default blijft het verdict COMMENT vanwege beperkte onafhankelijke runtimeverificatie. ## Findings - **INFO — tests/dispatch-model-image.integration.ts:126** — De nieuwe containercheck is aangesloten voor de drie runtimevarianten, maar kon hier niet uitgevoerd worden: Docker ontbreekt. Ook Vitest start niet door een omgevingsfout bij het laden van de rolldown native binding (`ERR_DLOPEN_FAILED: failed to map segment`). Dit bewijst geen coderegressie; de groene suite en containerprobes uit de PR-beschrijving zijn niet onafhankelijk bevestigd. ## Beoordeling en verificatie Broker, containerargumenten en child-entrypoint gebruiken consistent de aparte read-only mount `/run/provider`. Gesigneerde pins blijven in `/sources`; credentialnamen daarin worden geweigerd. De tests dekken mountscheiding, mountinjectie, de drie credentialnamen en release-opruiming. De operatordoc beschrijft de broker/image-mismatch en het resterende risico correct. Zelf uitgevoerd: TypeScript dispatch-typecheck geslaagd; `git diff --check` geslaagd. De PR is resolveerbaar en de actuele head-SHA komt overeen met de payload. Productstandaarden getoetst via de productdoc architecture/overview en de agent-guide; dispatchdetails via het gekoppelde taakplan en de operatordoc. ## Plan-conformiteit plan gekoppeld via pr_refs (product Scrum4Me). References: T-2034 (Scrum4Me), T-2014 (Scrum4Me), T-2033 (Scrum4Me), ST-1637 (Scrum4Me). Er zijn geen omitted onderdelen. De code, tests, probe en operatordoc komen overeen met het plan van T-2033. De PR claimt geen volledige afronding van ST-1637 of ST-1632: de uitrol van T-2034 en de Scrum4Me-documentatie/ISS-6-afhandeling van T-2035 zijn vervolgwerk en vormen daarom geen blokkerende finding voor deze PR.
Merge master into fix/dispatch-provider-mount (resolve with M46 renumbering)
All checks were successful
CI / Compose config (pull_request) Successful in 5s
CI / Build-arg coverage (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 58s
2380f5c6a7
Conflicts with #115 in lib/dispatch-child.ts and docs/dispatch-runtime-operator.md
were the same lines: #115 renumbered M45 to M46, this branch moved the credential
from /sources to /run/provider. Both are kept. The operator doc's Rotation line no
longer claims the broker pins at start: the pin lives in broker.json and the broker
checks every create against it (found during the M46 rollout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Conflict met master opgelost in 2380f5c (merge, geen force-push). #115 hernummerde M45 naar M46 op dezelfde regels waar deze PR /sources → /run/provider zet, in lib/dispatch-child.ts en docs/dispatch-runtime-operator.md; beide wijzigingen zijn behouden. Daarnaast is de Rotation-regel in de operatordoc gecorrigeerd: de broker pint niet bij zijn start, de pin staat in broker.json en elke create controleert daartegen. Checks: typecheck:dispatch ok; vitest run 1157 geslaagd, alleen de 2 bekende macOS-failures in transcript-retention; geen /sources/<credential>-verwijzingen meer.

Conflict met master opgelost in 2380f5c (merge, geen force-push). #115 hernummerde M45 naar M46 op dezelfde regels waar deze PR `/sources` → `/run/provider` zet, in `lib/dispatch-child.ts` en `docs/dispatch-runtime-operator.md`; beide wijzigingen zijn behouden. Daarnaast is de Rotation-regel in de operatordoc gecorrigeerd: de broker pint niet bij zijn start, de pin staat in `broker.json` en elke create controleert daartegen. Checks: `typecheck:dispatch` ok; `vitest run` 1157 geslaagd, alleen de 2 bekende macOS-failures in transcript-retention; geen `/sources/<credential>`-verwijzingen meer.
s4m-codex-reviewer left a comment

COMMENT

De wijziging is bij statische inspectie coherent: operatorcredentials gaan naar een afzonderlijke read-only mount, gesigneerde pins blijven in /sources, en het kind weigert credentialnamen tussen de bronnen. Padvalidatie, credentialselectie, opruiming en operator-documentatie volgen hetzelfde contract. Geen blokkerende code-, architectuur- of planfinding gevonden.

Findings

  • INFO — tests/dispatch-model-image.integration.ts:126 — Verificatiebeperking: de nieuwe containercheck is aanwezig voor CODEX, CODEX_CHATGPT en CLAUDE, maar kon hier niet onafhankelijk worden uitgevoerd omdat Docker ontbreekt. Ook Vitest start niet: /tmp is noexec, waardoor de native rolldown-binding niet geladen kan worden. Dit is een beperking van de reviewomgeving, geen aangetoonde PR-regressie. Daarom COMMENT volgens de safe-default bij resterende verificatietwijfel.

Plan en scope

plan gekoppeld via pr_refs (product Scrum4Me). References: T-2034 (Scrum4Me), T-2014 (Scrum4Me), T-2033 (Scrum4Me), ST-1637 (Scrum4Me). Er is niets omitted.

De diff dekt T-2033: broker, child, runtime-mount, regressietests, containerprobe en operatordoc. De PR benoemt uitrol T-2034 expliciet als vervolgwerk; productsynchronisatie en ISS-6-afsluiting onder T-2035 vallen eveneens buiten deze code-PR. Die resterende storycriteria zijn hier geen blokkade. De gelezen product-architectuurdoc geeft geen strijdige standaard.

Verificatie

Exacte head gecontroleerd: 2380f5c6a7. Na initialisatie van het gepinde shared-submodule slaagt node node_modules/typescript/bin/tsc -p tsconfig.dispatch.json --noEmit. De in de PR vermelde unit- en Docker-resultaten zijn auteursbewijs; ze zijn hier niet opnieuw bevestigd.

# COMMENT De wijziging is bij statische inspectie coherent: operatorcredentials gaan naar een afzonderlijke read-only mount, gesigneerde pins blijven in /sources, en het kind weigert credentialnamen tussen de bronnen. Padvalidatie, credentialselectie, opruiming en operator-documentatie volgen hetzelfde contract. Geen blokkerende code-, architectuur- of planfinding gevonden. ## Findings - **INFO — tests/dispatch-model-image.integration.ts:126** — Verificatiebeperking: de nieuwe containercheck is aanwezig voor CODEX, CODEX_CHATGPT en CLAUDE, maar kon hier niet onafhankelijk worden uitgevoerd omdat Docker ontbreekt. Ook Vitest start niet: /tmp is noexec, waardoor de native rolldown-binding niet geladen kan worden. Dit is een beperking van de reviewomgeving, geen aangetoonde PR-regressie. Daarom COMMENT volgens de safe-default bij resterende verificatietwijfel. ## Plan en scope plan gekoppeld via pr_refs (product Scrum4Me). References: T-2034 (Scrum4Me), T-2014 (Scrum4Me), T-2033 (Scrum4Me), ST-1637 (Scrum4Me). Er is niets omitted. De diff dekt T-2033: broker, child, runtime-mount, regressietests, containerprobe en operatordoc. De PR benoemt uitrol T-2034 expliciet als vervolgwerk; productsynchronisatie en ISS-6-afsluiting onder T-2035 vallen eveneens buiten deze code-PR. Die resterende storycriteria zijn hier geen blokkade. De gelezen product-architectuurdoc geeft geen strijdige standaard. ## Verificatie Exacte head gecontroleerd: 2380f5c6a728f64292f03f64a132af5995b98601. Na initialisatie van het gepinde shared-submodule slaagt `node node_modules/typescript/bin/tsc -p tsconfig.dispatch.json --noEmit`. De in de PR vermelde unit- en Docker-resultaten zijn auteursbewijs; ze zijn hier niet opnieuw bevestigd.
janpeter merged commit 580526b68e into master 2026-10-07 02:49:44 +02:00
janpeter deleted branch fix/dispatch-provider-mount 2026-10-07 02:49:44 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/scrum4me-docker!114
No description provided.