Skip to content

feat(review): give reviewers allowlisted network access and a truthful capability prompt - #1487

Merged
steipete merged 2 commits into
mainfrom
review/allowlisted-network-profile
Sep 8, 2026
Merged

steipete merged 2 commits into
mainfrom
review/allowlisted-network-profile

Conversation

@steipete

@steipete steipete commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where issue/PR reviewers could publish inaccessible-evidence judgments after their prompt promised network access and a GitHub token that the review sandbox did not provide.

Why This Change Was Made

Hosted Codex review setup installs the clawsweeper-review profile in its isolated CODEX_HOME. It extends read-only filesystem permissions and enables a managed proxy in limited mode for the single checked-in host allowlist. Review exec and app-server calls preserve the configured policy instead of overriding it with a legacy read-only sandbox. The reviewer receives no GitHub inspection token, and its prompt describes public endpoints, blocked hosts, pre-fetched context, and downloaded media accurately.

Setup runs an enforcement smoke before any review can publish. It requires allowed HTTPS to succeed, unlisted HTTPS to receive a proxy rejection, and checkout writes to fail. Non-review callers retain their existing sandbox behavior.

Capability selection now follows the active runner before the Codex sandbox argument. Both prompt paths use the shared runner selector: Codex plus clawsweeper-review describes the allowlisted proxy, OpenClaw describes network access through gateway execution, and other Codex settings retain the no-review-tool-network statement. OpenClaw receives no GitHub token; its existing execution policy is unchanged, and its checkout guidance is explicitly instructional. The new review-network-smoke PR CI job proves the unchanged enforcement smoke on Linux bubblewrap without secrets.

User Impact

Codex reviewers can research public GitHub, npm, Node, MDN, and OpenClaw documentation while remaining confined to the listed hosts and a read-only checkout. Blocked hosts do not count as evidence against a PR. Offline local reviews retain an offline capability statement.

OpenClaw Bay Impact

Bay is unaffected: no dashboard/public API schema, lifecycle, action, or status contract changes. Existing report front matter review_sandbox now records clawsweeper-review for these jobs; Bay has no consumer of that field. Bay remains observer-only.

Documentation Impact

Updated active README security guidance and the active reviewer-network section in docs/pr-review-comments.md, plus the Unreleased changelog. The documentation names ClawSweeper maintainers as owner, the checked-in permission TOML as source of truth, Codex 0.153.3 as verified runtime, and CLI/profile/credential/smoke changes as update triggers. Reviewed the docs map and repository validation rules.

Evidence

Original implementation head: 114b9408b6e870bd17115e64b97d93b4e97fbe12. Detailed results and source citations are in .artifacts/review-network-profile/report.md. Build, format, lint, static checks, coverage thresholds, and independent Codex P0–P2 review passed. The unit run had 3891 passes / 19 failures / 6 skips; the full check had 5491 passes / 18 failures / 13 skips. Failures were confined to the workflow-subprocess and terminal/live-proof categories described in the work order. One additional focused installer-validator kill EPERM failure passed on isolated retry and in both broad runs; it is explicitly recorded in the report. All changed-network tests passed.

Follow-up head: 1e8c79b519544e8b1ce709fb323218fea8641be8. The pre-commit P0–P2 autoreview is scoped-clean. The two follow-up findings are addressed by runner-aware capability selection and the new review-network-smoke CI job. Focused validation passed all 140 tests, including the three capability selections, prompt rendering, OpenClaw credential filtering, and unchanged runner execution policy. The workflow reads Codex 0.153.3 from the setup action pin rather than duplicating it. Hosted Linux review-network-smoke passed on this head in 15 seconds (smoke/install step: 6 seconds). Its exact result lines are quoted below. CI for this head passed without retries: pnpm check, review-network-smoke, sparse repair build smoke, and Windows Codex launcher all succeeded; the dispatch-only hosted review scan was skipped.

