Repository navigation
fix: require complete secret scans for hosted reviews - #1293
Conversation
Provision pinned TruffleHog in the shared worker bootstrap and require complete native review-input scans before model calls or cached success. Preserve fail-closed scanning, read-only workers, and existing proxy authentication; cover raw before/after/index content, normalization, deadlines, and redacted refusal paths. The ClawSweeper limitation on Crabbox's UUID inspection repair exposed the missing dependency: openclaw/crabbox#1590 (comment) . No Crabbox implementation changes are included.
Retire generated diagnostic copies before admission, persist retained prompts only after successful scanning with owner-only access, and remove unused copies. Preserve original inputs and explicit render exports. Complete isolated scanner fixtures for fake-model tests and extend hosted proof to diagnostic privacy.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 2:15 AM ET / 06:15 UTC. ClawSweeper reviewWhat this changesThe PR installs a checksum-pinned TruffleHog scanner on hosted review workers and refuses native review, repair review, or cache reuse until prompts and complete source inputs pass scanning. Merge readinessKeep this PR open for normal maintainer merge review. The prior local-upgrade concern is now explicitly resolved by the author’s stated fail-closed contract, and the pinned branch adds the intended host-owned scan boundary with current-head hosted proof. Priority: P1 Review scores
Verification
How this fits togetherClawSweeper turns GitHub item context and a checked-out change into a native structured review, then may reuse or publish that result. This PR adds a host-controlled admission scan before the reviewer can inspect the checkout or return a cached decision. flowchart LR
A[GitHub review request] --> B[Prompt and pinned source snapshot]
B --> C[Host-owned TruffleHog scan]
C -->|clean| D[Native read-only reviewer]
C -->|refused| E[Nonretryable review refusal]
D --> F[Structured review decision]
F --> G[Cache and published report]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single host-owned reviewer and fail-closed scan boundary, with the documented local scanner prerequisite as the supported upgrade path. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a PR with current-head hosted runtime proof rather than an issue reporting a current-main failure. Is this the best way to solve the issue? Yes: scanner installation outside the checkout plus input scanning before the existing native reviewer preserves a single review authority and the intended fail-closed boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1d6b8513271. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review complete for I select the documented prerequisite option: local native reviews require trusted TruffleHog immediately, just like hosted reviews. The one-time installation requirement and support impact are accepted; there is no unscanned compatibility path. Hosted bootstrap remains Linux amd64, the existing worker platform. No additional platform installer or permission expansion is required for this repair. Exact-head evidence is green: full dispatch CI and native scan proof, PR CI, and hermetic automerge container flow. The full suite recorded 4,021 passes, eight skips and zero failures; the separate focused coverage gate passed 12 tests. Windows, sparse repair builds, and CodeQL passed. The inspected native proof artifact records zero provider starts/retained prompts on refusal, one actual clean native review with its dynamic marker, and a Local validation included these commands (Node 24.20.0 for terminal cases): pnpm run build:nodenode --test test/live-proof.test.tsnode --test --test-name-pattern='terminal proof cleanup survives target-triggered pane wrapper death' test/live-proof-review-environment.test.tspnpm run check:docsgit diff --checkAll 147 compiled terminal-owner tests passed. Real macOS and current-head Ubuntu scenarios verify the changed terminal lifecycle; scanner regressions, source-blind refusal/privacy checks, and an actual local native review cover the admission boundary. Fresh Codex autoreview covered uncommitted changes and the complete committed branch with TruffleHog and reviewer isolation intact; no P0 findings remained. Limits remain explicit: this scans the initial explicit payload/schema and complete introduced content, not every later tool result or all repository history. Early loaded-Mac full/source-loader runs and an extra instrumented cleanup-deadline refusal are not counted as passing; a host/lifecycle-timing follow-up remains. CI fixture omissions, independent tmux exit/drain ordering, dead-pane EOF, and numeric/named signal recognition were repaired rather than bypassed. Net scope is +819 production/provisioning lines (+812 for the previously absent admission capability, +7 for the bounded terminal correction), +1,512 test/proof lines and +72 documentation lines. One native review authority is retained; no permissions, advisory workflow, release, or Crabbox UUID/default-key/prepared-lease implementation was changed. Merged-main verificationMerged as I downloaded and inspected the merged-main proof artifact. It identifies the merge SHA, Ubuntu image |
What Problem This Solves
Fixes hosted ClawSweeper reviews reporting an unavailable TruffleHog prerequisite without a host-owned scan-completion gate. The shared Ubuntu bootstrap installed Codex and its Responses proxy, but not the scanner expected by a repository-bundled autoreview helper.
The native structured decision still existed; the failed nested helper was not evidence that its separate scan/review completed. This was reported in the ClawSweeper review of Crabbox's UUID inspection repair. No Crabbox implementation is changed here.
Why This Change Was Made
The existing native structured review now owns mandatory secret-scan admission. Shared Codex/OpenClaw bootstrap installs the official TruffleHog 3.97.1 Linux amd64 archive after pinned SHA-256 verification and a real benign scan. Runtime resolution rejects scanner executables supplied by either checkout, including symlink and
..namecontainment cases.The host scans the exact explicit initial prompt/schema, full introduced diff, and complete raw before/after content. Repair includes HEAD, index, and current worktree states, so staging a value and restoring the working file cannot hide it. Existing Git merge-base and snapshot owners supply pinned identities; private quarantine lifetimes and pre/post scan plus post-model fences prevent stale acceptance. Raw bytes remain scanned when legitimate Git line-ending normalization differs from stored blobs. Host configuration is read only for normalization/attribute queries; object reads and canonicalization cannot execute target/global filters.
Missing tools, findings, scanner errors, incomplete input, source drift, and expired budgets fail closed before model invocation or cached success. Historical cache outcomes are invalidated by the existing policy version; semantic reuse still scans raw comment changes. Stale output is retired, diagnostics are redacted, and refusal is nonretryable infrastructure failure—not a finding-repair or fallback prompt.
Generated prompt diagnostics retire the previous attempt's copy and are written only after successful admission, with mode
0600. Unused commit-review, assist, and close-coverage copies are removed instead of maintaining another persistence path. Original inputs and explicit repair render/dry-run exports remain operator-owned.Installing the binary alone would leave the nested helper's sandbox/proxy-auth incompatibility unresolved. This keeps one native reviewer instead of adding a second review framework or widening worker privileges. Auth, model versions, sandbox/network permissions, and persistence schemas are unchanged.
User Impact
Hosted reviews either pass the supported scan and native review path or produce an explicit refusal. Local native-review users need a trusted TruffleHog installation outside the source and ClawSweeper checkouts. Workers never install dependencies themselves, and there is no scan-disable option.
Maintainer decision — local upgrade: the approved implementation contract intentionally applies fail-closed admission immediately to existing local native-review workflows as well as hosted workers. The added prerequisite and its support impact are accepted for this repair: install a trusted TruffleHog binary, then rerun the same review command. There is no grace period or legacy unscanned path; staging enforcement only for hosted workers would contradict the selected no-unscanned-review boundary.
The supported scan scope is the explicit initial payload and complete introduced content, with a 256 MiB staging cap and the existing review deadline. This is not universal scanning of later tool results, automatically loaded project instructions, resumed/steered history, or all repository history. Planning, assist, and close-coverage calls scan their explicit payload/schema rather than claiming complete source-review coverage.
CI Repair Included
PR-only CI exposed two additional owning-boundary defects. The hermetic automerge harness omitted its scanner fixture; its external tool-bin producer now supplies the existing fake scanner and requires a fresh matching prompt receipt before each fake model call. Its real container workflow passed without changing production scanner trust or isolation.
The failed full-check run also exposed retained terminal-proof races: tmux publishes process status and PTY closure independently, a watchdog's secondary child status could obscure the original wrapper's signal, and
pipe-panerejects an exited pane before closing its existing pipe. The terminal owner now waits for both exit observations and the exact zero-survivor cleanup receipt, preserves the original failure, and removes only the verified dead pane to deliver real capture EOF. The fixture uses a causal kill handshake instead of racing a sleep. Production growth for this correction is seven lines; no timeout, survivor check, lease/nonce binding, or signal permission was relaxed.OpenClaw Bay Impact
No Bay schema, observer API, controls, or UI changes. Existing failed/cached lifecycle fields carry the result; scan refusals retain their nonretryable classification. No sensitive scanner diagnostics are added to public projections.
Documentation Impact
Updated the existing README, local commit-review, repair, and cache documentation and native review prompts. They describe provisioning, local prerequisites, coverage limits, failure behavior, and the host-managed review contract without claiming a target helper ran. Added ClawSweeper changelog context following this repository's existing practice; unrelated release files are untouched. The retained terminal-proof reference also documents the CI-discovered exit/drain ordering and verified dead-pane capture cleanup.
Evidence
efd611760cf18ec855f8717873b0184be6a6b55c.pnpm run checkpassed in both the dispatch proof run and pull-request CI on the exact head. The first clean-runner pass exposed 30 fake-model fixture paths relying on the Mac's installed scanner; the fixture producers were completed without changing production scanning or weakening assertions, then rerun without a host scanner.Early full-check attempts on the heavily loaded Mac exceeded the execution window; source-loader attempts also hit filesystem/startup stalls. Those runs are not reported as green. The later hosted terminal failures were root-caused and repaired above; the final compiled owner suite (147/147), real Mac cases, and exact-head Ubuntu checks now pass. A separate follow-up remains for host filesystem latency. The complete hosted gate above is the full-suite evidence.
Real Behavior Proof
Claim and surface: the shared hosted bootstrap and production native runner refuse unavailable/failing scans before inference, then complete a clean scanned structured review through the unchanged Responses proxy and read-only Codex runtime.
Scenario: isolated synthetic Git base/head; missing scanner, scanner failure, findings, and unexpected output use a no-inference provider probe. They leave zero provider starts and cannot reuse pre-existing valid-looking output. The clean case uses the actual installed scanner and Codex, reads a fixture-specific UUID from the changed file, and returns it in parsed structured output. Checkout identity and scratch cleanup are asserted.
Environment: GitHub-hosted Ubuntu 24.04, image
20260823.283.1, TruffleHog 3.97.1, Codex 0.146.0, existing host proxy/authentication. Scanner archive SHA-256:f863ea3a8d786f7d097870496c977944cce7372a2fe1e56707d965016e543ece.Command:
node scripts/hosted-review-scan-smoke.mjs "$RUNNER_TEMP/hosted-review-scan-proof.json", run by the dispatch-only CI smoke job.Observed result: zero provider starts and zero retained prompt artifacts across refusal cases; one real clean native run with the correct dynamic marker, unchanged checkout, no remaining scanner scratch data, and an exact admitted diagnostic prompt with mode
0600. Hosted run · sanitized proof artifact.Local upgrade / Rank-up disposition: immediate universal enforcement is the selected maintainer contract (see User Impact), not a compatibility grace period. On the scanner-identical runtime at
243c9cd4c8, using macOS arm64 with Node 26.7.0, TruffleHog 3.97.1 and Codex 0.150.1, the realreview --local-rangeCLI refused a missing scanner with exit 1 and zero provider starts. With the trusted installed scanner exposed, the same CLI command completed with exit 0, one real provider execution, parsed structured output, and a0600prompt diagnostic using existing local Codex authentication without copying credentials. HEAD, the complete stage-0 index identity and every tracked file byte matched the original synthetic fixture; the expected local review-history Markdown artifact was created. The initial extra whole-.gitsnapshot assertion incorrectly included that intentional artifact, so the source invariants were independently rechecked rather than claiming metadata immutability. A separate fresh-fixture replay stopped atgit inittiming out on the loaded Mac, before scanning/inference. Fresh-host installation and complete native execution are also proven by the Ubuntu job above. No unscanned transition is introduced.Terminal runtime proof: deterministic ordering and signal/EOF regressions failed on the pre-fix compiled owner and passed on the repaired owner. The rebuilt driver also passed the actual tmux/PTY mixed-stream case, stale previous-pane assertion case, and target-triggered wrapper SIGKILL case on macOS with Node 24.20.0 and tmux 3.7c. The latter preserves exit 137, clean capture EOF, distinct process groups, and verified disappearance of the background child. Exact commands:
node --test --test-name-pattern='terminal cleanup waits for both tmux|terminal wrapper death owns failure|terminal pane status corruption' test/live-proof.test.tsandnode --test --test-name-pattern='terminal proof preserves its PTY|terminal proof cleanup survives target-triggered pane wrapper death|terminal proof does not satisfy a command from the previous pane state' test/live-proof-review-environment.test.ts. The wrapper case was replayed alone after correcting the fixture for numeric and named signal formats; the other two real cases passed unchanged. The first final-head Ubuntu runs exposed its numeric9format (versus the Mac'skill); only the fixture predicate changed, while exact PID/SIGKILL matching and all outcome/cleanup assertions remained. Earlier source-loader attempts hit local filesystem/startup stalls and are not counted as passing. This exercises real terminal lifecycle/capture behavior, not the retired automatic proof-generation or media-publication lane; no video is required for these terminal traces.Current-head native terminal scenario trace — copied from the successful Ubuntu runtime job, not a mock-tmux run:
The first two scenarios use real tmux/Bash/Node; the last two deterministically exercise protocol ordering. The real wrapper scenario verifies the original pane's SIGKILL before finalization, exit 137, preserved captured marker, no EOF/cleanup failure, distinct process groups, zero matching survivors, and
ESRCHfor the child PID. An additional instrumented Mac trace attempt hit the existing cleanup deadline and is not counted as passing; its host/lifecycle timing remains an explicit follow-up, not a reason to loosen cleanup.Limits: this proves the stated initial-payload/introduced-content admission boundary and the real hosted/native-local flows. It is not a universal provider-egress scan or a live exercise of every cache/repair state; those owner boundaries have dedicated regression coverage.
Size and Scope
Production/provisioning (including runtime prompt text):
+952/-133 (net +819). Tests/proof support:+2021/-509 (net +1512). Documentation:+72/-0 (net +72).The positive production delta supplies the previously absent mandatory byte-complete admission boundary and safe bootstrap. It reuses the existing runner, schemas, cache policy, Git evidence, and repair snapshot owner; no second reviewer, independent snapshot engine, persisted receipt store, compatibility fallback, or permission expansion was added.