Repository navigation
fix(review): classify OpenClaw redaction fixtures - #1461
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 11:40 PM ET / September 6, 2026, 03:40 UTC. ClawSweeper reviewWhat this changesExtend ClawSweeper’s secret scanner to recognize specific OpenClaw logging-test fixtures through exact detector, decoder, source-role, value, line, path, and file-mode checks. Merge readiness✅ Ready for maintainer review The PR remains useful: current main lacks these logging-fixture classifications. No actionable patch defect was found, and the supplied native admission trace supports the change. Maintainer-authored work is also protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper scans review prompts and Git changes before starting a model provider. Its fixture classifier admits explicitly reviewed synthetic findings while refusing other scanner findings. flowchart TD
A[Review prompt and Git changes] --> B[Stage bytes and source references]
B --> C[Pinned native secret scanner]
C --> D{Every finding qualifies?}
E[Host fixture policy] --> D
D -->|Yes| F[Continue provider admission]
D -->|No| G[Refuse before provider launch]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the bounded host-owned fixture policy, mandatory native scanning, and refusal of every unqualified source reference. Do we have a high-confidence way to reproduce the issue? Yes: the supplied native trace identifies exact revisions and shows baseline refusal followed by candidate classification; current-main source lacks the corresponding policy. This read-only review did not rerun the scanner. Is this the best way to solve the issue? Yes: extending the existing host classification boundary with exact attribution checks is a focused solution, and the legacy policy remains intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e4d0e8205030. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Resolves a problem where ClawSweeper refuses review admission for OpenClaw pull requests whose unchanged logging tests contain credential-shaped synthetic redaction fixtures, even when every native scanner attribution is tied to the reviewed fixture bytes.
This is a prerequisite for reviewing openclaw/openclaw#138829.
Why This Change Was Made
The change adds a separate, flat exact-attribution policy for the reviewed OpenClaw logging fixture. Each accepted finding is bound to its detector, exact native decoder, base/head source role, Raw and RawV2 hashes, full source-line hash, path, mode, and detector-specific metadata. Existing URI fixture behavior is preserved; there is no broad allowlist, fixed finding-count requirement, or classifier control-flow bypass.
User Impact
Maintainers can run ClawSweeper review on the affected OpenClaw change without disabling secret scanning or authorizing unrelated findings. Any unknown detector, decoder, metadata shape, source role, path, mode, hash, duplicate, or partially authorized deduplicated reference still refuses admission before provider/model launch.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes only admission classification and refusal diagnostics; no observer dashboard, queue, lifecycle, telemetry, status, or public data contract changes.
Documentation Impact
The active classifier contract in
README.mdis updated to document the exact role-bound OpenClaw logging-fixture policy, accepted native decoder names, subset/order behavior, metadata validation, and the unchanged legacy URI policy.CHANGELOG.mdis updated for the operationally meaningful admission change.Evidence
e7fe2e09c39b3be40bda94995eb06f34e6eda1e9b8731bc88a7c562f01d0d7bc3e9634b71047d3d3fe0367a07a23660ea35007ac69bdb8f54309fc21src/logging/redact.test.tsat the exact OpenClaw head, Git blobcb52c7c395b6e3243b83f0c9680ea16edd913e6bv3.97.1, commit20652fbbdefffcdaa493a5bf57ab2ac6b1db715bnode --test test/agent-input-scan.test.ts test/exact-review-failure-diagnostics.test.ts258/258passed.pnpm run build,pnpm run build:repair,pnpm run lint:src, focusedoxfmtverification, andgit diff --check.scoped-cleanat P0-P2. The postcommit review exited0with no findings.The pinned upstream contracts are:
pkg/detectors/uri/uri.gopkg/detectors/mongodb/mongodb.gopkg/detectors/postgres/postgres.gopkg/decoders/decoders.gopkg/decoders/escaped_unicode.goAt that pinned commit, the detector sources establish the relevant
Raw,RawV2,SecretParts, andExtraDatacontracts: URI separates its normalized and path-bearing values and derives host/username/password; MongoDB emits the connection string asRaw, akeysecret part, and its defined metadata; Postgres emits equal normalizedRaw/RawV2, aconnection_stringsecret part, and its defined metadata. The decoder sources establish default decoder ordering with plain UTF-8 first for duplicate handling andESCAPED_UNICODEas the exact escaped-Unicode decoder identity.Local full gate:
PATH="/opt/homebrew/opt/bash/bin:$PATH" pnpm run checkcompleted static checks, builds, linters, changed coverage, and coverage thresholds. It did not fully pass because four unrelated local-environment or baseline tests failed:/bin/bash3.2 withoutmapfile;/varversus/private/varcanonical-root alias;The focused scanner and exact-review diagnostics suites are green.
Current exact-head hosted CI: all substantive checks are complete and green, with only intentionally skipped checks remaining.
CI / pnpm check, CodeQL, Windows launcher, sparse repair build smoke, notification, and hosted-target admission all succeeded.Real Behavior Proof
Claim: the production admission scanner refuses the unqualified baseline before provider/model launch and classifies every emitted subset/order of the exact reviewed OpenClaw fixture findings on this candidate without weakening unknown-finding refusal.
Exercised surface: the production
scanAgentInputentry point and its exact fixture classifier, using committed/snapshot Git source staging and pinned native TruffleHog output.Scenario and environment: proof ran on macOS arm64 from the trusted ClawSweeper checkout against the exact OpenClaw revisions and blob listed above. It used private temporary Node ESM harnesses outside both repositories; these were not repository scripts. The native capture reproduced production committed-source staging: prompt, raw diff, binary/full-index patch, and every deduplicated base/head blob. It then invoked the pinned binary with:
The scanner process used an isolated private
HOME/TMPDIR, a 120-second timeout, and required native finding exit status183plus completion metadata reporting TruffleHog3.97.1.The production-entry proof imported the built
dist/agent-input-scan.jsand called:The production scanner resolved the pinned managed TruffleHog
3.97.1binary. No provider or model process was part of either harness.Bounded protocol: at most 8 production-equivalent native scans, stopping early after 3 consecutive scans add no exact attribution tuple. Finding counts and emitted subsets were allowed to vary; the policy did not assert a fixed total.
Observed result: the baseline refused before provider/model launch. The candidate classified every emitted subset/order retained by the bounded scans. Refusal paths recorded zero provider/model launches. Only detector IDs/names
17 URI,895 MongoDB, and968 Postgres, with exact native decodersPLAINandESCAPED_UNICODE, were observed. No unexpected detector, decoder, or metadata variant appeared.Sanitized native trace: each
sorted_tuple_sha256is SHA-256 over that run's deterministic sorted exact-attribution tuple serialization. These records were derived from all retained bounded native runs and contain no native secret value or source-line text.{"run":1,"finding_count":15,"detector_decoder_set":["17 URI/ESCAPED_UNICODE","17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":15,"sorted_tuple_sha256":"7b5b348d771cb9284ce3e2d7aea8d87cc8f1eb0f69607e351b63a4a08acd7f64","newly_observed_tuples":15,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":2,"finding_count":18,"detector_decoder_set":["17 URI/PLAIN","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":18,"sorted_tuple_sha256":"12287fc716b5d2861f7b93fa258463e71cea7a42529ef62e728469383930078c","newly_observed_tuples":8,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":3,"finding_count":17,"detector_decoder_set":["17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":17,"sorted_tuple_sha256":"48961ed705e82d7d496a180413b9ec887c6e796bc39ccc3f9976aa91a536d16e","newly_observed_tuples":4,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":4,"finding_count":16,"detector_decoder_set":["17 URI/ESCAPED_UNICODE","17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":16,"sorted_tuple_sha256":"cacf35914ea9888e3addafd6c18143f9685bc936353145d5159dc1d97e796c43","newly_observed_tuples":1,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":5,"finding_count":16,"detector_decoder_set":["17 URI/PLAIN","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":16,"sorted_tuple_sha256":"79291b7d7f84e40d46ea5f6f1a409e7e852c1aecab498a5ff49b3318230081cf","newly_observed_tuples":2,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":6,"finding_count":19,"detector_decoder_set":["17 URI/ESCAPED_UNICODE","17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":19,"sorted_tuple_sha256":"4fb73ab00c193710b8d28bbff38bb45e9861d8d7ebf9e8ba7355dcc6693ad3af","newly_observed_tuples":1,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":7,"finding_count":18,"detector_decoder_set":["17 URI/ESCAPED_UNICODE","17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":18,"sorted_tuple_sha256":"40e7abc6d3bb85c6fd0b5740c907c7eb962bef01abdaa711d41ccacdf2295c5e","newly_observed_tuples":1,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"run":8,"finding_count":16,"detector_decoder_set":["17 URI/ESCAPED_UNICODE","17 URI/PLAIN","895 MongoDB/ESCAPED_UNICODE","895 MongoDB/PLAIN","968 Postgres/ESCAPED_UNICODE","968 Postgres/PLAIN"],"role_set":["base","head"],"exact_tuple_count":16,"sorted_tuple_sha256":"5749ae62ef61ef49f85d1c8e9c8baa8e0ac8913aafebe16d105b6295bc5bd974","newly_observed_tuples":2,"baseline_classification":"refused:findings","candidate_classification":"classified","provider_model_launch_count":0} {"stabilization_stop":"max_runs_reached","run":8,"required_consecutive_no_new_runs":3,"observed_consecutive_no_new_runs":0}The deterministic tuple serialization field order is:
Each tuple is encoded as a compact JSON array in that order. Duplicate-free tuple arrays are sorted lexicographically by their compact JSON encoding, then the outer array is serialized as compact UTF-8 JSON. The 34-tuple sorted union serialization has SHA-256
10f6a42ccf96952d1c658addddbf674b8b0400f93202f9fad30390c23e05901b. The publicREVIEWED_ATTRIBUTIONSrows equal that retained union exactly under this serialization.The exact hashes, roles, source path, and mode are already public in
REVIEWED_ATTRIBUTIONS; only the credential-shaped nativeRaw/RawV2, source-line text, and detector metadata values remain private.Public replay recipe: there is no committed replay script. The original proof used a temporary ESM harness with this reproducible contract:
openclaw/clawsweeper,openclaw/openclaw, andtrufflesecurity/trufflehogrepositories. Check out ClawSweepere7fe2e09c39b3be40bda94995eb06f34e6eda1e9, retain OpenClaw objectsb8731bc88a7c562f01d0d7bc3e9634b71047d3d3andfe0367a07a23660ea35007ac69bdb8f54309fc21, and use TruffleHog commit20652fbbdefffcdaa493a5bf57ab2ac6b1db715b/ version3.97.1.cb52c7c395b6e3243b83f0c9680ea16edd913e6bat the exact head.HOME/TMPDIR, parse native JSON only in memory, validate the pinned detector/decoder/metadata contracts, and derive the nine-field tuple hashes without printing native values.classifyReviewedFixtureScan(183, stdout, stderr, stagedInputs, [])for the baseline andclassifyReviewedFixtureScan(183, stdout, stderr, stagedInputs)for the candidate. No provider/model process is started.Artifact/trace: a retained sanitized native attribution manifest has SHA-256
a287b27b110ecc29e455ba7f5bd7d329b0f9e3493fb593fba167a585ca50d3da. It is retained privately because it is derived from credential-shaped test literals. It is not a public artifact; therefore the digest proves immutability only to a reviewer with access to the retained artifact and does not independently expose or reproduce its contents for public reviewers.Limits: the proof is exact to the revisions, blob, native scanner version/commit, detector contracts, decoder identities, modes, roles, paths, hashes, and observed metadata variants listed above. It does not authorize different fixture bytes, future TruffleHog behavior, other paths or modes, lossy
OTHERdecoder classification, duplicates, mixed unknown findings, or any unobserved detector/decoder/metadata variant.