AgentLens: Graph-guided Security Auditing for LLM-based Agents
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: We're looking at the paper: "AgentLens: Graph-guided Security Auditing for LLM-based Agents".
Title and authors: Elias: They are using this graph to model the target agent’s key components, all its dependencies, how they execute together, any known weaknesses in those parts, and all the built-in guardrails.
Nadia: This graph allows AgentLens to derive specific audit objectives directly from the agent itself instead of relying on a predefined vulnerability class.
Priya: So if you find a weakness in one component node on the graph, how does that translate into something actionable for an auditor?
Elias: The graph structure connects weaknesses in components and their inter-component dependencies into one single auditing path.
Nadia: This means they can trace the potential attack path through the agent’s logic, showing exactly how a weakness in one part can lead to a security-violating behavior somewhere else.
Priya: That sounds much more useful than just flagging a function as potentially risky in isolation because it shows the full context of interaction.
Elias: And they build on that by analyzing the target agent’s code and configuration files to construct an Agent Profile Graph, where nodes are the components and edges show all those invocation, data flow, and control flow dependencies.
Nadia: Then they enrich this graph with potential weaknesses associated with those component nodes and use constraints to represent the guardrails.
Priya: So we’re talking about building a map of the entire agent ecosystem—the good parts and the bad parts—before anyone deploys it?
Elias: That’s essentially what they are aiming for, allowing an auditor to discover implementation-level weaknesses while validating if those weaknesses can manifest through the agent's normal workflows as security-violating behaviors.
Nadia: It moves the auditing process from a blind search to a guided, path-oriented analysis problem where you follow the connections in the graph.
Priya: So, it’s less about finding isolated errors and more about proving that a sequence of errors can cause a failure under operational conditions.
Elias: That’s right. They are trying to address that fundamental challenge where static approaches fail because they lack dynamic context awareness regarding how the LLM plans its next move.
Nadia: So, the summary is essentially proposing this knowledge graph as a way to systematically identify implementation weaknesses and validate their exploitability in real agent workflows.
Priya: It’s a structured approach to proving risk based on the agent's actual operational structure rather than just static code inspection.
The paper's summary: Nadia: The main improvement is moving away from methods like Agent Audit, which relies only on static analysis of code and artifacts to detect risky tool implementations or insecure data flows.
Elias: Their critique is that those static approaches cannot guarantee that the reported issues can actually be triggered during an agent execution because they lack dynamic context awareness.
Priya: So the improvement here is explicitly adding the dynamic context—the LLM’s planning and execution environment—into the auditing process.
Elias: Exactly. AgentLens accounts for not only the suspicious implementation weaknesses but also whether those reported issues are feasible within the agent’s executable workflow, including built-in dynamic guardrails.
Nadia: They tackle two fundamental technical challenges they identified: first, how to define the audit scope of a target agent because risks are often implicit and relational.
Priya: That relational aspect is where the graph comes in; it allows them to see how weaknesses in interac components can be chained together.
Elias: And second, they address whether those issues are feasible under dynamic guardrails, which is something static tools completely miss because they don’t simulate the actual runtime environment.
Nadia: The methodology of generating audit payloads guided by those paths using that LLMgen formula is another key improvement; it’s about creating inputs that are disguised but still effective.
Priya: That payload generation step is where you turn the theoretical graph into something you can actually test against the agent's actual runtime behavior.
Elias: And they pair that with constructing multi-turn audit scenarios guided by the audit path to ensure the generated payload actually propagates through the agent’s original workflow.
Nadia: So, instead of just finding a static warning, you are guided by a path through the graph to generate an input that tests a vulnerability in context.
Priya: It seems like they are bridging that gap between identifying potential weaknesses and proving their actual exploitability within the system's operational constraints.
Elias: That’s the essence of it; it’s about making sure we test what can actually happen, not just what *could* happen on paper.
The paper's improvements: Nadia: AgentLens constructs an Audit Knowledge Graph tailored specifically for LLM-based agent auditing by integrating agent components, workflow dependencies, weakness evidence, and guardrail constraints.
Elias: The evaluation across five widely used open-source software engineering agents showed that AgentLens identifies forty-four validated vulnerabilities across multiple categories.
Priya: And they assigned twelve CVE IDs to those findings during the testing phase.
Nadia: They took about two thousand three hundred ninety-six point four seconds on average per agent for the auditing workflow, generating an average of eight point eight validated vulnerabilities per agent.
Elias: The ratio of validated vulnerabilities to audit paths was sixty-two point eight six percent across all the tests they ran.
Priya: It’s clear that combining workflow-aware audit paths with runtime validation helps AgentLens discover and confirm vulnerabilities better than previous baselines, like Agent Audit or AgentFuzz.
Nadia: It suggests that building this kind of knowledge graph tailored to agent auditing can facilitate practical security auditing of LLM-based agents before they are actually deployed.
Elias: The full title we discussed today is AgentLens: Graph-guided Security Auditing for LLM-based Agents.
Priya: I just think it’s a really structured way to approach this messy problem, moving toward more reliable security checks in this space.
Conclusion: Nadia: So we’ve been looking at AgentLens, this framework they put out for auditing LLM agents by building this Audit Knowledge Graph to map components and dependencies.
Elias: It sounds like a structured way to move past just looking at code and start testing how weaknesses in one part of the agent can actually chain together into a security failure.
Priya: I’m interested in that idea of using the graph to derive audit objectives directly from the agent itself instead of us just guessing what kind of vulnerability we should look for.
Nadia: Exactly, it lets you see how those weaknesses connect across the entire system, not just in isolation.
Elias: And they use this graph to guide generating test payloads using an LLM guided by a formula that says the payload needs to disguise its intent while still hitting the exploit target and bypass any guardrails.
Priya: That part about disguising the intent is interesting because it suggests they’re trying to make the test realistic enough to see if it actually works in a live workflow.
Nadia: Right, they then build these multi-turn audit scenarios that use that path information to deliver the payload in a way that mimics how the agent would actually be working.
Elias: So it’s not just a static check; it’s about proving that an isolated weakness can actually propagate through the agent's original workflow under existing guardrails.
Priya: That moves us past just finding potential risks and into validating whether those risks are actually reachable in practice, which is a huge step for trust.
Nadia: So, to recap, AgentLens builds this knowledge graph to model the agent’s structure and weaknesses, then uses that to generate path-guided tests that run through the agent's workflow.
Elias: The results they got on five different open-source engineering agents showed it finding forty four validated vulnerabilities and assigning twelve CVE IDs.
Priya: That number of confirmed findings is impressive when you think about how much context you need to get those kinds of reliable results from an AI system.
Nadia: It really shows that moving toward workflow-aware auditing helps us make more concrete security checks before we let these things run in production environments.
Elias: Yeah, it’s a solid framework for making sense of these complex agent systems, and it sets a new standard for how we audit them.
Priya: It makes the work of securing agents much more systematic and less reliant on guesswork about what might go wrong.
Peizhuo Lv, Tao Chen, Mengya Shi, Ziyu Lin, Yuxuan Chen, Ruigang Liang, Tianwei Zhang, Wei Dong, XiaoFeng Wang
Nanyang Technological University, Singapore · School of Cyber Science and Technology, Shandong University, China · Institute of Information Engineering, Chinese Academy of Sciences, China
cs.CR
Submitted: 2026-11-25
Updated: 2026-11-25
Comments: 13 pages, 4 figures, 3 tables
Code: https://github.com/langflow-ai/langflow
License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
Importance score: 95/100
The gist: LLM-based agents are emerging as a key paradigm for automating software engineering by coupling LLM-driven decision-making with external tools, files, APIs…
Key concepts
- Audit Knowledge Graph
- This is a new data structure that models an agent's entire architecture. It connects components, their dependencies (how they call each other), potential weaknesses in individual parts, and built-in safety rules (guardrails). This graph allows the system to understand how different weaknesses can chain together to cause a security issue.
- Agent Profile Graph
- This initial graph is built by analyzing the agent's code and configuration files. Its nodes represent specific parts of the agent, like functions or modules, and edges show how they interact—for example, data flow or control flow. This forms the foundation for understanding the agent's operational structure.
- Payload Generation (LLMgen)
- This stage uses an LLM guided by audit paths to create test inputs. The formula Payload = LLMgen(R, I, p) ensures the generated payload is designed to disguise its true malicious intent while still achieving the exploit goal. This helps in bypassing existing guardrails during testing.
- Scenario-based Validation
- This final stage tests generated payloads within realistic, multi-turn audit scenarios. By embedding the raw test inputs into contextualized conversations that mimic the agent's normal operation, AGENTLENS validates whether a weakness can actually propagate through the agent's workflow and cause a security violation under real constraints.
Terminology
Summary
LLM-based agents are emerging as a key paradigm for automating software engineering by coupling LLM-driven decision-making with external tools, files, APIs, and execution environments. p. 0<ref:2611.34380#pg1, LLM-based agents are emerging as a key paradigm for automating software engineering by coupling LLM-driven decision-making with external tools, files, APIs, and execution environments >
The Problem Addressed
Predeployment auditing is essential for systematically identifying implementation weaknesses and validating whether they can manifest as concrete security risks in realistic agent workflows.<ref:2611.34380#pg1, This makes pre-deployment auditing essential for systematically identifying implementation weaknesses and validating whether they can manifest as concrete security risks in realistic agent workflows >. p. 0 Existing approaches either focus on specific vulnerability classes or lack the capability to validate whether identified static weaknesses correspond to executable exploits. p. 0<ref:2611.34380#pg1, Prior security testing approaches for foundation LLMs are insufficient for auditing agents because agent security depends not only on the LLM response itself, but also on how the surrounding implementation interprets that response and translates it into tool calls, external requests, or other environment-changing actions >
AGENTLENS Framework Design
AGENTLENS proposes a systematic auditing framework for LLM-based agents.<ref:2611.34380#pg2, The core of AGENTLENS is a new data structure, Audit Knowledge Graph, to model the target agent’s key components, dependencies, execution relations, potential weaknesses, and built-in guardrails >. p. 1 This graph allows AGENTLENS to derive concrete audit objectives from the target agent itself rather than assuming a predefined vulnerability class (addressing C1). p. 1<ref:2611.34380#pg2, Specifically, AGENTLENS first analyzes the target agent’s code and configuration files to construct an Agent Profile Graph, whose nodes represent agent components and edges represent invocation, data-flow, and control-flow dependencies >. p. 1 It then enriches this graph with potential weaknesses associated with component nodes and deployed guardrails represented as constraints, forming an Audit Knowledge Graph. p. 1<ref:2611.34380#pg2>
Validation Methodology
AGENTLENS employs a three-stage workflow: (1) Audit Dependency Relationship, (2) Payload Generation, and (3) Validation.<ref:2611.34380#pg4, In the payload generation stage, AGENTLENS derives candidate audit paths from entry nodes to security-critical operation nodes and then employs an LLM to generate test payloads guided by these paths using the formula P ayload = LLMgen(R, I, p) (5) >. p. 4 Finally, AGENTLENS validates the generated payloads through scenario-based testing by embedding raw payloads into contextualized multiturn audit scenarios. p. 3<ref:2611.34380#pg4>
Evaluation Results
Across five widely used open-source software engineering agents, AGENTLENS identifies 44 validated vulnerabilities across multiple categories.<ref:2611.34380#pg2, AGENTLENS takes 2,396. p. 144 seconds per agent on average for the auditing workflow and generates an average of 8. p. 18 validated vulnerabilities per agent >. p. 1 The ratio of validated vulnerabilities to audit paths is 62. p. 186%.<ref:2611.34380#pg5>
Case Study Significance
The case study of server-side request forgery in Aider demonstrates two benefits of the Audit Knowledge Graph.<ref:2611.34380#pg10, First, the graph connects weaknesses in URL handling and web scraping into an auditing path, guiding AGENTLENS to validate this attack >. p. 9 Second, the auditing path guides the construction of a multi-turn audit scenario, enabling AGENTLENS to deliver the payload through the agent’s normal workflow and validate the vulnerability. p. 9<ref:2611.34380#pg10, This case also shows two benefits of our Audit Knowledge Graph >
Conclusion
AGENTLENS constructs an Audit Knowledge Graph tailored to LLM-agent auditing, which integrates agent components, workflow dependencies, weakness evidence, and guardrail constraints.<ref:2611.34380#pg12>. Our evaluation on five widely used agent applications shows that AGENTLENS identifies 44 vulnerabilities, with 12 CVE IDs assigned. p. 1<ref:2611.34380#pg12>
Related Work Context
Traditional analysis techniques have been widely used to detect software vulnerabilities but struggle with the agent-specific behaviors that depend on natural-language instructions and LLM planning.<ref:2611.34380#pg13>. AgentFuzz focuses on taint-style vulnerabilities triggered by a single prompt and misses vulnerabilities that require multiple weaknesses to be connected along an execution path. p. 8<ref:2611.34380#pg9, Agent Audit relies on static analysis but lacks dynamic execution context, meaning it cannot determine if a reported weakness is actually reachable during the agent’s runtime >
Impact of Parameters
The ablation study shows that without weakness annotations or guardrail information, AGENTLENS fails to identify concrete security risks.<ref:2611.34380#pg10>. The full system produces no unconfirmed findings in all variants. p. 9<ref:2611.34380#pg10>
Threats to Validity
There are several threats to the validity of our results, including runtime behavior checks may incorrectly judge exploitation outcomes when observable signals are incomplete or ambiguous.<ref:2611.34380#pg11>. Our findings may not generalize to all LLM-based agents because our evaluation mainly focuses on code agents. p. 9<ref:2611.34380#pg12>
Comparison Summary
AGENTLENS identifies more validated vulnerabilities than both baselines in Aider, identifying 8 compared to Agent Audit's 3 and AgentFuzz's none.<ref:2611.34380#pg9, AGENTLENS uses audit paths to guide multi-turn tests through Aider’s workflow and confirms more vulnerabilities than both baselines >. p. 8 This result suggests that combining workflowaware audit paths with runtime validation helps AGENTLENS discover and confirm vulnerabilities. p. 8<ref:2611.34380#pg9, AgentFuzz produces 30 seed messages but none reaches a sink, whereas AGENTLENS generates 70 audit paths and identifies 44 validated vulnerabilities >
Final Contribution
We propose AGENTLENS, a systematic auditing framework for LLM-based agents that builds an Audit Knowledge Graph capturing agent workflow components and dependencies.<ref:2611.34380#pg12> AGENTLENS can facilitate practical security auditing of LLMbased agents before deployment. p. 1
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Build an Audit Knowledge Graph to model agent components, dependencies, weakness evidence, and guardrail constraints to allow auditing through a path-oriented analysis problem. This graph captures
how weaknesses in components and inter-component dependencies can be chained together to lead to securitycritical behaviors.
-
Design an automated validation approach that generates audit payloads by employing an LLM guided by the Audit Knowledge Graph, specifically using the formula Payload = LLMgen(R, I, p). This payload generation process is designed to
disguise its intent while preserving its exploit objective
andBypass Guardrails.
-
Construct multi-turn audit scenarios that deliver generated payloads within a natural task progression by employing an LLM guided by the Audit Path. This ensures the system can
validate whether isolated weaknesses can propagate through the agent’s original workflow and manifest as security-violating behaviors under existing guardrails.
Sources
- Open-SWE-Traces: Advancing Dual-Mode Multilingual Distillation for Software Engineering Agents
- Vulnerability Detection with Code Language Models: How Far Are We?
- TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenance
- From Prompt Injections to SQL Injection Attacks: How Protected is Your LLM-Integrated Web Application?
- Understanding and Mitigating Prompt Leaking Attacks in Real-World LLM-Based Applications
- Universal and Transferable Adversarial Attacks on Aligned Language Models
- HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusal
- garak: A Framework for Security Probing Large Language Models
- Agent Audit: A Security Analysis System for LLM Agent Applications
- MemMorph: Tool Hijacking in LLM Agents via Memory Poisoning
- Les Dissonances: Cross-Tool Harvesting and Polluting in Pool-of-Tools Empowered LLM Agents
- SpecOps: A Fully Automated AI Agent Testing Framework in Real-World GUI Environments
Related papers
- RustMizan: A Compilable, Contamination-Aware Benchmarking Framework for Rust Vulnerabilities
- Introducing the Generative Application Firewall (GAF)
- Opal: Private Memory for Personal AI
- Fuel as Identity: Authenticating Inter-Satellite Laser Links after Total Key Compromise
- Merkle Trees Minimize Verifier Complexity in the ROM
- VulCPE: Context-Aware Cybersecurity Vulnerability Retrieval and Management