Workers and Reviewers never print a secret: check one with | wc -c, never let its value reach a tool result #94

Merged
city-root merged 1 commit from worker/gascitypacks-p5cy into main 2026-11-12 21:06:53 +00:00
Contributor

A Worker on root-tuo printed a key with bao kv get into its tool result (2026-11-12). This adds one rule, in the same words, to the Worker's prompt, the Worker's skill (worker) and the Reviewer's prompt: a command that prints a secret never runs so that its stdout reaches the session; pipe it into the consumer or into wc -c or a hash comparison and say only the size or result; if a value was printed anyway, stop, mail the Operator what and where (never the value), and go on. A .changelog/ fragment is included.

The bead asked for the rule "stated once where both read it". The Worker (roles pack) and the Reviewer (forgejo pack) share no file they both read: the Reviewer loads no skill, and a pack-level fragment would need roles composed wherever forgejo is. So the sentences are written in the Worker's prompt template, and tests hold the other places to them word for word.

Tests: tests/formula.sh takes the rule from the Worker's prompt template and checks that it says the three things, and that the Worker's rendered prompt and skill carry it; tests/reviewer.sh checks that the Reviewer's template and both rendered Reviewer prompts (city and rig) carry it. Both pass. Undoing the change, each fails: with the three content files restored from main, with the Reviewer's template and the skill restored (the Worker's template kept), the skill check in formula.sh and the three Reviewer checks in reviewer.sh fail. Not run: the other CI steps (the change touches prompts, one skill and tests only); changelog -base main and gc lint . pass.

Bead: gascitypacks-p5cy

A Worker on root-tuo printed a key with `bao kv get` into its tool result (2026-11-12). This adds one rule, in the same words, to the Worker's prompt, the Worker's skill (`worker`) and the Reviewer's prompt: a command that prints a secret never runs so that its stdout reaches the session; pipe it into the consumer or into `wc -c` or a hash comparison and say only the size or result; if a value was printed anyway, stop, mail the Operator what and where (never the value), and go on. A `.changelog/` fragment is included. The bead asked for the rule "stated once where both read it". The Worker (roles pack) and the Reviewer (forgejo pack) share no file they both read: the Reviewer loads no skill, and a pack-level fragment would need roles composed wherever forgejo is. So the sentences are written in the Worker's prompt template, and tests hold the other places to them word for word. Tests: `tests/formula.sh` takes the rule from the Worker's prompt template and checks that it says the three things, and that the Worker's rendered prompt and skill carry it; `tests/reviewer.sh` checks that the Reviewer's template and both rendered Reviewer prompts (city and rig) carry it. Both pass. Undoing the change, each fails: with the three content files restored from main, with the Reviewer's template and the skill restored (the Worker's template kept), the skill check in `formula.sh` and the three Reviewer checks in `reviewer.sh` fail. Not run: the other CI steps (the change touches prompts, one skill and tests only); `changelog -base main` and `gc lint .` pass. Bead: gascitypacks-p5cy
feat: Workers and Reviewers never let a printed secret reach the session (gascitypacks-p5cy)
All checks were successful
test / changelog (pull_request) Successful in 4s
test / lint (pull_request) Successful in 37s
test / scripts (pull_request) Successful in 51s
9a504d2ab5
On 2026-11-12 a Worker ran bao kv get so that the key reached its tool result and transcript. One rule, in the same words, now stands in the Worker's prompt and skill and in the Reviewer's prompt; tests/formula.sh and tests/reviewer.sh check that the Reviewer's template, both rendered Reviewer prompts, the Worker's rendered prompt and its skill carry the Worker template's sentences word for word. Checked: both tests pass, and fail with the Worker's template, or the Reviewer's template and the skill, restored from main.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review left a comment

Review of 9a504d2ab5 for gascitypacks-p5cy. Checks of the head: success.

Verdict

pass

Findings

  • [minor] roles/agents/worker/prompt.template.md:5, forgejo/agents/reviewer/prompt.template.md:16: the bead asked for the rule "stated once where both read it"; it is written three times, held word for word by tests. The description's reason holds: the Reviewer (forgejo pack) loads no skill of the roles pack and its prompt names none, so no file is read by both today. Nothing to change here. If the packs ever share a fragment, the copies can go.
  • [minor] README.md, "Permission mode": the README says what the Worker's skill and the Reviewer's prompt say about the file tools, and says nothing of this rule. A sentence there would help a reader of the pack, but the bead does not ask for one.

Verified

  • Read the work bead, the PR description, and REVIEW.md and README.md of origin/main (no AGENTS.md or CLAUDE.md there), plus the whole diff: 6 files, +27, additions only.
  • The rule's sentences are the same in the Worker's prompt template, the Worker's skill (which adds one sentence after them) and the Reviewer's prompt template. Each says the three things the bead asks for: never let the output reach the session, pipe it into the consumer or into wc -c or a hash comparison and report only the size, and when a value was printed, mail the Operator what and where without the value, then go on. The changelog fragment .changelog/never-print-a-secret.md is present, and the PR has a description.
  • Merged the head into the current origin/main (b38263d, which includes #92 that landed after the branch was cut): the merge is clean, and the forge reports mergeable.
  • On the merge result, with the city's variables removed (proved: 0) and a throwaway HOME for the scripts that run gc: gc lint . (2 packs ok), and tests/formula.sh, reviewer.sh, doctor.sh, operator-overlay.sh, researcher.sh, researcher-formula.sh and pack-cache.sh all pass. go vet ./..., go test ./... and go test -race ./... pass. The shell budget reports 32 units, 0 findings, and no shell was changed apart from the test additions. The scripts job's 13 tests (worktree-setup … permission-request) pass. changelog -base main (the city's build) exits 0.
  • Mutation tests in a scratch worktree: with the Worker's skill reverted to main, formula.sh fails on the skill check. With the Reviewer's template reverted to main, reviewer.sh fails its three new checks (template, and the rendered city and rig prompts). With a single clause of the Reviewer's template reworded, reviewer.sh fails the same three checks. The tests hold the copies word for word, as the description says.
Review of 9a504d2ab5aab0739c17a7463161a6fb2be9b742 for gascitypacks-p5cy. Checks of the head: success. ### Verdict pass ### Findings - [minor] roles/agents/worker/prompt.template.md:5, forgejo/agents/reviewer/prompt.template.md:16: the bead asked for the rule "stated once where both read it"; it is written three times, held word for word by tests. The description's reason holds: the Reviewer (forgejo pack) loads no skill of the roles pack and its prompt names none, so no file is read by both today. Nothing to change here. If the packs ever share a fragment, the copies can go. - [minor] README.md, "Permission mode": the README says what the Worker's skill and the Reviewer's prompt say about the file tools, and says nothing of this rule. A sentence there would help a reader of the pack, but the bead does not ask for one. ### Verified - Read the work bead, the PR description, and REVIEW.md and README.md of origin/main (no AGENTS.md or CLAUDE.md there), plus the whole diff: 6 files, +27, additions only. - The rule's sentences are the same in the Worker's prompt template, the Worker's skill (which adds one sentence after them) and the Reviewer's prompt template. Each says the three things the bead asks for: never let the output reach the session, pipe it into the consumer or into `wc -c` or a hash comparison and report only the size, and when a value was printed, mail the Operator what and where without the value, then go on. The changelog fragment `.changelog/never-print-a-secret.md` is present, and the PR has a description. - Merged the head into the current origin/main (b38263d, which includes #92 that landed after the branch was cut): the merge is clean, and the forge reports `mergeable`. - On the merge result, with the city's variables removed (proved: 0) and a throwaway HOME for the scripts that run gc: `gc lint .` (2 packs ok), and tests/formula.sh, reviewer.sh, doctor.sh, operator-overlay.sh, researcher.sh, researcher-formula.sh and pack-cache.sh all pass. `go vet ./...`, `go test ./...` and `go test -race ./...` pass. The shell budget reports 32 units, 0 findings, and no shell was changed apart from the test additions. The scripts job's 13 tests (worktree-setup … permission-request) pass. `changelog -base main` (the city's build) exits 0. - Mutation tests in a scratch worktree: with the Worker's skill reverted to main, formula.sh fails on the skill check. With the Reviewer's template reverted to main, reviewer.sh fails its three new checks (template, and the rendered city and rig prompts). With a single clause of the Reviewer's template reworded, reviewer.sh fails the same three checks. The tests hold the copies word for word, as the description says.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
mikluko/gascitypacks!94
No description provided.