Repository navigation
Redact credentials the harness did not inject from raw artifacts - #112
Merged
Merged
Conversation
Raw artifacts were redacted by the values of the env vars the harness injects, plus a few vendor key shapes. Credentials the harness did not inject were not redacted from raw artifacts: `hookdeck ci` mints a CLI key inside the sandbox and writes it to the CLI config file, and an agent that printed the file put that key in the transcript. It has no prefix and is in no env var the harness can see. - Read the Hookdeck CLI config files out of each attempt's sandbox before it is torn down, and add their credential values to the redaction set for every artifact the cell writes: the result file, its superseded attempts and errored-cell evidence. - Redact any value assigned to a credential-marking name (`api_key = '...'`, `KEY=...`, `"secret": "..."`, `--webhook-secret ...`, `Bearer ...`), everywhere it appears in the artifact. Distinct values get distinct numbered markers so a transcript still shows whether two places held the same secret. - Add `check-artifacts`, which re-applies the redaction passes to the files about to be uploaded. The workflow runs it before both raw uploads and skips them if it finds anything, failing the job rather than the cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad check Follow-up to review of the raw-artifact redaction. - Match `secret_key`, `secret_access_key` and Hookdeck's own `webhook_secret_key` in the JSON/YAML assignment pattern. It required `secret` to be followed directly by the quote, so values in those fields were not redacted. `header_key` and plain `key` stay excluded. - Run "Check the regression suite passed" when the credential check has failed, so a red regression cell is still reported as one. - Log to stderr when reading the sandbox's CLI config does not complete, with the exit code only and never the output, and keep what was read. - Number discovered credentials per cell, so two minted keys stay distinguishable in a transcript, and precompute first-seen positions when numbering assigned values. - Correct the docs: a failed credential check skips the uploads, and because publish-results reads rows from those artifacts the cell is not published either; it counts as missing, or an earlier row stands in under the missing-cell floor. State the assignment thresholds (16 or more characters, a letter and a digit) and that values are found by name and then redacted by value. 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.
Closes #110
What this fixes
Credentials the harness did not inject were not redacted from raw artifacts. Redaction worked by the values of the env vars the harness puts into the sandbox, plus a few vendor key shapes. The Hookdeck CLI key that
hookdeck cimints inside the sandbox is neither: the CLI writes it to~/.config/hookdeck/config.toml, it has no prefix (the CLI only checks it is at least 12 characters), and no env var the harness can see holds it. An agent that printed the config file put the key in the transcript.What changed
harness/sandbox-credentials.ts). After each attempt's agent run, while the container still exists and before the guards and scorer, the harness reads every Hookdeck CLI config file in the places the CLI looks (~/.config/hookdeck,$XDG_CONFIG_HOME,$HOOKDECK_CONFIG_FILE, any.hookdeck/in the workspace). Their credential values (api_key,guest_url,*_token,*_secret) are added to the redaction set for every artifact the cell writes: the result file, its superseded attempts and errored-cell evidence. Each distinct value gets a numbered marker (<redacted:hookdeck-cli-config:api_key-1>,-2), so two minted keys stay distinguishable. The read never throws. If it does not complete, it says so on stderr with the exit code only and still uses whatever it read.harness/redact.ts). A value of 16 or more characters, containing a letter and a digit, is found by the name it is assigned to and then redacted by value everywhere it appears in the artifact. The forms areapi_key = '…',NAME_KEY=…,"secret": "…","webhook_secret_key": "…","secret_access_key": "…",--webhook-secret …andBearer ….header_key, plainkey, references such as${VAR},$VARandprocess.env.X, and placeholder words are left alone. Markers are numbered per artifact, so a transcript still shows whether two places held the same secret, which matters when the failure being read is a source configured with the wrong one.scripts/check-artifacts.ts,lib/artifact-check.ts). A new workflow step re-applies the redaction passes to the files about to be uploaded and fails if anything would still be removed. It prints file, kind and count, never a value. When it fails, the job fails and both raw uploads are skipped. The cell's score is unchanged, but it is not published either:publish-resultsreads rows from those artifacts, so the cell counts as missing, and an earlier row stands in only where the missing-cell floor allows (Publish partly failed runs, never cancelled ones, and name what is missing #103). "Check the regression suite passed" still runs in that case, so a red regression cell is reported as one.Verification
pnpm install,pnpm -r build,pnpm typecheckandpnpm format:checkpass.pnpm checkpasses: framework 144 tests, core 115, sandbox 31, web 71.actionlintpasses on the workflow.test/minted-credentials.test.tsuse fake values only. They cover each assignment form including thesecret_keyfamily, header names and references that must be left alone, idempotence, numbered markers, parsing the CLI config, the real discovery command run against a temporary HOME and workspace, discovery failing or timing out safely, discovered values reaching the result file, a superseded attempt and errored-cell evidence, and the upload check. Reverting each layer fails the tests that cover it.webhook_secret_keyor Outpost destinationcredentials.secretfields. A second pass changes nothing, so the upload check passes on what the harness writes.Not covered
--hookdeck-configpath outside the home directory and the workspace is not read. The assignment layer is the backstop for it.apps/framework/test/is not in the framework tsconfig (unchanged), so the new tests run under vitest without being type-checked.🤖 Generated with Claude Code