Skip to content

feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951

Closed

Description

@dan-petty

Problem

In review session 20261001-224227 (2026-10-02), 87% of 563 reported findings were false. An audit of every prompt the pipeline sends a model tied each recurring failure to the prompt text that invites it. Counts are from the session's 903 candidates.

  • Invented advisories.
    • role.md says "Name specific CVE IDs, OWASP Top 10 categories, attack vectors", and review.md:8 asks for "a real advisory identifier".
    • All 9 CVE references were wrong (Log4j, polkit, Apache httpd, OpenSSH, axios, JUnit), and 6 of those findings were VERIFIED.
    • 82 findings that are not injections carry an OWASP A03 label.
  • No threat model. No prompt the model sees states one. 125 injection, SSRF or traversal claims assume an attacker controls config, CLI arguments or internal values, or name no sink.
  • Reporting what cannot be seen.
    • Three prompts tell the model to report a control it cannot see: code_review_prompt.md:10, devsecops/prompt.md:13, review_output_instruction.md:42.
    • 210 claims assert that something is absent, and all 357 UNVERIFIED findings were reported.
  • Severity bands with no reachability condition (review.md:51-52). 534 of 903 candidates were CRITICAL or HIGH. Both prompt examples say "severity": "HIGH" and "confidence_score": 0.95.
  • Mandates read as defect lists. "Enforce bounded searches …", "health probes, PSS/PSA", "Flag … missing checksum digests" (devsecops/prompt.md:7,12, config_review_prompt.md:6-7). This produced 92 generic findings and 188 "Potential …" titles.
  • Fixes that change nothing. code_review_prompt.md:11 accepts "a precise, mechanical change description". 117 fixes have no code; 68 say verify, check, ensure, consider or review.
  • Tests and docs.
    • Nothing says what a finding in a test is: 87 test findings, 27 reported.
    • docs_review_prompt.md:5 asks for "missing usage examples … confusing explanations", which gives about 30 doc opinions.
    • Planning documents produced 23 to 31 findings although four rules forbid them.
  • A verifier with no standard for VERIFIED.
    • It has about 40 rules for invalidating and none for verifying.
    • verify_finding_system.md:8 makes it impossible to refute a finding whose description the verifier restates.
    • None of the 13 VERIFIED findings in a 40-finding sample holds at its severity.
  • Contradictions and dead prompts.
    • config_review_prompt.md asks for http:// to be flagged, while review.md:10 and the verifier call internal http fine.
    • Verifier :34 and :75 disagree on masking markers.
    • diff_review_prompt.md and review_pipeline_eval.md are never loaded.
    • review_output_instruction.md, paginated_review_protocol.md, path_review_prompt.md and compose.md reach only the legacy loop.
  • Prompt bloat.
    • The persona system prompt carries the full ReviewResult JSON schema: 8,220 characters, with more than 30 pipeline-owned fields such as status, verified and criteria_execution_results.
    • review.md:10-27 holds 18 devops-cli-specific exemptions that belong in .devops/review.md.

Acceptance criteria

  • Persona prompts (personas/devsecops/role.md, personas/devsecops/prompt.md):
    • They state the threat model:
      • Untrusted: network and fetched content, model output, PR and issue text, the reviewed repository, Kubernetes and cloud API data, server requests, MCP and tool-call arguments.
      • Trusted: the operator, their config, environment and arguments, and values the code builds.
    • A vulnerability is a quoted source, a sink and a missing check between them.
    • No CVE or GHSA id from memory; advisories come from the scanners.
    • Return no finding when you cannot quote the defect.
  • .devops/review.md gains devops-cli's own trusted and untrusted lists.
  • Task prompts (tasks/review.md, code_review_prompt.md, docs_review_prompt.md, config_review_prompt.md):
    • Severity follows reachability (CRITICAL needs an untrusted path you can quote).
    • Report only what you can see.
    • A fix is replacement code for the cited lines.
    • observed_value is quoted from the cited lines.
    • Tests are reported only when the test cannot fail.
    • Docs findings are only statements the code contradicts, broken links, or names that do not exist.
    • Planning documents and changelogs get no findings.
    • Mandates are rewritten as defects.
    • Criteria are checks that import the cited code and assert the outcome; a command that finds, imports or prints code is written as a sentence with "executable": false. This takes over fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846's prompt half.
  • Verifier (verify_finding_system.md):
    • A standard for VERIFIED: quote the defective line and give its number; a security claim also needs the untrusted source and sink.
    • Trusted input is refuted unless the conventions require the guard.
    • A check in the shown code that makes the failure impossible refutes the finding.
    • The masking-marker rules agree.
  • Example JSON no longer anchors HIGH or 0.95.
  • Cleanup.
    • Dead prompt files are deleted.
    • devops-cli-specific exemptions move from the shared prompts to .devops/review.md.
    • The persona system prompt carries a schema limited to the fields a reviewer writes.
  • A test pins the prompts:
    • every prompt file in ai/tasks/ and ai/personas/ is loaded somewhere;
    • no generator prompt asks for what review.md or the verifier calls a non-defect (starting with http://);
    • no prompt contains "CVE ID" as an instruction.
  • Measurement. docs/SELF_IMPROVEMENT.md records the A/B measurement for this change with feat(ai): model-in-the-loop prompt benchmarking #413's prompt benchmarking (devops review corpus score --session …, A/A noise first, interleaved runs, model-pinned), and the per-session failure counts (cve, tests, planning, masked, syntax, no_code_fix, crit_high, unverified_reported, find_only_criteria). The live run is a person's step.
  • uv run devops ci passes.

Key questions

Activity

  1. added this to the v0.2.25 milestone on Oct 2, 2026
  2. added
    type/feature
    scope/review
    priority/p1-high
    on Oct 2, 2026
  3. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Closed by #1004, merged into release/v0.2.25.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/reviewtype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions