Skip to content

fix(handoff): fail content guard lint on injection warnings - #559

Merged
solomonneas merged 1 commit into
mainfrom
fix/content-guard-injection-crossref
Jul 26, 2026
Merged

fix(handoff): fail content guard lint on injection warnings#559
solomonneas merged 1 commit into
mainfrom
fix/content-guard-injection-crossref

Conversation

@solomonneas

Copy link
Copy Markdown
Collaborator

Summary

  • Make warning-level handoff-injection findings fail brigade handoff lint --content-guard.
  • Report egress and injection as separate verdicts in text and JSON output.
  • Add lint tests for injection-only failure, egress-only failure, a clean two-axis pass, and non-blocking info findings.

Wiring choice

This uses the in-guard option. --content-guard already calls the canonical scan_handoff_injection_heuristics() detector, so its combined verdict now fails when either egress or injection fails. Info-only discussion remains non-blocking. No second detector was added.

Before and after

Before, an egress-clean injection fixture printed warnings but exited 0:

[ok] content_guard leaks: .../evil-ignore-previous.md clean
  warning: 2 injection heuristic hit(s)
exit: 0

After, each axis has its own verdict and the command exits 1:

[ok] content_guard egress: .../evil-ignore-previous.md clean
[fail] content_guard injection: .../evil-ignore-previous.md 2 injection warnings
exit: 1

The before output is recorded in Brigade receipt 20260726-210033-work-verify-08af8a.

Coordination

Issue #490 owns the model_trials adversarial fixture. This PR does not change model_trials or add another fixture corpus. It uses the existing sample under tests/fixtures/handoff_lint/injection/.

This is a follow-up to #477 and #515, which added the scanner but left warning-level injection findings outside the command verdict.

Closes #555.

Verification

  • ./scripts/verify: 4,309 passed, 3 skipped, 82.84% coverage. Brigade receipt 20260726-210442-work-verify-21bcd1.
  • pytest tests/test_handoff_injection_lint.py -q: passed. Brigade receipt 20260726-210426-work-verify-98da75.
  • Embedded content guard over all six inert attack fixtures: passed. Brigade receipt 20260726-211101-work-verify-f34c42.
  • Memory handoff lint with --content-guard: passed. Brigade receipt 20260726-211138-work-verify-5eb8a7.

Co-authored-by: Cursor <cursoragent@cursor.com>

Co-authored-by: Codex <codex@openai.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 42e969ce-6b6a-434b-a199-f2cd975fbf8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/content-guard-injection-crossref

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@solomonneas solomonneas self-assigned this Jul 26, 2026
@solomonneas
solomonneas marked this pull request as ready for review July 26, 2026 21:29
@solomonneas
solomonneas merged commit 4fadf50 into main Jul 26, 2026
27 of 28 checks passed
@solomonneas
solomonneas deleted the fix/content-guard-injection-crossref branch July 26, 2026 22:25
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.

handoff lint --content-guard passes injection-laden handoffs as clean (guards egress, not injection)

1 participant