feat(reviewer): INJ Phase 1 root fix — code-computed typed verdict (D-INJ-1)#349
Open
ProtocolWarden wants to merge 1 commit into
Open
feat(reviewer): INJ Phase 1 root fix — code-computed typed verdict (D-INJ-1)#349ProtocolWarden wants to merge 1 commit into
ProtocolWarden wants to merge 1 commit into
Conversation
…-INJ-1)
The reviewer emitted a free-text {"result": "LGTM"} the MODEL authored, so any
prompt injection in the diff/spec/Custodian findings contended directly for the
merge decision. Per HARNESS_TRUST_HARDENING.md §2.2/D-INJ-1 the capability is
removed: the model fills a typed {check_id, status, evidence_span} per enumerated
review check and CODE computes LGTM/CONCERNS.
- New pr_review_watcher/verdict.py: REVIEW_CHECKS, compute_verdict() (pure),
verdict_schema_prompt().
- _run_direct_review (the trust boundary) computes the verdict from the model's
typed checks and ignores any model-authored "result".
- Fail-safe: missing/unknown/malformed -> CONCERNS, never auto-LGTM (D-INJ-2).
Acceptance (§2.4): a forged {"result":"LGTM"} with no real checks computes to
CONCERNS. 11 verdict-unit + 2 boundary tests; 237 reviewer tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
CI has not gone green after 20 checks (1 failing: License headers: failure). Not merged (red CI) and not closed (work preserved) — needs a human to fix CI. |
Owner
Author
|
Needs human attention (reason= CI has not gone green after 21 checks (1 failing: License headers: failure). Not merged (red CI) and not closed (work preserved) — needs a human to fix CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First PR of Harness Trust-Hardening Phase 1 (INJ) — operator-implemented (the fleet must not author the controls that constrain it).
The reviewer emitted a free-text
{"result": "LGTM"}that the model authored, so any prompt injection in the diff / campaign spec / Custodian findings contended directly for the merge decision (suppress a CONCERNS, forge an LGTM). Per spec §2.2 / D-INJ-1, the capability itself is removed.Change
pr_review_watcher/verdict.py: enumeratedREVIEW_CHECKS, purecompute_verdict(checks) -> (result, failing), andverdict_schema_prompt().{check_id, status, evidence_span}per check._run_direct_review(the trust boundary) runscompute_verdictand returns a code-computedresult— ignoring any model-authoredresult.Acceptance (§2.4)
A forged
{"result":"LGTM"}with no real checks computes to CONCERNS (unit + trust-boundary tests). 11 verdict-unit + 2 boundary tests; 237 reviewer tests pass; ruff/ty/audit clean.Remaining Phase-1 PRs: typed circular hand-off (D-INJ-4),
{detector_id,count}findings (D-INJ-3), output sanitization, nonce-fenced envelope, Custodian INJ1 detector.