Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 51dce82. Configure here.
| fetch(`https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/installation`, { | ||
| headers: { Authorization: `Bearer ${u}.${s.sign(key, "base64url")}`, Accept: "application/vnd.github+json", "User-Agent": "sandboxed-agent" }, | ||
| }).then((r) => r.json()).then((j) => { if (!j.id) throw new Error("no installation for this repository"); console.log(j.id); }); | ||
| ' "$STATE/app-key.pem") |
There was a problem hiding this comment.
App key path uses wrong argv
High Severity
The inline node -e installer reads the app private key from process.argv[1]. For node -e, that slot is [eval], and the pem path is process.argv[2]. readFileSync fails, so installation lookup never runs and the agent cannot mint GitHub credentials.
Reviewed by Cursor Bugbot for commit 51dce82. Configure here.
There was a problem hiding this comment.
False positive: with node -e '<code>' <arg>, process.argv is [<node>, <arg>]. There's no [eval] entry, so the pem path is argv[1]. Checked locally: node -e 'console.log(process.argv)' /tmp/x.pem prints ["/usr/bin/node","/tmp/x.pem"]. The live end-to-end run also got past this step and minted tokens that the in-sandbox gh and git push used.


actions/create-github-app-tokencalled without anypermission-*inputs mints a token carrying every permission the app installation holds, including administration and workflows write. This PR requests only what each token is used for downstream. Repository scope is unchanged unless noted.vuln-remediation.ymlscancontents: readactions/checkoutThis one matters more than most. Checkout persists the token in
.git/config, and the same job then runsnpm install -g @socketsecurity/cliand the Socket scan. Every repo that calls this reusable workflow gave that third-party code a token with admin and workflow write on its own repo. Thefixandprtokens in this workflow already had permission filters and are unchanged.That checkout now also sets
persist-credentials: false, so the token isn't left in.git/configwhile the Socket CLI installs and runs. The scan reads the local tree and never uses git credentials.Testing (vuln-remediation)
python3 -m unittest discover -s scripts -p test_vuln_remediation_workflow.py: 20 OK.actionlint: no findings.Action version: permission inputs only work from v2.0.4
actions/create-github-app-tokenbefore v2.0.4, v1.12.0 included, ignorespermission-*inputs: it readsINPUT_PERMISSION_*, but the runner exportsINPUT_PERMISSION-*. Thescan,fix,pr,container-remediationandpr-riskadmin-app tokens in this repo had therefore been minted with every app permission. They now use v3.3.0, andactions.lockis updated.New:
sandboxed-agent.yml, a standard way to run agents in CIA reusable workflow that runs Pi with
--approvein a Docker Sandbox: a microVM with its own kernel and Docker daemon on the GitHub-hosted runner. It replaces two copies of hand-rolled runner plumbing (a token helper,gh/git wrappers, and the app key written next to the agent), and is meant to become the standard way to run agents in CI here.mint-token.mjs, limited to the caller's repository and the caller'sapp-permissions. The sbx proxy adds them to GitHub requests and refreshes them every 30 minutes.llm-credentialsaction and are added the same way.gh pr checksinside the sandbox therefore reads check runs fromchecks-relay.mjs, which answers with the job's read-onlyGITHUB_TOKEN.merge: true, the agent writesready:<pr>.merge-gate.shthen runs on the runner, outside the agent's reach. It waits for checks, requires Cursor Bugbot and every check to pass on the head commit, and merges with--match-head-commit.sbxis pinned to v0.54.0 by SHA-256. Node.js inside the sandbox is checked against nodejs.org'sSHASUMS256.txt.The callers that use it are kernel/hypeship#1662 and kernel/kernel-tinker-rl#17. Merge this PR first.
Testing
scripts/test_sandboxed_agent.py, 12 tests, run by the newsandboxed-agent-tests.yml:ready:outcome.gh: green, BugBot missing, neutral or failing, a failing or pending check, red statuses, and a PR the agent already merged.actionlintandshellcheckare clean.