Graph-Guided Execution Auditing for LLM Coding Agents¶
Graph-guided execution auditing maps agent code, weaknesses, and guardrails into execution paths for pre-release security testing.
Use graph-guided execution auditing before release when you have source access and a restricted test environment. Across five open-source coding agents, AgentLens uncovered 44 execution-validated vulnerabilities, 12 of which received CVE IDs. The audits averaged 2,396.44 seconds (about 40 minutes) per agent, and security experts manually reviewed the findings. The five-agent study lacked independent ground truth and could not measure recall. In a separate OpenClaw v2026.3.8 benchmark, AgentLens missed 5 of 20 selected public CVEs reproducible on Linux (AgentLens, arXiv:2611.34380v1).
How the audit knowledge graph works¶
AgentLens models an agent as an Audit Knowledge Graph joining three layers into one path-search abstraction (AgentLens, arXiv:2611.34380v1):
- An Agent Profile Graph parsed from source code (via Python's
astpackage in the paper) into component nodes with invocation, data-flow, and control-flow edges. - Weakness annotations from external threat intelligence (NVD and GitHub Advisory Database) plus 10 Claude Code discovery skills aligned with the OWASP Top 10 for Agentic Applications.
- Built-in guardrail constraints extracted from the codebase, including input validation, permission checks, and human-approval prompts.
graph TD
A[Source AST + Threat Intel + Guardrails] --> B[Audit Knowledge Graph]
B --> C[Deduplicated Audit Paths]
C --> D[Multi-Turn Runtime Validation]
D --> E[Expert Verification]
Path generation traces routes from external entry points to security-critical operations, removes redundant routes, and scores remaining paths by weakness severity against path length (AgentLens, arXiv:2611.34380v1). Across the five coding agents (38,246 to 385,891 lines of code), AgentLens annotated an average of 107 weakness nodes per agent and distilled them into 70 audit paths (14 per agent on average, with a range of 11–19). Validating those paths yielded 44 vulnerabilities, a 62.86% path-to-vulnerability ratio. The authors tested all retained paths and capped scenarios at five turns (AgentLens, arXiv:2611.34380v1).
Why it works¶
Graph-guided tests check whether an agent can reach a suspected weakness across turns with guardrails in place. The study compared AgentLens with static analysis (Agent Audit) and single-prompt fuzzing (AgentFuzz) (AgentLens, arXiv:2611.34380v1).
On Langflow, the study counted 11 validated vulnerabilities for AgentLens, 3 for AgentFuzz, and 0 for Agent Audit. On Aider, it counted 8 for AgentLens, 3 for Agent Audit, and 0 for AgentFuzz. Manual inspection identified many false positives among Agent Audit’s Aider findings, and none of AgentFuzz’s 30 Aider seed messages reached a target operation (AgentLens, arXiv:2611.34380v1).
The separate OpenClaw v2026.3.8 benchmark used 20 selected public CVEs reproducible on Linux. AgentLens recorded 15 true positives, 0 false positives, and 5 false negatives. Its 75% recall applies to that set. Standalone Claude Opus 4.6 detected 0, 2, and 2 of the selected vulnerabilities across three runs. The authors note that the model may have encountered the public CVEs during training (AgentLens, arXiv:2611.34380v1).
On Aider, the full AgentLens workflow yielded 8 validated vulnerabilities. The variants found 3 without weakness annotations (NoWA), 4 without information about the existing guardrails (NoGuard), 2 without graph construction and audit paths (NoGraph), and 4 without multi-turn scenarios (NoMultiTurn). NoGuard left Aider’s guardrails in place. On the fixed Aider graph, five Opus 4.6 runs found 7–8 vulnerabilities (mean 7.2). GLM-5.2 found 7 (AgentLens, arXiv:2611.34380v1).
When this backfires¶
- Blocking pull requests in active repositories. Across the five agents, AgentLens reported 1,450.02 to 3,124.99 seconds per run (2,396.44 seconds on average). Security experts manually confirmed findings as part of the study (AgentLens, arXiv:2611.34380v1). Use a static check on pull requests if its measured runtime fits your CI budget. The Agent Audit paper (arXiv:2603.22853v1) reports a 0.87-second scan of a 22,009-line Python codebase. On its separate 42-vulnerability AVB benchmark, it reports 95.24% recall and 86.96% precision.
- Relying on LLM discovery skills for complete graph coverage. Weaknesses missed during discovery never enter the graph. In 14,800 runs of 37 Claude Code security skills on 100 Linux kernel CVEs (file-guided C setup), 24.4% located the vulnerable function and 11.1% got function, statement, and CWE all right (arXiv:2610.25705v1; see Verification Staging for Security Audit Skills).
- Auditing black-box, dynamically mutating, or non-code stacks. The method needs source access and a test environment with suitable filesystem and network restrictions. AgentLens evaluated code-oriented agents (AgentLens, arXiv:2611.34380v1). Closed-source agents, mutating remote MCP servers, and long-horizon non-code workflows fall outside the evaluated scope.
- Treating a clean execution audit as a replacement for runtime containment. AgentLens missed 5 of the 20 selected OpenClaw CVEs, and the five-agent study could not establish recall (AgentLens, arXiv:2611.34380v1). Dual-boundary sandboxing can limit the impact of missed vulnerabilities. Its reach depends on the configured filesystem and network policies.
Example¶
In the Aider case (CVE-2026-10177), AgentLens documented a four-turn path through the web-scraping workflow. The check_for_urls() prompt asked the user to approve the fetch without validating the destination (CWE-20). The downstream cmd_web() and scrape() flow could make requests to destinations the application should have rejected (CWE-918). Review user approval and destination validation as separate controls (AgentLens, arXiv:2611.34380v1).
Key Takeaways¶
- Run graph-guided execution audits before release or at major milestones. Choose per-PR static checks using timings from your own CI.
- Model existing guardrails in the audit graph. Check whether approval and input validation each enforce the boundary you expect.
- Have a security reviewer confirm findings against runtime evidence. Use filesystem and network restrictions whose configured limits match the agent’s intended access.
Related¶
- Verification Staging for Security Audit Skills — Empirical ceiling of LLM security audit skills and why candidate findings require a confirmation stage
- Harness Composition for Scaled Security Audits — Steering, scaling, and stacking dynamic checks to keep LLM security audit triage manageable
- Black-Box Probing in the Agent Build Loop: When It Pays — Outside-in dynamic probing for absent controls as a complement to white-box source review
- Dual-Boundary Sandboxing: Filesystem and Network Isolation — Limit where the agent can read, write, and connect through configured filesystem and network policies
- Always-On Agentic PR Security Review — Separating fast per-PR review from heavier scheduled whole-codebase audits