Real Behavior Proof

  • Runner capability probe: the built runtime selector and prompt builder were exercised for codex + clawsweeper-review, openclaw + clawsweeper-review, and codex + read-only. The emitted capabilities are respectively allowlisted-proxy, unrestricted gateway execution, and none; all three state that no GitHub token is supplied. Artifact: .artifacts/runner-capability-proof.log. This proves prompt generation, not model inference.

  • Linux enforcement: review-network-smoke in .github/workflows/ci.yml uses GitHub-hosted ubuntu-24.04, Node 24, a temporary npm prefix, and a fresh isolated Codex home containing only model = "gpt-5.4" before configuration. It reads the setup action pin, applies the same user-namespace/AppArmor prerequisites, then runs configure-review-network.mjs and smoke-review-network.sh unchanged with GITHUB_WORKSPACE set to the checkout. No secrets, inference, or remote lease are used. The three-minute job fails on every smoke failure. Hosted job passed on follow-up head 1e8c79b519544e8b1ce709fb323218fea8641be8 in 15 seconds. Its exact output:

    allowed HTTPS: passed
    unlisted HTTPS: blocked by proxy
    checkout write: blocked
    

    The rejected host also emitted curl: (56) CONNECT tunnel failed, response 403. Artifact: .artifacts/findings-linux-smoke.log.

  • Claim: the pinned reviewer CLI provides bounded public HTTPS research without network approval prompts and keeps the target checkout read-only.

  • Surface: actual Codex 0.153.3 permission config loader, managed network proxy, curl, and macOS Seatbelt; the committed smoke script and configuration writer were executed unchanged.

  • Fixture: this worktree at base 175d75537c5fd3e68cde68e2098157957265fb51 plus the uncommitted changes. Synthetic local Responses fixtures supply fixed tool calls for exec/app-server probes; no model credentials or real model inference are used.

  • Environment: macOS 27.0 (arm64), Node v24.20.0, pnpm 11.10.0, codex-cli 0.153.3. Local provider: native Seatbelt, no remote lease/image.

  • Installation: PATH=$PATH npm install --prefix "$PWD/.artifacts/review-network-profile/codex-0.153.3" --no-save --no-audit --no-fund --ignore-scripts @openai/[email protected]; global installations unchanged.

  • Config: create .artifacts/review-network-profile/codex-home/config.toml containing model = "gpt-5.4", then run CODEX_HOME="$PWD/.artifacts/review-network-profile/codex-home" node .github/actions/setup-codex/configure-review-network.mjs.

  • Smoke command: CODEX_HOME="$PWD/.artifacts/review-network-profile/codex-home" GITHUB_WORKSPACE="$PWD" PATH="$PWD/.artifacts/review-network-profile/codex-0.153.3/node_modules/.bin:$PATH" bash .github/actions/setup-codex/smoke-review-network.sh.

  • Observed: api.github.com/zen returned a zen string and exit 0; example.com returned curl: (56) CONNECT tunnel failed, response 403; checkout creation returned Operation not permitted; smoke exit 0.

  • Exec command: PATH=$PATH node .artifacts/review-network-profile/probe-exec.mjs. The real exec tool returned allowed_exit=0; blocked_exit=56 plus domain is not on the allowlist for the current sandbox mode; write_exit=1. No approval event occurred. Also repeated with the review's --add-dir scratch argument.

  • Negative comparison: repeat the exec harness with --sandbox read-only. Both hosts fail with curl exit 6 (Could not resolve host); the checkout write still fails. This proves the legacy override suppresses the useful configured network path.

  • App-server proof: node .artifacts/review-network-profile/probe-app-server.mjs also preserved the profile, denied the unlisted host without prompting, and denied writes. GitHub returned its unauthenticated rate-limit response in this extra probe (allowed transport, not available API capacity).

  • Artifacts: app-server-proof.log, smoke-proof.log, exec-profile-proof.log, exec-profile-scratch-proof.log, exec-override-proof.log, and reproducible harnesses under .artifacts/review-network-profile/.

  • Limits: local proof exercises Seatbelt, not Linux bubblewrap. Linux bubblewrap enforcement passed in the dedicated PR CI smoke on the follow-up head. The proof exercises public endpoints and policy enforcement, not private GitHub access, all 15 individual hosts, inference quality, or real PR publication. No version bump was needed.

…l capability prompt

The review prompt promised network access and a GitHub token that the read-only sandbox never had. Reviews now select the clawsweeper-review Codex permission profile: a read-only filesystem, managed proxy in limited mode, a checked-in host allowlist, and no token. They use default_permissions instead of the legacy --sandbox override that suppresses the proxy. The setup smoke proves allowed HTTPS, proxy-denied HTTPS, and denied checkout writes before any review can publish.
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 8, 2026 05:11
@steipete
steipete requested a review from a team as a code owner September 8, 2026 05:11
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 1:56 AM ET / 05:56 UTC.

ClawSweeper review

What this changes

Adds allowlisted public network access for hosted reviewers, preserves the configured sandbox across execution paths, and makes reviewer prompts describe each runner’s actual capabilities.

Merge readiness

✅ Ready for maintainer review

This remains useful work absent from the pinned main branch. The earlier runner-capability finding is resolved, the supplied enforcement proof covers the changed boundary, and no actionable patch defect was found.

Priority: P2
Reviewed head: 1e8c79b519544e8b1ce709fb323218fea8641be8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported implementation with relevant cross-platform enforcement proof and no remaining actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied current-head Linux trace exercises the committed configuration writer and sandbox smoke with real Codex and curl, showing allowed HTTPS, proxy rejection, and denied writes; macOS exec/app-server traces additionally cover profile preservation. Synthetic Responses input controls tool calls rather than mocking transport enforcement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied current-head Linux trace exercises the committed configuration writer and sandbox smoke with real Codex and curl, showing allowed HTTPS, proxy rejection, and denied writes; macOS exec/app-server traces additionally cover profile preservation. Synthetic Responses input controls tool calls rather than mocking transport enforcement.
Evidence reviewed 8 items Policy and introduced scope: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-note files were found in the affected subtrees. The local diff matches the supplied base-to-head introduction evidence, and git diff --check passed.
Network boundary and dependency signal: The new profile directly configures Codex permissions: read-only inheritance, enabled managed proxy, limited mode, 15 exact allowed hosts, disabled upstream proxy, local binding, and SOCKS5. This establishes an affirmative dependency on Codex’s permission contract.
Official dependency contract: The fetched official Codex configuration reference documents named permission profiles, the need to activate network_proxy for domain enforcement, and avoiding legacy sandbox configuration alongside default_permissions: https://learn.chatgpt.com/docs/config-file/config-reference. This supports the configuration approach; the pinned-runtime behavior is established separately by the supplied traces.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s review runner combines repository and GitHub evidence into maintenance recommendations. Workflow setup configures its execution boundary, while the runtime launches reviewers and describes which evidence they can access.

