Skip to content

Close cmd-output redaction hole and surface artifact-leak scrubs#18

Merged
ksimback merged 2 commits into
mainfrom
redaction-artifact-surfacing
Jul 7, 2026
Merged

Close cmd-output redaction hole and surface artifact-leak scrubs#18
ksimback merged 2 commits into
mainfrom
redaction-artifact-surfacing

Conversation

@ksimback

@ksimback ksimback commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Completes the v0.2.0 redaction residual (ROADMAP Part 2 item 2): artifact-level redaction is no longer silent content-scrubbing, and the last unredacted ingestion path is closed.

Changes

  1. cmd context-source output is now scrubbed. Previously gather_context inlined command stdout/stderr verbatim, so a context command that printed a flagged file (cat .env-style, env dumps, git log) leaked it into context.md and every downstream prompt. Output now goes through the same flagged-content scrub as prompts.
  2. Scrub events are surfaced. scrub_flagged_content() reports which flagged files' content it caught; the runner logs a redaction_applied event to run-log.md and appends a state.json warning naming the source files and the destination. A leak into loop artifacts is now visible evidence, not a silent mask.
  3. Honest docs. README describes the two-layer posture: path-based non-send for flagged files (guaranteed — the read is refused), best-effort content scrub with surfacing for derived content (reformatted/short values can survive), local models recommended when redaction-sensitive paths exist.

Tests

2 new (43 total): cmd-output leak is scrubbed + marked + surfaced; artifact leak scrub writes the run-log.md event and state.json warning.

🤖 Generated with Claude Code

ksimback and others added 2 commits July 7, 2026 14:16
Two-layer redaction, honestly documented:

1. cmd context-source output was inlined verbatim into context.md, so a
   command that printed a flagged file (cat .env-style, env dumps, git
   log) leaked it to every downstream member. Output is now scrubbed
   against redaction-glob file contents like everything else.

2. Content-scrubbing is no longer silent. scrub_flagged_content()
   returns which flagged files were caught, and the runner logs a
   redaction_applied event to run-log.md and appends a state.json
   warning naming the sources and destination - so a leak into loop
   artifacts is visible instead of quietly masked.

README now describes the real posture: path-based non-send for flagged
files (first layer, guaranteed), best-effort content scrub with
surfacing for derived content (second layer), local models recommended
when redaction-sensitive paths exist.

2 new tests (43 total).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The review's core finding: the branch's "scrubbed before any send"
claim was false for the largest egress path - host prompts
(plan/delivery/revise) were never scrubbed, so an artifact leak went
verbatim to the host CLI while state.json said it was contained. Fixes:

- Host prompts now pass through the same scrub as every other send
  (call_host helper used by run_host and the revise path), with
  "prompt for host" surfacing. Flagged means flagged for every
  recipient; the escape hatch is not flagging files the loop needs.
- Scrub runs before the first-send consent question, and the consent
  prompt prints any leak warnings for that member, so the one
  irreversible decision is made with the leak signal visible.
- Flagged files the scrub cannot read (>1MB, non-UTF-8) are surfaced
  as blind spots (redaction_unscrubbable event + state warning)
  instead of silently skipped.
- Leak attribution detects against the original text, so two flagged
  files sharing content are both named, not just the first replaced.
- redaction_applied events dedupe per (destination, sources);
  flagged-file contents are read once per run instead of per prompt;
  cmd stdout/stderr scrub as one block.
- CHANGELOG rewritten to state old behavior accurately (member prompts
  were already scrubbed on main; the verbatim path was the host) and
  README documents the over-redaction bias explicitly.

4 new tests (47 total). Conformance harness still 8/8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ksimback ksimback merged commit 07a3ca7 into main Jul 7, 2026
9 checks passed
@ksimback ksimback deleted the redaction-artifact-surfacing branch July 7, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant