Repository navigation
refactor: drop the retired redaction remediation from the policy plugin - #113961
Conversation
Sensitive log redaction became unconditional and `logging.redactSensitive` was retired from the config schema, but the policy doctor still classified `dataHandling.sensitiveLogging.requireRedaction` as an automatic repair that would have written the retired key back into config. Remove the automatic repair (check-id registration, patch branch, and the `enableSensitiveLoggingRedaction` writer), drop the `logging.redactSensitive` config target, and reclassify the check as `validateOnly`. The check keeps evaluating the policy declaration against the redaction invariant; it just no longer claims a fixable config target. Refresh the policy docs, the finding fix hint, and a stale comment in `src/logging/redact.ts`.
|
Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 9:21 PM ET / July 26, 2026, 01:21 UTC. ClawSweeper reviewWhat this changesThis PR removes the policy plugin’s obsolete automatic repair for sensitive-log redaction, changes the related policy check to validation-only, and updates the operator documentation and guidance to reflect that redaction is always enabled. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep this PR open for normal human review: it is a focused cleanup of policy-doctor metadata and a retired config repair, but the protected Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s policy plugin compares flowchart LR
P[Policy document] --> E[Policy doctor evaluation]
R[Effective redaction behavior] --> E
E --> F[Policy finding]
F --> M[Fix metadata]
M --> D[Doctor repair or validation guidance]
D --> O[Operator CLI and docs]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -29, Tests -2, Docs 0. Total -31 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the public policy check identifier, remove only the impossible config write, and land after a redacted after-fix Doctor/policy evaluation demonstrates that the check remains validation-only without advertising the retired key. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was supplied. The branch describes a source-level path in which a retained policy repair would target a retired strict-schema key, but the claimed unreachable condition needs direct runtime confirmation. Is this the best way to solve the issue? Yes, conditionally: deleting a repair that cannot produce a valid current configuration is narrower and safer than retargeting it. Retaining the documented policy check as validation-only is the conservative contract-preserving choice unless maintainers separately decide to retire that check. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4596fd2dd2c6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…enclaw#113961) Sensitive log redaction became unconditional and `logging.redactSensitive` was retired from the config schema, but the policy doctor still classified `dataHandling.sensitiveLogging.requireRedaction` as an automatic repair that would have written the retired key back into config. Remove the automatic repair (check-id registration, patch branch, and the `enableSensitiveLoggingRedaction` writer), drop the `logging.redactSensitive` config target, and reclassify the check as `validateOnly`. The check keeps evaluating the policy declaration against the redaction invariant; it just no longer claims a fixable config target. Refresh the policy docs, the finding fix hint, and a stale comment in `src/logging/redact.ts`.
What Problem This Solves
The policy plugin carried an automatic doctor repair for
dataHandling.sensitiveLogging.requireRedactionthat wrotelogging.redactSensitive. Thatkey is retired: it is absent from the root schema, listed in
dead-config-keys.test.ts, andstripped by an existing doctor migration. Since the root config object is strict, the repair
would have written a config the Gateway refuses to load, and its advertised
configTargetspointed operators at the same dead key.
Worth stating plainly for reviewers judging risk: the repair is currently unreachable. The
redaction evidence is hardcoded to
value: trueinpolicy-state-data.ts, and the findingbuilder filters on
value !== true, so the finding that would trigger the repair can neverfire.
git log -Ltraces that to PR #111527 (config-surface reduction tranche 3), whichflipped the evidence to an invariant but left the repair, the config target, and the docs
behind. This is leftover debris from that change rather than a live defect.
Why This Change Was Made
Redaction is unconditional now.
resolveConfigRedaction()hardcodes tools-mode and readsonly
redactPatterns, so config can never yield an "off" state. A remediation whose entirejob was to turn redaction on has nothing left to do, which makes removal the right answer
rather than retargeting it at some other key.
The check and the
dataHandling.sensitiveLogging.requireRedactionpolicy key are kept. Thatkey is a public
policy.jsonccontract still validated bydata-auth-shapes.ts, soretiring it would be a contract change rather than debris removal.
The metadata entry moves from
automatictovalidateOnly, which is the previously unusedmember of that enum and describes this case exactly.
User Impact
No user-visible behavior change, since the repair could not fire. Operators no longer see a
policy that advertises a config fix targeting a key the schema rejects, and
docs/cli/policy.mdno longer documents a--fixbehavior that does not exist.One thing reviewers should decide separately: because the evidence is now a hardcoded
invariant,
policy/data-handling-redaction-disabledcan never produce a finding at all.Deleting the check outright would be the leaner end state, but that retires a documented
public check id and stops evaluating a public policy key. That reads as a product decision,
so this PR leaves the check reporting-capable and flags it rather than deciding unilaterally.
Evidence
node scripts/run-vitest.mjs extensions/policy- 10 files, 363 tests passing.node scripts/run-vitest.mjs src/logging/redact- 148 tests passing.run-tsgo.mjsclean ontsconfig.extensions.jsonand the extensions test tsconfig.oxfmt --checkclean on all six changed TypeScript files;run-oxlint.mjsexit 0 for boththe extensions and core tsconfigs.
gpt-5.6-sol, xhigh): clean, no accepted or actionable findings.Sibling check: no other remediation in the repo writes a retired key. The
logging.redact_offsecurity audit finding was already removed from production, with a test asserting it is never
emitted.
scripts/lib/policy-config-coverage.jsoncstill lists the key, but that is areport-only maintainer inventory that legitimately supports non-schema paths and already
reports pre-existing drift on an unrelated entry, so it is left alone as a different class.
A stale comment in
src/logging/redact.tsthat explained behavior "regardless oflogging.redactSensitive" now describes the real contract.LOC delta: +21 / -52 across 7 files, production code net -38.