flowchart TD
  A[Review workflow] --> B[Configure permission profile]
  B --> C[Verify network and write restrictions]
  C --> D[Launch reviewer]
  E[Repository and prefetched evidence] --> D
  D --> F[Allowlisted public research]
  D --> G[Maintenance recommendation]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Network scope 15 exact hosts; 3 enforcement assertions The shared profile bounds research access, and the smoke verifies allowed traffic, denied traffic, and denied checkout writes.
Net line growth Production source +38; automation/configuration +131; tests +140 Growth supports the stated permission-profile integration, capability reporting, and enforcement validation.

Technical review

Best possible solution:

Keep one bounded reviewer permission profile, preserve it across both Codex execution paths, and retain enforcement checks alongside accurate runner-specific prompts.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a feature review; the supplied before/after exec traces demonstrate the network difference between the legacy sandbox override and the new profile.

Is this the best way to solve the issue?

Yes. Reusing Codex’s permission profile and a shared capability selector avoids a separate networking implementation, while preserving other callers’ sandbox behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 175d75537c5f.

Labels

Label justifications:

  • P2: This is a bounded improvement to reviewer evidence access and capability accuracy, with no demonstrated urgent production outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied current-head Linux trace exercises the committed configuration writer and sandbox smoke with real Codex and curl, showing allowed HTTPS, proxy rejection, and denied writes; macOS exec/app-server traces additionally cover profile preservation. Synthetic Responses input controls tool calls rather than mocking transport enforcement.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied current-head Linux trace exercises the committed configuration writer and sandbox smoke with real Codex and curl, showing allowed HTTPS, proxy rejection, and denied writes; macOS exec/app-server traces additionally cover profile preservation. Synthetic Responses input controls tool calls rather than mocking transport enforcement.

Evidence

What I checked:

  • Policy and introduced scope: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-note files were found in the affected subtrees. The local diff matches the supplied base-to-head introduction evidence, and git diff --check passed. (AGENTS.md:1, 1e8c79b51954)
  • Network boundary and dependency signal: The new profile directly configures Codex permissions: read-only inheritance, enabled managed proxy, limited mode, 15 exact allowed hosts, disabled upstream proxy, local binding, and SOCKS5. This establishes an affirmative dependency on Codex’s permission contract. (.github/actions/setup-codex/review-permissions.toml:3, 1e8c79b51954)
  • Official dependency contract: The fetched official Codex configuration reference documents named permission profiles, the need to activate network_proxy for domain enforcement, and avoiding legacy sandbox configuration alongside default_permissions: https://learn.chatgpt.com/docs/config-file/config-reference. This supports the configuration approach; the pinned-runtime behavior is established separately by the supplied traces.
  • Execution and credential handling: The review runtime removes inspection-token injection and selects default_permissions without --sandbox for the new profile. The app-server worker preserves that selection through thread start, resume, and turn start. Existing legacy sandbox handling remains for other callers. (src/clawsweeper-review-runtime.ts:995, 1e8c79b51954)
  • Previous finding resolved: The current selector checks the active runner before the sandbox name; both prompt-building paths call it. OpenClaw receives gateway-specific capability text, while Codex receives the selected profile’s description. Added tests cover these distinctions. (src/agent-runner.ts:41, 1e8c79b51954)
  • Real enforcement proof: The complete supplied PR body at sourceRevision 6dd437f93b6c8e68f0e27e7ef7647b6b382c8dfb74f261989090f32998c45de2 records Linux enforcement on this head: allowed HTTPS passed, unlisted HTTPS received CONNECT 403, and checkout writes were blocked. It also records real Codex 0.153.3 exec/app-server probes on macOS with synthetic Responses input and actual transport enforcement. The linked Linux job is https://github.com/openclaw/clawsweeper/actions/runs/34191247054/job/101949589071. Its direct API retrieval failed because reviewer network access was unavailable; the captured proof and check results remain the evidence used. (.github/actions/setup-codex/smoke-review-network.sh:6, 1e8c79b51954)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-08T05:16:10.303Z sha 114b940 :: blocked before merge. :: [P2] Derive network capabilities from the active runner
  • reviewed 2026-09-08T05:40:06.459Z sha 1e8c79b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T05:47:19.773Z sha 1e8c79b :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 8, 2026
@steipete
steipete merged commit f6b3a61 into main Sep 8, 2026
27 of 33 checks passed
@steipete
steipete deleted the review/allowlisted-network-profile branch September 8, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant