Public: anyone can read this; the crew can change it.
A run gets exactly the secrets it declares, for exactly that run, and never in a transcript #369
A run now receives only the secrets its brief or issue declares, for that run alone, and a granted value is kept out of the log, events and commits. bun test is not fully green here: 10 tests fail, and I did not check them against main.
stopped closed without shipping
2 earlier comments
I merged main into the branch and pushed it; the two conflicts are resolved and the merge result typechecks. I did not rerun the full bun test suite after the merge. I ran only test/run-secrets.test.ts, test/kernel.test.ts, test/secret-store.test.ts and test/crew.test.ts, and all 44 tests in them pass.
src/core/schema.ts:mainalso added a migration 35, the feed'sinteractiontable. I kept that one as 35 and renumbered therun_secrettable to migration 36, so it runs after it.src/kernel/log.ts: I kept the error ring thatmainadded tocreateLog. The log line is still redacted withredactHeld, so granted secret values stay out of it.
Everything else in the pull is unchanged: a run gets only the secrets it declares, for that run only. Granted values are redacted from the log, events and commits, and the run page shows the names held.
I merged main into the branch and pushed; the only conflict was the import block in src/main.ts, and it is resolved.
- Imports in
src/main.ts:mainnow importsresolveDestinationfrom./snapshot/destination.tsin place of the old snapshot store imports (dirStore,s3FromEnv,s3Store). I kept that and dropped the old store imports, which nothing else in the file uses. I also kept myreleaseOrphansimport. - Checks run:
tscis clean, and 35 tests pass acrosstest/run-secrets.test.ts,test/kernel.test.tsandtest/crew.test.ts. I did not rerun the full suite after this merge. It had 10 failures on the earlier run (mirror/origin, Instagram and sign-in-throttle tests, plus an off-host redirect test that returnedunreachable), and I didn't check those againstmain.
Nothing else in the pull changed: a run still gets only the secrets it declares, for that run only, with values redacted from the log, events and commits.
A run now receives only the secrets its brief or issue declares, for that run alone, and a granted value is kept out of the log, events and commits.
bun testis not fully green here: 10 tests fail, and I did not check them againstmain. They are mirror/origin, Instagram and sign-in-throttle tests, and only the off-host redirect failure was read (unreachableinstead ofinvalid_response, which looks like the sandbox's restricted network). The newtest/run-secrets.test.tsand the crew, sandbox, secret-store and run-lease tests pass, andtscis clean.What changed
Only declared names are resolved (narrowest scope wins). A malformed name or host, or a name that would shadow the run's environment (
FORGE_*,GIT_*,PATH, …), is refused and said in the run log. Names that exist at no scope are logged as "not set".src/crew/grant.tsdoes this.FORGE_TOKEN. An@hostis added to the sandbox allowlist for that run only, but only if its secret was actually granted, and it is logged by host name.kernel/log.ts, with hooks inruns/log.tsandcore/events.ts.src/crew/leak.ts). If commits the agent already made contain a value, the branch is not pushed and the run says so.run_secrettable (migration 35) stores names and scope, never values. The grant is released in the runner'sfinally, so a crash is covered, and a 30-second sweep inmain.tscloses any left open. The classic run page shows "Secrets held: NAMES (released)".docs/APPS.md.Tests:
test/run-secrets.test.tsplants a value and shows it never reaches the log (plain or encoded) or an event. It also covers a value written into a file and into a commit, the egress widening, and the crash sweep.Left out
To try: set a forge secret under Settings → Secrets, assign an agent an issue whose body starts with the front-matter above, and open the run page to see the names held.
🤖 Generated with Claude Code
Closes #336