Skip to content

Add AG040: insecure model-output handling (0.19.0) - #23

Merged
autonomyproof merged 1 commit into
mainfrom
feat/rule-ag040
Aug 18, 2026
Merged

Add AG040: insecure model-output handling (0.19.0)#23
autonomyproof merged 1 commit into
mainfrom
feat/rule-ag040

Conversation

@autonomyproof

Copy link
Copy Markdown
Owner

First source->sink flow rule (OWASP LLM02). Flags an LLM call's output flowing into eval/exec/os.system/subprocess, inline or via a single-function variable/.content accessor.

Verified: corpus 156 cases 1.000/1.000; 0 findings across 41 real repos; 616 tests, 100% coverage. Bumps 0.18.0 -> 0.19.0.

First source->sink flow rule: flags an LLM call's output flowing into a code or shell
execution sink (OWASP LLM02, 'insecure output handling' / 'the agent ran the code the
model generated').

Source: invoke/ainvoke/predict/generate/complete (LangChain-style) or a
completions/messages .create (OpenAI/Anthropic). Sink: eval/exec/compile/os.system/
os.popen/subprocess.*. Connected inline, via a single-function variable, or through
.content / .choices[...].message.content accessors. Uses the engine's existing
resolve_local_value source tracking; intentionally shallow (single function).

Zero-FP scoping: parameters, constants, non-model calls (requests.get().text), plain
function results, non-completions .create (Customer.create/Payout.create), list args,
and deep alias chains all stay silent. MITRE T1059.

Verification:
- Ground-truth corpus: 156 cases, precision 1.000 / recall 1.000.
- Real-repo benchmark: 0 findings across 41 repos — zero false positives.
- 616 tests, 100% branch coverage, ruff + ruff format + mypy all clean.

Bumps 0.18.0 -> 0.19.0.

Signed-off-by: AutonomyProof <info@autonomyproof.io>
@autonomyproof
autonomyproof merged commit 61d7a09 into main Aug 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant