AAK-POLICY-VERDICT-FAILOPEN-001: A policy verdict blocks on one deny word and acts on anything else
- Severity
- HIGH
- Category
- Trust Boundaries (
trust-boundary) - Scanner
agent_audit_kit/scanners/policy_failopen.py- Auto-fixable
- No.
- SARIF name
PolicyVerdictFailOpen
What it detects
A function takes a verdict or decision (a parameter, or a model, HTTP or JSON result named verdict, decision, approval, allowed, action or status), refuses only when it equals a deny word (== "deny", in ("deny", "reject"), with or without .lower()), and otherwise goes on to act. A parsed answer is whatever came back, so denied, DENY, block, error, an empty string and None all execute. A check that lets only known values through (verdict != "allow", verdict not in ALLOWED) or maps unknown values to deny (TABLE.get(raw, "deny")) does not fire.
How to fix
Map unknown verdicts to deny where the answer is parsed: an enum or a table with deny as the default, or an explicit check before the action that refuses everything but the one word that means go ahead. Add a test that a deny, the same word in capitals, an empty value, None and a word you have never seen all refuse, so a later refactor cannot reopen it.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-POLICY-VERDICT-FAILOPEN-001
Limitations
The verdict pattern is a regression pattern from the Nobulex failopen corpus (github.com/arian-gogani/failopen, MIT, Arian Gogani), case historical/autogen-verdict: microsoft/autogen PR #7960 executed its action on six unknown verdicts at commit 0cd67042, and commit ec6cf48c in the same PR (still open, not in AutoGen main) hardened it to block all six before the issue was filed, so it is not an unresolved AutoGen vulnerability. Reads Python functions, one at a time, for a check of a verdict by name: verdict, decision and approval anywhere, and allowed, action and status only in a function or file named for a gate (policy, guard, gate, approval, hook and the like), since those words are common. A local assigned from one counts. The deny word must be a string literal, so one held in a constant or an enum is not read, and a check at module level, a match statement, a flag set in the branch (blocked = True) and a verdict read in another function are not followed. A check in a nested block is judged by what follows it in that block. A return of a plain name or of a word that is neither a refusal nor a go-ahead is not read as acting. TypeScript and other languages are not read. A source file over 512 KB is not read.
References
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-01 (Missing Authentication)
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-POLICY-VERDICT-FAILOPEN-001.md: the page then shows that text, with the registry reference appended under it.