Repository navigation
fix(#176): restrict code agent GitHub API access to read-only - #178
Conversation
The github_api network policy in policies/code.yaml granted read-write access to api.github.com and github.com. Combined with the GH_TOKEN in the sandbox, this allowed agents to push branches and create PRs directly, bypassing harness post-script checks. Change both endpoints from access: read-write to access: read-only. The code agent only needs to read GitHub data inside the sandbox (issue context, PR details, repo contents). All write operations flow through the post-script on the runner. This matches the pattern already used by the review and retro agent policies. Closes #176
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 2:36 PM UTC · Completed 2:43 PM UTC |
ascerra
left a comment
There was a problem hiding this comment.
We must do the same for the fix agent as well.
Review — approveConfidence: high SummaryThis PR correctly restricts the code agent's GitHub API network policy from Correctness: The Security: This is a permission reduction that adds a network-layer backstop. Combined with the read-only scoped Scope: The change traces directly to issue #176 with no scope creep. Single file, single concern, value-only modification. Findings
Dimensional summary
Labels: PR modifies sandbox policy for the code agent, fixing a security bypass |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 2:57 PM UTC · Completed 3:05 PM UTC |
Apply the same read-only restriction to the fix agent's github_api network policy that was applied to the code agent. The fix agent only needs to read GitHub data inside the sandbox (PR diffs, issue context); all write operations flow through the post-script on the runner. This addresses review feedback from ascerra on PR #178.
🔧 Fix agent — iteration 1 (human-triggered)Addressed review feedback from ascerra: applied the same read-only GitHub API restriction to the fix agent policy (policies/fix.yaml) that was applied to the code agent policy in this PR. The fix agent only needs read access to GitHub inside the sandbox; all write operations flow through the post-script on the runner. Fixed (1):
Tests: passed Updated by fullsend fix agent |
The github_api network policy in policies/code.yaml granted read-write access to api.github.com and github.com. Combined with the GH_TOKEN in the sandbox, this allowed agents to push branches and create PRs directly, bypassing harness post-script checks.
Change both endpoints from access: read-write to access: read-only. The code agent only needs to read GitHub data inside the sandbox (issue context, PR details, repo contents). All write operations flow through the post-script on the runner.
This matches the pattern already used by the review and retro agent policies.
Closes #176
Post-script verification
agent/176-restrict-github-api-access)0dbf1959357382ecdb9bb39e3c69a5fa678af3c1..HEAD)