Repository navigation
Description
Problem
#951 (38517a8) made the devsecops persona almost silent, and it stopped finding the real defects that earlier reviews of the same code found. Session 20261002-205520 (S5) was the first branch review with #951's prompts. It was cold, with 403 model calls and none from the cache, at 38517a8 (.data/review-evaluation-20261002-s5.md):
- 367 of 380 persona replies (96.6%) held no finding, against 64% in S3 (
20261002-180320) and 66% in the cold S1. - On the 270 files whose content, merge base, conventions and persona code were identical in S3 and S5, persona candidates fell from 139 to 16, and files with any finding fell from 92 to 9.
- The drop holds in every file kind: Python from 39.2% non-empty to 3.4%, tests from 46.5% to 5.3%, config from 23.1% to 3.7%, docs from 40% to 0. File mix, routing, cut replies and reply size explain none of it. qwen3-coder answered 338 of 380 pages, and its non-empty rate fell from 34.5% to 2.7%.
- Recall: none of the four valid findings that S1 to S4 reported was generated. Each file got one page and a complete reply with
"findings": [], so nothing reached verification. All four defects are still in the code at 38517a8:k8s/monitoring/networkpolicy.yaml:18-20, ingress from0.0.0.0/0(fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953);k8s/otel/networkpolicy.yaml:31-32,0.0.0.0/0to the Jaeger UI on 16686 (fix(k8s): deploy-stack applies the monitoring namespace perimeter #913's planned follow-up);src/devops_cli/ai/rag/investigator.py:293, a broad except (feat(cli): blind exception handling policy #423);docs/VISION.md:12, thetrust_remote_codeclaim (docs: hand-written docs name only commands, options and components that exist #921).
- Precision rose from 3 of 126 reported findings to 2 of 24 (Fisher p = 0.18). That is not significant, and the gain comes only from removed noise.
The prompt text is the likely cause. At 38517a8, src/devops_cli/ai/personas/devsecops/prompt.md says:
:4: "A vulnerability is a path you can quote: the untrusted source, the sink it reaches … and the missing check between them.":6: "Return no finding when you cannot quote the source, the sink and the defective line. Most files have no security defect.":16: "A choice the manifests or conventions document as deliberate is not a finding."
A NetworkPolicy open to the world, a broad except and a false claim in the docs have no source-to-sink path to quote. "Where to Look" (:8-18) has no class for network exposure or error handling. k8s/monitoring/networkpolicy.yaml:17 comments the rule as "(0.0.0.0/0 and kube-system/traefik)", and S5's reply on the otel policy says the changes "appear to align with the project's conventions". That fits :16.
S5 measured only half of #951. Branch reviews read .devops/review.md at the merge base (runner.py:2237, conventions_revision=base_revision.revision), so #951's threat model and project exemptions were not in effect. With them, recall may fall further. S6 (20261002-214641) replayed S5's empty replies from the cache, so it adds no sample.
Each file has one old-prompt sample against one new-prompt sample, so the cause per file cannot be told apart from sampling. The aggregate drop is systematic. The proposed rule changes below are inferences until the person-run measurement confirms them.
Acceptance criteria
-
devsecops/prompt.mddefines a finding as either a quotable path (an untrusted source, the sink it reaches and the missing check) or a quotable misconfiguration: the setting or line, and what it exposes or permits that its job does not need. "Return no finding" applies when neither can be quoted. The sentence "Most files have no security defect" is gone. - "Where to Look" adds Network exposure: a NetworkPolicy, Ingress, Service, firewall or security group that admits
0.0.0.0/0, every namespace, or every pod to a port whose consumers are known. It also adds Error handling: a broadexceptthat swallows an error on a path where failing closed matters (auth, verification, a security check, data integrity). These are reported at most MEDIUM and LOW unless a quotable consequence is worse. -
:16reads: a choice the manifests or conventions justify, by saying why it is safe, is not a finding. A comment that only restates the rule is not a justification. - The docs review prompt (
src/devops_cli/ai/tasks/docs_review_prompt.md) keeps reporting a security claim that the code contradicts. Check whether feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951 changed this; if it did, restore it. - A recall set records the known real findings this issue names: file, revision, line range, class and the issue that tracks each. It goes in
tests/fixtures/review_recall/(or beside feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's corpus indocs/SELF_IMPROVEMENT.md). An offline test checks that every class in the set is named in "Where to Look" or in the docs prompt, and that every listed file exists at its revision. -
docs/SELF_IMPROVEMENT.mddescribes how to score recall on the set beside feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's corpus A/B, with--no-cacheand three samples per file. - Tests run offline, call no model, and each runs well under 1 s.
-
changelog.d/1015.mdrecords the fix under### Fixed.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run) On the homelab gateway, with
--no-cacheand three samples per file, the six files of the recall set are reviewed twice: once with 38517a8's prompts and once with this change. That is the four lost findings plusai/spend/pricing.py:55and:65, which S5 found. This change finds each Network Exposure entry of the set (monitoring fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953, otel) in at least 2 of 3 samples; the Error Handling and Security Claims entries are counted and reported, not gated (revised 2026-10-03, below). A path review of S5's 24 reported files reports no more than 1.5 times S5's false findings. The numbers go in the PR.
Key questions
- Revert feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's persona text instead? (proposed) No. feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951 cut false and opinion findings from 123 to 22 and findings on tests, docs and planning files from 63 of 127 to 5 of 24. The two rules that dropped recall are narrow enough to fix in place.
- Is this a critical fix for v0.2.25? (proposed) Yes. feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951 is in v0.2.25 and has not shipped. Shipping it would ship a security review that reports none of the known real defects in its own repository.
- Why not wait for the full feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951 to take effect after the release merges into main? (proposed) The threat model in
.devops/review.mdnarrows findings further. It cannot bring back classes the persona prompt excludes. - Can the gate measure recall? (proposed) No. The gate calls no model. The offline test pins the set and the classes it needs, and the person-run measurement scores the model.
Depends on: none.
Order: lands before the v0.2.25 cut. It touches only prompt text, a fixture, a test and docs/SELF_IMPROVEMENT.md. #846 and #847, building now, change the verifier and the criteria, not the persona prompt.
Related: #951 (the change this fixes). #953, #913, #423 and #921 (the defects in the recall set). #948 (severity: S5's two broad excepts were reported HIGH). #950 (suppressing already-judged findings).
Scope revised 2026-10-03, after the first measurement (.data/measurements/recall/analysis.md): Network Exposure came back (6 of 6 samples against 3 of 6), but reported false findings on Python files rose from 1 to 6, every network finding was HIGH, and broad excepts and the VISION.md claim stayed at 0 of 9 and 0 of 3. A path review shows no diff to a broad except and no code to a docs page, and VISION.md item 6 is a stated theme. The persona prompt gains four edits: a code evidence bar ("A value that reaches no sink you can quote is not a vulnerability, and most code has none"), a network severity tied to a quoted publishing route, egress with metadata blocked is not exposure, and broad excepts reported as LOW instead of capped. The person-run bar is narrowed to the two Network Exposure entries; #423 carries broad excepts, #921 the VISION.md:12 text. The re-run pins both arms to one model, alternates them and runs without verification.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(review): the devsecops persona reports misconfiguration and error…
dan-petty commentedon Oct 3, 2026
Closed by #1054, 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.feat(release): v0.2.25 (#1089)