Add AG040: insecure model-output handling (0.19.0) - #23
Merged
Conversation
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>
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.
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.