Hermaguard — Review Pipeline

One review run: code → deterministic pre-passes → three adversarial agents → trust gates → verified report → learning loop

Input: code / diff the files under review PHASE 0 — Deterministic pre-passes (auditable, never lie) Scope Detection what changed, how big Coverage Ledger 32 bug classes (CWE Top-25 + races/async…) report must account for all Locate (SHERLOC) ranks where bugs likely hide Sanitize (CodeSentinel) strips hidden instructions from comments/strings anti prompt-injection Prescan (bandit/ruff/…) real SAST tools, deterministic Role Patterns (CLAWAUDIT) agent-specific SAST rules generic tools miss ~80% Suppression Rules learned from past false positives applied by prescan + role patterns PHASE 1 — Three adversarial agents (sanitized code + locate hints + prescan findings as input) Agent 1 — Edge Case Hunter nulls, races, async, partial writes forced PoC for hard classes Agent 2 — Adversarial Reviewer injection, auth, deserialization attacks from locate hypotheses Agent 3 — Blast Radius config, callers, migrations what else breaks every finding: what / why / impact / fix + bug-class ids + proof-of-concept Consolidator dedup, merge, build coverage array TRUST GATES — the report cannot ship without passing these 1. Coverage Check every applicable bug class accounted: finding / clean / N-A 2. Verify PoCs (hard classes) races / async must carry VERIFIED execution evidence 3. Grader (L0–L6) deterministic severity tier per finding, no guessing Report (HTML + JSON) findings, coverage, verdict, evidence feedback: dismiss 3x → rule → suppressed forever Legend Deterministic tools LLM agents Gates / learning Merge Output

Accountability

  • • 32 bug classes tracked per report
  • • every class: finding, clean, or N-A-with-reason
  • • gaps fail the coverage check — no silent skips

Evidence

  • • PoCs run in a hardened sandbox (rlimits, empty env)
  • • verdicts from execution output, not model claims
  • • races / async bugs require VERIFIED proof

Learning

  • • dismiss a false positive 3× → suppression rule
  • • prescan applies rules on every future run
  • • suppression visible in stats, never silent