Repository navigation
Description
Problem: In the fresh adversarial evaluation (#152, docs/evaluations/2026-11-19), 30 of 32 runs ended failed even though most reports are complete SAST reports with a clear verdict. The cause is one formatting rule. The output contract asks for **Overall risk rating:** <severity> on its own line, and _RISK_RATING_RE in src/secfoo/report/severity.py accepts only that bold form. The model (Qwen3 4B) wrote the rating inside the summary paragraph (... The application contains a command injection ... Overall risk rating: High.) in 27 reports, and on its own line without bold in 3. The API agent's reformat retry did not fix it, so the run fails. The only 2 scorable runs are the fake-report attack, whose planted expected-report.md showed the model the exact bold line to copy.
So the evaluation mostly measures a formatting rule, and real users on small or local models hit the same failure.
Build:
- Accept the rating in the shapes models actually write, without letting quoted examples supply it: bold or plain
Overall risk rating:, on its own line or as the last sentence of the Summary / Executive Summary section's first paragraph. Keep ignoring code fences, blockquote examples and JSON draft echoes (text_without_json_drafts,has_json_draftfrom Fail malformed reports safely and resolve adversarial evaluation review #147). - Make the API agent's reformat request quote the exact line it needs (
**Overall risk rating:** <Critical|High|Medium|Low>) and say where it goes. - Regression tests: the 30 failed reports in
docs/evaluations/2026-11-19/api.jsonlbecome parseable with their correct rating, and the counts/ratings parity check againstmainon all stored reports still holds for everything that parsed before. - Re-score: add a replay option that re-applies the current parser to each record's stored
reporttext, so the 2026-11-19 evidence can be re-scored without new model runs, and publish the re-scored summary next to the original.
Where to look: src/secfoo/report/severity.py (_RISK_RATING_RE, extract_overall_risk_rating), src/secfoo/report/markdown.py (section, visible_text, text_without_json_drafts), src/secfoo/agents/api.py (reformat request), src/secfoo/skills/renderer.py (output contracts), scripts/adversarial_eval.py, tests/test_review_hardening.py, tests/test_property_parsers.py.
Done when: at least 25 of the 30 failed 2026-11-19 reports parse with the rating a human reads in them; no rating is ever taken from a fence, quote or JSON echo (property tests); the re-scored summary is published.
Activity
docs(eval): explain the 30 failed runs and report what each review co…
docs(eval): fresh two-trial local adversarial evaluation of the curre…
aaas72 commentedon Nov 20, 2026
Hi! I'd like to work on this one.
Plan:
_RISK_RATING_RE/extract_overall_risk_ratingto accept the plain and boldOverall risk rating:forms, on their own line or as the last sentence of the Summary's first paragraph, while still ignoring fences, blockquotes and JSON draft echoes.FIX_REQUESTquote the exact**Overall risk rating:** <Critical|High|Medium|Low>line and where it goes.docs/evaluations/2026-11-19/api.jsonl(checked against the ratings in the README's qualitative table), a parity check againstmainfor all stored reports, and property tests that no rating comes from a fence, quote or JSON echo.--rescorereplay option toscripts/adversarial_eval.pyand publish the re-scored summary next to the original.Could you assign it to me? I'll open a PR soon.
Accept the overall risk rating in the shapes small models write
Accept the overall risk rating in the shapes small models write (secf…