Repository navigation
ci(pullfrog): keep the job token off disk and the runner user untrusted by Nix - #756
Conversation
…ed by Nix The installer trusted the runner user, so the agent could set daemon options such as post-build-hook that run as root. Install with no token and no runner trust, pass the token to the PATH step alone through NIX_CONFIG, and fail if it still reached /etc/nix or the receipt. This replaces scrubbing the token after the installer wrote it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe workflow now installs Nix with an empty GitHub token and disables trust for the runner user. The PATH setup step provides the token through step-scoped Merge Risk:
|
There was a problem hiding this comment.
ℹ️ No critical issues — one suggestion inline.
Reviewed changes
I reviewed the switch from scrubbing the job token after the Nix installer writes it to never giving the installer the token, along with the new untrusted-runner setting.
- Installer gets no token and no trust:
github-token: ""keepsaccess-tokensout of/etc/nixand/nix/receipt.json, andtrust-runner-user: falsekeeps the runner user out oftrusted-users, which closes the path to root through the daemon. - Token scoped to the PATH step: flake input fetches authenticate through a step-scoped
NIX_CONFIG, so later steps never see it. The fetches run in the client, so the daemon doesn't need the token. - Fail-closed token check: the PATH step greps
/etc/nixand the receipt for the token. This replaces thesedscrub and the receiptchmod. - Quest plan prose:
quest/m0/pullfrog-setup.mdnow describes the new setup.
claude-opus-5-5 | 𝕏
trust-runner-user: false only stops the installer adding the runner to trusted-users; assert the daemon really treats it as untrusted, as the token guard does for the token, since neither runs before merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed the one commit added since the prior Pullfrog review.
- Runtime trust assertion: the PATH step now fails unless
nix store info --jsonreports.trustedasfalseor0, so a missing field also fails. This addresses the earlier suggestion that the trust half of the change had no fail-closed check.
claude-sonnet-5-5 | 𝕏

Summary
Follows up moq-dev/quest#751, which merged before CodeRabbit found the Nix installer makes the runner user a trusted daemon user (moq-dev/studio#182). Pullfrog's
no_new_privssandbox blocks sudo but not the daemon socket, and a trusted user's settings, such as apost-build-hook, run as root.The Pullfrog setup steps now:
trust-runner-user: false, so the runner user stays untrusted, andgithub-token: "", so the installer writes noaccess-tokensinto/etc/nix/nix.custom.confor/nix/receipt.json, both readable by the agent's shell;NIX_CONFIG;/etc/nixor the receipt, or ifnix store inforeports the runner as trusted (suggested by Pullfrog in this PR).This replaces scrubbing the token after the installer wrote it, and with it the
sedover/etc/nixand the receiptchmod. The same steps go to kixel-ai/rust2#841, moq-dev/studio#182, and moq-dev/web-transport#545, byte-identical across the four. The quest's Plan is updated to match.Caused by
trust-runner-user: true, so the agent could reach root through the Nix daemon (found by reviewer: CodeRabbit on ci(pullfrog): give reviews the dev shell's tools studio#182)Public API
None.
Validation
actionlintpasses; the setup steps are byte-identical to the three other repositories' PRs.src/index.tsat1d87d45):getStringOrNullmapsgithub-token: ""to null, which skips theaccess-tokensline, andtrust-runner-user: falseskipstrusted-users = root <runner>.NIX_CONFIG='access-tokens = github.com=abc' nix config show access-tokensprintsgithub.com=abc.nix store info --jsonprints"trusted":falseas an untrusted user (sudo -u nobody), which passes, and"trusted":trueas a trusted one, which fails; thejqfilter passesfalseand0and failstrue,1, and a missing field.pullfrogenvironment admits onlymain. The PATH step's grep fails the job if GitHub passed the default token instead of the empty input.just checkandjust testpass.Follow-ups
None.
Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: a272645
Base: origin/main at 920812a
Risk: high,
it changes .github/workflows/pullfrog.yml, which is always high: workflows run with the repository's secrets and decide what merges and shipsClassified: high by the always-high paths
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e084-b603-7281-84b1-888d4a8abf14, round 2Score: 9/10,
The added daemon-trust check fails closed and introduces no actionable defects found by code review; runtime validation was not performed as instructed.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1e084-b603-7ad2-b65a-a7a8e2f2e470Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0