Repository navigation
feat(review): hand reviewers the read-only target repository token - #1489
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 8, 2026, 3:23 AM ET / 07:23 UTC. ClawSweeper reviewWhat this changesPass the existing read-only repository token to Codex reviewers and make capability prompts reflect each runner’s actual credential environment. Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful: current main does not supply the inspection token to reviewers. The prior OpenClaw finding is fixed, and the recorded proof override resolves the previous proof blocker. No actionable patch defect remains. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper prepares repository context and launches an agent to review it. This change connects the workflow’s inspection token to Codex’s environment while keeping OpenClaw’s credential filter and both runners’ capability descriptions consistent. flowchart TD
A[Workflow inspection token] --> B[Sanitized reviewer environment]
B --> C[Runner selection]
C --> D[Codex receives token]
C --> E[OpenClaw filters token]
D --> F[Authenticated GitHub reads]
B --> G[Capability prompt]
E --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the narrowly scoped token handoff, truthful runner-specific prompts, and documented maintainer acceptance together without broadening credentials or network permissions. Do we have a high-confidence way to reproduce the issue? Not applicable as a new capability; source confirms main omits the reviewer token, and current-head traces demonstrate the new handoff without establishing live authenticated quota. Is this the best way to solve the issue? Yes, within the recorded maintainer-approved boundary: it reuses the existing token and sanitizer while preserving OpenClaw filtering and aligning both prompt paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f6b3a613c509. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Fixed the accepted OpenClaw capability finding on the current head while preserving its final credential filter. The main PR body now contains the finding disposition, current synthetic Codex exec proof, an OpenClaw subprocess-boundary probe, and the maintainer's explicit token-exposure decision and synthetic-only proof scope. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Resolves a problem where hosted ClawSweeper reviewers hit unauthenticated GitHub API limits on shared runners despite having allowlisted network access. Related: #1484 and #1487.
Why This Change Was Made
Restore the existing target-repository GitHub App inspection token to the review child only as
GH_TOKEN, throughcodexEnv. It has read-only contents, issues, and pull-request access and expires within an hour. Both the hosted workflow's prebuilt prompt and runtime-generated prompts use the same sanitized environment that reaches the reviewer. Legacy Codex sandbox selections retain token pass-through; the app-server worker already inherits this environment. OpenClaw retains its existing final child credential filter, so its prompts correctly continue to say that no GitHub token is supplied.The managed proxy mode, host allowlist, filesystem permissions, and write-credential boundary are unchanged. Reviewers are instructed to use authenticated GitHub reads and never put the token in a URL, log it, or send it to a non-GitHub host.
User Impact
Codex reviewers can authenticate target-repository reads instead of consuming the shared runner's public GitHub rate limit. When no token is supplied, prompts continue to direct reviewers to public endpoints and pre-fetched context. This change does not give reviewers GitHub write access.
OpenClaw Bay Impact
Unaffected: this changes reviewer authentication and capability guidance only. It changes no lifecycle state, review publication format, queue behavior, public observer data contract, or Bay UI/API surface.
Documentation Impact
Updated active security guidance in
README.mdand the active “Reviewer network boundary” section indocs/pr-review-comments.md, plus the Unreleased changelog. ClawSweeper maintainers own the boundary; the review runtime,codexEnv, and setup permission profile are its sources of truth. Scope verified against this PR and Codex 0.153.3; update when token handling, runner selection, the pinned CLI, or the permission profile changes. Corrected the stale credential comment in the permission profile without changing its settings.Evidence
codex-review-runner,review-prompt-policy,agent-runner,codex-process,review-command-workflow, andopenclaw-processafter the accepted OpenClaw finding was fixed.check: 5,347 passed, 19 failed, 13 skipped. The additional workflow failures were traced to Homebrew Bash 5.3.15 blocking inheredoc_write; affected stalled test processes were terminated, and all 151 sweep/cluster/reconcile tests plus all 6 dispatcher tests passed when rerun with system Bash through a task-local PATH wrapper. The remaining unrecovered failures are confined to the known host-environment fixturestest/apply-drift-refresh.test.tsandtest/live-proof-review-environment.test.ts.test:unit: 3,497 passed, 22 failed, 6 skipped. It began before all repair artifacts were built; the scanner file affected by that setup error passed all 260 tests after the build. The same Bash recovery and known host-fixture limitations apply. No source changes were made for host/toolchain failures.pnpm check, passed for the initial head294c48dde52241b2c611680206db24342b85a2fb. CI runs again for the OpenClaw correction; the follow-up local full check also runs with the system Bash wrapper.Real Behavior Proof
Claim and surface: a synthetic inspection token reaches the real Codex exec review sandbox only as
GH_TOKEN; a bearer-authenticated GitHub request reaches GitHub while an unlisted host remains blocked.Revision: 8ca5453. Both boundary probes were rerun after this commit.
Environment and fixture: local macOS 27.0 arm64, Node 24.20.0, pinned
@openai/[email protected], isolatedCODEX_HOME, and the repository'sclawsweeper-reviewpermission profile. Provider: local macOS Codex sandbox; container image/lease: not applicable. The Responses provider was a local scripted fixture that emitted the tool calls; Codex exec, its shell tools, managed proxy, and the HTTPS requests were real. The parent environment was cleared withenv -i; only the synthetic token was supplied. No real GitHub credential or model-service credential was used.Harness command and environment handoff:
The harness calls
codexEnv({ ghToken: process.env.CLAWSWEEPER_PROOF_INSPECTION_TOKEN }), sets the isolatedCODEX_HOME, and launches the pinned binary withexec --ephemeral --skip-git-repo-check --json -C <proof-directory> -c 'default_permissions="clawsweeper-review"'. It uses the unchanged permission-profile contents. The controlled provider requests these three commands as separate real shell calls:Observed output:
The environment command exited 0 with no output for the two forbidden names. The GitHub command exited 0 and returned HTTP 401, proving transport and bearer-header pass-through with a synthetic credential. The unlisted host was rejected by Codex's managed network enforcement.
Artifact/trace: the observed tool outputs are transcribed above; the local harness retained
proof-transcript.txt, the exec JSONL trace, and tool-output JSON for the handoff. The runtime and app-server regression tests separately verify that production environment wiring supplies the same token-only mapping.Limits: this synthetic proof does not validate a real installation token's permissions, expiration, or authenticated quota. It exercises local macOS; the existing credential-free Ubuntu
review-network-smokeCI job covers hosted Linux proxy/filesystem enforcement. No claim of resistance to prompt injection is made.OpenClaw final child boundary
The accepted P2 finding is corrected: OpenClaw strips
GH_TOKENin its final child environment allowlist. Capability reporting now accounts for that filter, its existing subprocess test compares the advertised capability to the observed child environment, and README/review guidance no longer promise a token to OpenClaw.A controlled execution of production
runOpenclawProcessused a synthetic child CLI probe to record the actual worker/child environment. This exercises the real environment filtering and subprocess chain; it does not exercise the OpenClaw gateway or contact a model provider.Review Disposition and Maintainer Decision
Known Gaps
A prompt-injected reviewer could still leak the token in a GET query string to an allowlisted third-party host. The mitigation is the token's read-only, single-repository, one-hour scope. The prompt warning is guidance, not an enforced credential containment boundary. Authenticated installation limits still apply.
Maintainer Decision
The repository owner decided to hand reviewers the read-only target-repository token and accepts the documented exception: the credential handoff, bearer transport, unlisted-host rejection, and OpenClaw child filtering are proven with a synthetic token on the current head; scoped authorization and revocation are not exercised with a live App token outside the hosted job, and the residual disclosure path is a prompt-injected GET to an allowlisted third-party host, bounded by the token's read-only, single-repository, one-hour scope.
proof: overriderecords this decision.