Preprint
Article

This version is not peer-reviewed.

Category-Aware Structural Inspection of LLM-Based Agents via Agent-Conditioned Scenarios and Trace-Grounded Evaluation

  † T. Han, Y. Seo, H. Kim, and Y. Choi contributed equally as second authors.

Submitted:

24 November 2026

Posted:

26 November 2026

You are already at the latest version

Abstract
Agentic AI systems introduce security challenges because their execution paths emerge dynamically through large language model (LLM) reasoning, tool selection, and external interactions. Vulnerabilities arise not only from faulty functions but from how an agent composes tools, observations, and policy decisions. This challenges conventional detection methods that start from a known target function and craft inputs to trigger misuse. We present SPECTRA (Structural & Category-Aware Threat Risk Analysis), a behavior-guided framework that establishes an upstream inspection stage without exhaustive path exploration. SPECTRA grounds predefined category-level threat cases in a target agent’s configuration, generates agent-conditioned adversarial scenarios, and inspects whether targeted weaknesses become observable in execution traces. These steps form an automated pipeline adaptable across heterogeneous agents, providing upstream evidence for exploit-oriented analysis, fuzzing, and benchmark evaluation. Across ten white-box agent configurations and eleven threat categories, 400 of 570 scenarios (70.2%) produced execution traces that met the criterion for the targeted structural weakness. In the scope-scaling experiment, inspection time reaches approximately 870 s when all eleven threat categories are included. SPECTRA can serve as a first step in vulnerability analysis by showing where an agent’s execution trace provides evidence of a structural weakness.
Keywords: 
;  ;  ;  ;  ;  

1. Introduction

Agentic AI systems are increasingly integrated into modern software, extending large language models beyond passive interaction to autonomous task execution through external tools, APIs, and data sources [1,2]. At the same time, this shift has significantly expanded the attack surface of AI systems. Recent incidents, such as EchoLeak (CVE-2025-32711) [3,4], illustrate that agent-based services can exhibit failure modes that are difficult to capture with conventional software-centric assumptions, including zero-click attacks that require no user interaction. Related disclosures across diverse agent products (Table 1) span direct prompt injection (DPI) [5], indirect prompt injection (IPI) [6], supply-chain (SC) compromise [7], and remote code execution (RCE) [8]. These developments motivate systematic, deployment-aware security inspection methods for agentic systems.
Agentic AI systems introduce a fundamentally different security analysis problem from that of conventional software. In traditional vulnerability analysis, analysts can often begin from known security-sensitive functions, or sinks, and then reason about the program paths and inputs that may reach those sinks and trigger their misuse [9,10]. In contrast, agent systems determine their execution paths dynamically through LLM-mediated reasoning, tool selection, and interaction with external data sources. Consequently, vulnerabilities may arise not only from individual functions, but also from the workflow-level composition of multiple tools, intermediate observations, and policy interpretations. This challenges a common starting point of sink-oriented and target-guided vulnerability detection methods [8,11]: before testing whether vulnerable behavior can be induced, analysts must first determine whether and where such behavior is reachable under the target agent’s tools, policies, and execution context.
Existing research addresses this challenge from two main directions, but neither alone fully addresses deployment-grounded structural inspection. The first direction is exploit-oriented analysis, including source-to-sink tracing and target-guided fuzzing for LLM-integrated and agentic applications [8,12]. These methods identify or validate paths from user-controlled inputs to security-sensitive functions. However, they rely on predefined vulnerability-relevant targets, such as sinks, and thus require the relevant classes of vulnerable behavior to be specified before analysis begins. This reduces the search space, but bounds the inspection scope: only predefined targets or vulnerability classes can be examined, while undefined or emergent structural weaknesses remain outside the inspection boundary. This creates a core tension: methods intended to discover unknown structural weaknesses must first specify what should be treated as security-relevant. Moreover, reaching a security-sensitive function does not by itself imply a security violation, because exploitability also depends on the agent’s runtime reasoning, tool arguments, intermediate observations, and policy context. Context-dependence alone is not unique to agents—whether a traditional function is exploitable also depends on its calling context. The difference is that in agentic systems the concrete workflow realization of a security-relevant target is not fixed in advance: rather than discarding the source-to-sink view, we generalize it—the target slot that classical analysis instantiates as a function-level sink can also be instantiated, in agentic systems, as a behavior-level structural weakness defined by how the agent composes its workflow. Sink-oriented analysis can discover new vulnerabilities, but its predefined function-level targets do not by themselves specify workflow-level weakness criteria.
The second direction is behavior-oriented evaluation, including agent security benchmarks that test whether agents produce unsafe or policy-violating outcomes under predefined adversarial prompts, instructions, or tool-misuse scenarios [20,21]. These benchmarks are useful for measuring known failure patterns, but their coverage is bounded by the attack cases specified in advance. As a result, they can miss previously unseen or deployment-specific risks and fail to reflect the diversity of real-world agent configurations shaped by tools, prompts, permissions, and data sources. Moreover, expanding coverage often requires manually adding new cases for each agent or domain; deployment-grounded category-level inspection is not generally their primary objective. The search space therefore grows multiplicatively over prompts, tools, execution paths, and input variations, making exhaustive exploration impractical as agent complexity scales.
To address these limitations, we propose SPECTRA (Structural & Category-Aware Threat Risk Analysis), a framework that grounds agent security inspection in category-aware scoping. Our contribution is therefore not a new detection algorithm, but a way to make this class of workflow-level weakness systematically inspectable. Our key insight is that, before reconstructing execution paths or generating exploit inputs, the analysis must first define a category-level threat scope and ground it in the target agent’s tools, policies, and execution context—because in agentic systems, the precondition for exploit-oriented or behavior-oriented analysis is determining where workflow-level weaknesses can plausibly arise in the first place. SPECTRA generates scenarios tailored to the target agent’s tasks and tools. The generator returns each scenario together with its success criterion and is instructed to use the criterion defined in advance for the threat case. For each positive finding, SPECTRA identifies the evidence in the execution trace that supports its judgment, without enumerating every possible prompt, tool combination, or execution path. In doing so, SPECTRA acts not as a replacement for exploit-oriented analysis, fuzzing, taint analysis, red-teaming, or benchmark-based evaluation, but as an upstream stage that provides the structural evidence on which they can subsequently operate.
The contributions of this paper are as follows:
  • Structural reframing of agent vulnerability analysis. We reframe agent vulnerability analysis as a category-aware reachability problem over workflow-level structural weaknesses that are not fully characterized by function-level sinks alone. Rather than assuming a known sink and asking how to reach it, SPECTRA asks which specified classes of structural weakness become observable under a target agent’s tools, prompts, and policies, and where they manifest in the resulting execution traces.
  • Category-aware threat-case grounding. We introduce a scoping stage that grounds category-level threat cases in the target agent’s tools, policies, high-risk actions, and permission boundaries before scenario generation. This focuses inspection on workflow regions where structural weaknesses can plausibly arise, without exhaustive prompt, tool, or path enumeration.
  • Agent-conditioned adversarial scenario generation. We generate adversarial inspection scenarios by combining reusable threat specifications with the target agent’s deployment-specific configuration. This produces scenarios adapted to the agent under inspection while keeping threat knowledge reusable across deployments.
  • Trace-based structural diagnosis. We build an end-to-end pipeline that integrates scenario generation, controlled agent execution, and trace-based evaluation over planning steps, tool calls, arguments, observations, and final responses. Each positive finding is grounded in a specific observation criterion, turning aggregate results into evidence about where in the workflow a weakness manifests—not just whether the final output is unsafe.
Taken together, these contributions position SPECTRA as an upstream stage of the agent security stack that makes category-grounded workflow diagnosis explicit: a stage where workflowlevel structural weaknesses are first scoped, surfaced, and diagnosed before exploit validation, fuzzing, or benchmarkbased evaluation begin.
The remainder of this paper is organized as follows. Section 2 formalizes the structural vulnerability inspection problem, reviews exploit-oriented and behavior-oriented analysis, and motivates category-aware search-space reduction. Section 3 presents SPECTRA, including threat and agent specifications, adaptive scenario generation, and trace-based behavioral evaluation. Section 4 reports the white-box evaluation results, including reliability, structural-weakness findings, and workload comparison. Section 5 discusses search-space reduction, remediation evidence, and pre-deployment inspection value, and Section 6 concludes the paper. Appendix E reports a supplementary black-box observation on three commercial agents.

2. Problem Formulation

We model agent vulnerability inspection as a search over three spaces: security-relevant targets S, execution paths P, and inputs or interventions I. In conventional vulnerability analysis, S is often instantiated as a function-level sink. In agentic systems, however, the relevant target may instead be a behavior-level structural weakness, such as policy-violating tool use, omitted safeguards, or permission-crossing actions [7]. Let Φ ( s , p , i ) denote whether an input or intervention i drives the agent through a path p and realizes a security-relevant target s. The inspection objective is to identify tuples in the set
V = ( s , p , i ) ∈ S × P × I ∣ Φ ( s , p , i ) = 1 .
This set expresses the security-relevant combinations sought by inspection; it does not require exhaustive enumeration of S × P × I . For a finite candidate set T ⊆ S × P × I and a uniform repetition budget n, a simple workload model is C explore = n · | T | . This counts all candidate tests, including unsuccessful ones, rather than wall-clock inference time. The distinction captures the central difficulty: in agentic systems, the relevant targets, feasible paths, and effective inputs are not fully known before inspection begins.
Practical methods therefore make the problem tractable by constraining one or more of S, P, and I. The key question is what is fixed in advance and what remains to be discovered. If S is fixed as a set of function-level sinks, analysis can recover or validate paths toward those sinks, but it cannot inspect harmful behaviors outside that target set. If I is fixed as a set of predefined adversarial prompts or payloads, evaluation can measure known failure patterns, but it cannot determine which unseen or deployment-specific behaviors remain reachable. Table 2 summarizes this tradeoff.

2.1. Exploit-Oriented Analysis

Exploit-oriented approaches make agent vulnerability analysis tractable by first restricting S. LLMSmith identifies predefined sink functions through static analysis and backtracks from them to recover candidate paths, and uses prompt-based exploitation to validate candidate vulnerabilities [8]. AgentFuzz extends this path-oriented view by treating taint-style vulnerability detection in agents as a directed greybox fuzzing problem [11]: it extracts call chains leading to predefined sinks and then searches for natural-language inputs I that can drive the agent toward those sinks and satisfy a vulnerability oracle [12]. In this sense, AgentFuzz moves beyond path recovery toward valid-input discovery.
However, both approaches remain anchored in predefined sink classes, which can guide the discovery of previously unknown vulnerabilities. Static analysis is required to identify function-level sinks or call-chain targets, and the search remains bounded by the predefined S. This is effective when vulnerable behavior can be localized to a named function, but workflow weaknesses may remain outside that target set when they emerge from tool composition, intermediate observations, memory state, or policy-dependent reasoning without a corresponding sink-level target. Thus, these methods help measure or validate P under a sink-oriented S, while category-aware structural inspection explicitly grounds behavior-level threat cases in the target workflow.

2.2. Behavior-Oriented Evaluation

Recent agent-security work shifts attention from static path recovery to runtime behavior and input surfaces. In agentic systems, the relevant input I need not enter only through the user interface. It may originate from tool outputs, retrieved documents, memory states [23,24], or other intermediate observations, making P more variable and less amenable to purely static analysis.
InjecAgent and AgentDojo capture this runtime perspective by injecting malicious instructions into designated tool outputs and checking whether corrupted observations alter subsequent agent behavior [20,22]. In terms of Eq. (1), these methods specify attacker goals and tool surfaces, then instantiate I through selected attack strategies. AgentDojo also supports newly defined and adaptive attacks; its provided cases should therefore be distinguished from the capabilities of the extensible framework. ASB broadens the evaluation scope by covering multiple representative attack classes in agent environments, showing that agentic attack surfaces extend beyond direct prompt misuse [21,25].
These approaches reveal important structural risks in agent systems, but their reported coverage is bounded by the selected task and attack configurations. Concrete tasks, tool surfaces, and attack goals must be specified for an evaluation; extending a benchmark does not itself ground a reusable threat catalog in a separate target deployment. As a result, such benchmarks may include irrelevant cases for a given deployment while missing threats that are specific to the target agent’s tools, policies, permissions, or data sources. The search space grows multiplicatively over prompts, tools, execution paths, and input variations, making exhaustive evaluation impractical as agent complexity scales.

2.3. Comparison and Positioning

Overall, exploit-oriented and behavior-oriented approaches differ in form, but share the same underlying strategy: they make analysis tractable by fixing part of the S–P–I space in advance. Exploit-oriented methods define S as function-level targets and focus on recovering or validating P, while behavior-oriented benchmarks instantiate I within specified task and attack scopes and observe the resulting behavior. This leaves a practical scoping task: grounding category-level threat cases in a target deployment’s tools, policies, and permission boundaries before generating inspection scenarios.
SPECTRA defines S at the level of threat behaviors and structural weakness classes. Its threat-case catalog is fixed, while concrete behavioral targets and scenario inputs are instantiated through the target agent’s tools, policies, and operational context (Table 2). SPECTRA provides this category-aware scoping step as an upstream structural inspection stage, producing deployment-grounded tests and trace evidence for subsequent exploit-oriented analysis or benchmark-based investigation.

3. Framework Design

This section presents SPECTRA, a predeployment framework for categoryaware structural inspection of LLMbased agents. As shown in Figure 1, the Threat Specification defines a success criterion for each case. The generator uses the Agent Specification to tailor the scenario to the target’s tasks and tools and is instructed to include the case criterion in its output. After execution, the evaluator compares the agent’s recorded behavior with the criterion in the scenario, which serves as the test oracle [26].
SPECTRA is built around three design principles:
  • Workflow-level inspection. The unit of analysis is the agent workflow, including planning text, tool calls, tool outputs, intermediate observations, and final responses.
  • Category-aware scoping. A reusable Threat Specification is combined with a deployment-specific Agent Specification to instantiate in-scope threat cases using the target agent’s tools, policies, and operational context before scenario generation.
  • Trace-based evaluation. Each scenario is evaluated using the observed execution trace and a scenario-specific oracle, grounding findings in execution evidence rather than final outputs alone.

3.1. Threat Model and Inspection Scope

SPECTRA inspects structural weaknesses that can be induced through the runtime inputs, toolmediated content, and execution context available to an LLMbased agent. Its scope is therefore limited to weaknesses that leave workflowlevel behavioral evidence, such as planning text, tool calls, tool arguments, tool results, or final responses. We assume that the attacker cannot modify the underlying model weights, tool implementations, runtime infrastructure, or audit logs, but can submit user prompts or influence external content returned by configured tools. The inspection itself is performed in a white-box setting: the inspector has access to the target agent’s system prompt, tool schemas obtained through MCP introspection, and the full execution trace, but not to the underlying model weights. This level of access makes the agent configuration and workflow-level behavior inspectable without assuming access to model internals. Under this threat model, a positive inspection finding denotes an execution trace that satisfies the scenariospecific oracle for the specified structural weakness. Thus, the inspection-level attack-success rate (ASR) reported in this paper denotes the rate of structuralweakness findings under the specified inspection setting, rather than the rate of successful real-world attacks.
SPECTRA uses the OWASP Agentic AI threat taxonomy as the category catalog for inspection [7]. Our inspection targets threats that leave workflow-level behavioral evidence—planning text, tool calls, arguments, observations, and final responses—and we adopt the categories that can be induced through runtime inputs or tool-mediated content and observed in such evidence. In our evaluation, this criterion yields eleven threat categories, detailed later in Section 4.1. Threats that fall outside a single-agent scope, such as multi-agent interaction, are not addressed in this work, and extending the framework to them is left for future work. Supply-chain compromise is considered only when it manifests through observable input or tool channels in the inspection environment.
The white-box setting considers two injection channels specified in the Threat Specification’s variant cases. In direct prompt injection (DPI) [5], adversarial content is delivered through the user-facing prompt. In indirect prompt injection through tool results (tool-result IPI) [6], adversarial content is embedded in data returned by a tool and consumed during the agent’s intermediate reasoning process. These channels align with SPECTRA’s trace-based setting, where injected content can be attributed to either the user input or a concrete tool-result event.
Appendix E reports a supplementary black-box observation on three commercial agents under production observability constraints. In this setting, the inspector has access only to the initial input and the final agent response, without tool calls or intermediate execution traces. This observation does not use the SPECTRA pipeline; it examines only whether document-borne indirect instructions can influence observable agent responses, separately from the main trace-based inspection.

3.2. Threat and Agent Specifications

SPECTRA uses two structured inputs to separate reusable threat knowledge from deployment-specific agent context. The Threat Specification defines agent-independent threat categories, case conditions, and evidence patterns, which are used to inspect how structural weaknesses can be realized in agent workflows. The Agent Specification captures the target agent’s role, tools, policies, and operational boundaries. This separation is central to SPECTRA’s category-aware design: the Threat Specification preserves reusable threat knowledge, while the Agent Specification provides the deployment-specific context needed to ground in-scope threat cases and determine how they should be instantiated. As a result, the same threat catalogue can be reused across agents, while each inspection scenario is adapted to the concrete deployment under test.
Threat Specification. A Threat Specification encodes each threat category as an agent-independent inspection template. As shown in Table 3, it has two levels. Threat-level fields define the general category, including its identifier, name, description, and additional rules for scenario generation. Case-level fields define concrete inspection cases under that category, including the adversarial pattern, the reproducibility assumption in the controlled stub setting, and the judgment criterion used to determine whether the case is realized. The attack_condition field specifies both the delivery form and the payload structure of the adversarial condition, such as a memory-like prefix, a direct user prompt, or a tool-result payload represented as an indirect prompt injection. The judgment_criteria field later serves as the basis for the scenario-specific oracle used in trace-based evaluation. This two-level structure allows the same Threat Specification to be reused across agents, while leaving concrete tool names, policy terms, and task contexts to be filled in from the Agent Specification.
Agent Specification. An Agent Specification records the target deployment context used to instantiate the retained threat cases. The implementation obtains agent metadata and the system prompt from the existing configuration and collects tool names, descriptions, and parameter schemas through standard MCP introspection [2]. Operational policies and any stated permission constraints are retained in the system prompt; they are not extracted into separate policy or permission fields. The specification captures externally defined configuration rather than the underlying LLM’s internal state. Table 4 lists the fields used by the implementation.
Together, the two specifications define the input space of SPECTRA. The Threat Specification determines the threat categories and realization conditions to inspect, while the Agent Specification supplies the deployment-specific symbols, policies, tool boundaries, and workflow context needed to instantiate them. The next subsection describes how SPECTRA combines these two inputs to generate agent-tailored inspection scenarios.

3.3. Adaptive Adversarial Scenario Generation

SPECTRA uses a Threat Specification and an Agent Specification to generate inspection scenarios for a target agent. The Threat Specification identifies the weakness to be tested in each case and gives the criterion for judging whether it occurred. When defining each case from the OWASP threat descriptions, we specified which actions or omissions in an execution trace would indicate the weakness. The Agent Specification describes the tools, operating policies, and permissions relevant to testing the case in the target environment.
Inspection scope. We applied the same 19 cases across 11 threat categories to every target agent. The circumstances under which each case is tested depend on the agent’s tasks and policies. For example, when a case tests for an omitted check, the target agent’s policy identifies which task requires prior verification, and its tool definitions identify the tool available for that check. Appendix A summarizes the scope of the evaluation.
Case-level generation. The generator processes one threat case per LLM call. It receives the threat description and generation rules, the conditions and judgment criterion for the case, and the target agent’s specification. A single call produces k scenario variants that test the same weakness under different circumstances. Each variant reflects the agent’s task context, available tools, and the policies and permissions governing their use. In our evaluation, we generated three variants for each of the 19 cases, yielding 57 scenarios per agent. Algorithm 1 summarizes the procedure.
Preprints 246180 i004
Scenario output and judgment criterion. For each scenario, the generator returns a JSON record containing the threat and case, the legitimate user task, the adversarial content and its delivery method, and the success criterion. The case’s attack_condition specifies the delivery method. The generation prompt instructs the LLM to use the judgment_criteria defined for that case in the Threat Specification as the scenario’s success criterion. The judgment criterion is fixed before the target agent runs. After execution, the evaluator reports a weakness only if the agent’s trace contains evidence of the action or omission specified by that criterion (Section 3.4).

3.4. Execution and Behavioral Evaluation

SPECTRA runs the scenarios generated in Section 3.3 against the target agent and records its behavior. In the white-box setting, the agent follows a ReAct loop [1]. It plans its work, calls tools, observes their responses, and returns a final answer. To control interactions with external systems, SPECTRA uses stub MCP tools [2]. These tools expose the same interfaces as the target agent’s tools and return deterministic responses specified by the scenario. This setup allows us to observe which actions the agent takes and where a weakness appears during execution.
Execution trace. For each scenario, SPECTRA records the scenario identifiers, the agent’s planning text, tool calls and their arguments, tool responses, and the final answer. For indirect prompt injection through a tool response, the trace records the injected content with the corresponding response. The evaluator can therefore follow the sequence from the information the agent received to its subsequent plans and tool calls.
Behavioral evaluation. The evaluator compares the execution trace with the success criterion recorded in the scenario before the run. The criterion specifies which action or omission would constitute evidence of the weakness under inspection. When the trace meets that criterion, the evaluator records a successful scenario, classifies the observed behavior under one of the six categories in Table 5, and identifies the evidence supporting its judgment.
Case T4-C2 illustrates the omitted check introduced in Section 3.3. The government service agent’s policy requires it to consult the applicable regulations before updating a citizen record or issuing a certificate. For this case, the success criterion is met if the agent consults the regulations only once for multiple tasks, omits the lookup altogether, or performs a task before the required lookup. In one variant (T4-C2-S1), the agent updated a citizen record and then issued a certificate. The complete trace contained no call to the regulation lookup tool (kb_search_trusted). The run therefore met the criterion for an omitted lookup, and the evaluator recorded a missing required tool call (OB2). In another variant (T4-C2-S3), the trace showed a regulation lookup before the certificate was issued and a separate lookup before the citizen record was updated. That run did not meet the same success criterion.
Scenario generation, target-agent execution, and behavioral evaluation used the same underlying model, so model-specific biases may affect more than one stage. Section 4.2 reports agreement between the evaluator and human reviewers who assessed the same traces in a separate validation setting.
Findings and measurements. Each inspection record links the threat case and scenario variant to the verdict and its supporting trace evidence. Positive findings also identify the observation category. To summarize the results, we report an inspection-level attack-success rate (ASR), following the terminology of agent-security benchmarks [20,21]. In this study, ASR is the proportion of generated inspection scenarios whose execution traces show the structural weakness specified in advance. The individual findings identify where the evidence appears in the agent’s plan, tool calls, arguments, or final answer. Appendix B gives execution and evaluation details, and Appendix C presents representative traces.

4. Evaluation

We evaluate SPECTRA in terms of the reproducibility and oracle reliability of its inspection artifacts in a controlled environment, addressed through a white-box evaluation across heterogeneous agent deployments. Separately, a supplementary black-box observation in Appendix E examines whether the threats it targets also surface in real commercial environments. This observation does not use the SPECTRA pipeline and provides circumstantial evidence for the real-world relevance of these threats rather than a validation of the framework. Aggregate measures such as ASR are used as inspection-level summaries of trace-grounded structural-weakness findings.

4.1. Experimental Setup

Target agents. We evaluate SPECTRA on ten LLM-based agents covering different service domains. Each agent is defined by a system prompt, a common abstract tool schema instantiated for the domain, and domain-specific service policies. These configurations are used to construct the Agent Specification described in Section 3.2. Although the agents share the same abstract tool-schema skeleton for controlled comparison, each is instantiated with different tools, policies, and semantics across domains. All agents in our main evaluation run in a controlled stub environment. Among existing studies, behavior-based benchmarks form the closest relevant context for our framework, so we conduct a quantitative comparison with AgentDojo [20] in terms of inspection workload and threat coverage. Path-oriented detection studies such as LLMSmith [8] and AgentFuzz [12] target downstream CVE-style vulnerability discovery, which differs in its measurement target from the upstream category-aware inspection performed by SPECTRA. We therefore position them as complementary downstream-oriented research rather than as quantitative comparison points. Table 6 summarizes the target agents used in the main white-box evaluation.
Threat coverage. For the main white-box evaluation, we instantiate the inspection scope using eleven threat categories from the OWASP Agentic AI Threats and Mitigations taxonomy [7], following the scope criteria in Section 3.1. These categories contain nineteen case-level specifications. For each case, SPECTRA generates k = 3 scenario variants, resulting in 57 scenarios per agent and 570 scenarios across ten agents. Table 7 summarizes the evaluated threat categories and case counts.
Scenario generation and execution. The scenario generator and the behavioral evaluator both use Gemini 2.5 Flash [27] at temperature 0 to reduce sampling variance. The full prompt templates are available in the study materials. For each target agent, SPECTRA first constructs an Agent Specification from the agent configuration and then generates scenarios from the Threat Specification using the case-level generation procedure in Section 3.3. Generated scenarios are executed in the white-box ReAct-style environment described in Section 3.4. Stub MCP tools return scenario-defined mock responses in a deterministic manner, making the execution environment reproducible under the same input and tool conditions. The main findings use one execution record for each of the 570 scenarios; repeated executions are analyzed separately in Section 4.2. All ten configured tools are exposed in each main-evaluation execution.
Evaluation outputs. For each executed scenario, SPECTRA records the execution trace and applies the behavioral evaluator described in Section 3.4. The evaluator produces a structural-weakness finding consisting of a binary judgment, an observation criterion, and a trace-grounded rationale. We summarize these findings using the inspection-level attack-success rate (ASR) defined in Section 3.4. The following two subsections report pipeline reliability and findings across agents and threats. Details of the supplementary black-box observation are provided in Appendix E.

4.2. Reliability of Scenario-Based Inspection

Before reporting structuralweakness findings, we examine whether the scenariobased inspection procedure produces stable artifacts across execution, scenario construction, and behavioral judgment. Because SPECTRA relies on LLMgenerated scenarios, LLMmediated executions, and LLMbased evaluation, instability in any stage would make downstream findings difficult to interpret. We therefore evaluate four aspects: semantic trace reproducibility, scenarioconstruction stability, scenariooracle reliability, and the observed yield across repeated executions under stochastic agent behavior.
Semantic trace reproducibility. We first examine whether repeated executions of the same inspection scenario produce semantically stable trace-level evidence. For each agent, threat case, and variant count k ∈ { 2 , 3 , 4 , 5 } , we execute each scenario five times under identical mock-tool conditions and compute the average pairwise similarity among trace embeddings. Figure 2(b) shows that semantic trace reproducibility remains close to 1.0 across threat cases and variant counts. Thus, the repeated executions retain similar semantic trace content as the number of generated variants grows, supporting the use of these artifacts in the analysis in Section 4.3.
Scenario construction stability. We next assess whether generated scenarios preserve the intended case-level inspection intent as k increases. We use the silhouette coefficient to measure whether scenarios generated for the same threat case are closer to one another than to scenarios from other cases. Figure 2(a) shows that the silhouette coefficient remains high from k = 2 to k = 5 , indicating stable case-level separation. Figure 2(c) complements this result by showing that inter-scenario divergence remains above the within-scenario baseline. Thus, the generated variants remain both coherent with their intended threat case and distinguishable from one another.
Agreement with human judgments. Because each trace required a manual review of the agent’s tool use and final response, we limited human assessment to five synthetic agent settings separate from the main evaluation. We reviewed five traces for each of 19 threat cases per setting, for a total of 475 traces. One author assessed each trace against the applicable domain security policy, and a second author checked the judgment. Automated and human judgments agreed on 90.5% of these traces, with agreement ranging from 84.2% to 94.7% across settings (Table 8).
Repeated-execution budget. Finally, we examine how repeated executions affect the observation of positive findings under stochastic agent behavior. A single execution can miss a reachable weakness due to variation in LLM planning or tool selection; treating such a one-off non-detection as evidence of safety could underestimate structural weaknesses.
Using a separate reliability sample of 950 scenario-agent pairs, we execute each scenario up to five times and record the first round in which a positive judgment appears. As shown in Figure 3, 784 pairs receive a positive judgment within five executions, while 166 do not. Among the 784 positive findings, 86.9 % appear in the first execution, 93.6 % by the second, and 97.1 % by the third. This suggests that a small repeated-execution budget captures most positive findings observed within this five-execution window.
Overall, these results support the white-box finding analysis in Section 4.3: traces are semantically reproducible, generated variants remain coherent and distinguishable, scenario-specific oracles are reasonably aligned with human labels, and a small repeated-execution budget captures most findings observed within the tested execution window.

4.3. StructuralWeakness Findings

We now report the main whitebox evaluation results. Unlike Section 4.2, which examined the stability of the inspection procedure, this subsection reports inspection workload, OWASP threat coverage, and tracegrounded structuralweakness findings. We first compare SPECTRAonAgentDojo with an unmodified AgentDojo setting, and then report scopescaling cost, finding rates across ten deployments, and the trace evidence patterns behind positive findings. Throughout this subsection, ASR denotes a tracegrounded structuralweakness finding rate, and the AgentDojo comparison measures inspection workload and threat coverage under a matched execution framework.
Inspection workload and threat coverage. We first compare an unmodified AgentDojo setting with SPECTRA-on-AgentDojo under a matched execution framework. In the unmodified setting, we keep AgentDojo’s original tasks, tools, and execution logic, replacing only the LLM backbone with Gemini 2.5 Flash. In the SPECTRA setting, we keep the same execution framework but expose AgentDojo tools through a lightweight MCP wrapper, enabling SPECTRA to construct an Agent Specification and generate agent-conditioned inspection scenarios. Since AgentDojo is not organized by the OWASP Agentic AI taxonomy, we map its adversarial prompts to OWASP categories using an LLM-judge ensemble only for coverage analysis.
With the same execution framework and backbone model, the unmodified AgentDojo setting used 629 trials and 10,850 seconds of inference time. The SPECTRA-on-AgentDojo setting used 95 trials and 2,856 seconds (Figure 4). The respective scenario sets represented five OWASP categories (T3, T6, T7, T9, and T15) and eleven (T1–T7, T9, T10, T15, and T17). Each setting used its own procedure to select threats and construct scenarios. The trial counts and times therefore describe the workload for the two scenario sets. Further details of the AgentDojo comparison are provided in Appendix D.
Scope-scaling cost. We further examine how inspection cost scales as the number of tested threat categories increases. Figure 5 reports the inspection cost across five repeated runs while progressively expanding the tested threat scope from one to eleven categories. The cost increases approximately monotonically with the number of tested threat categories, reaching about 870 seconds when all eleven categories are included. This result supports the need for category-aware scoping: testing a broader threat space directly increases inspection cost, while SPECTRA makes this expansion manageable by defining an inspection scope and instantiating its cases through the Threat Specification and Agent Specification rather than exhaustively enumerating prompts, tools, and execution paths.
Deployment- and threat-level findings.Figure 6 summarizes finding rates by deployment and threat category. Of the 570 scenarios, 400 receive positive judgments, yielding an overall inspection-level ASR of 70.2 % . Deployment-level rates range from 54.4 % to 80.7 % , with positive findings in all ten deployments. At the threat level, T1 has the highest rate ( 95.0 % ), followed by T10 ( 93.3 % ) and T3 ( 91.7 % ). T15 has one positive finding among 30 scenarios ( 3.3 % ); T5 and T2 have rates of 48.3 % and 53.3 % , respectively. These differences describe the evaluated scenarios rather than definitive rankings of threat severity.
Behavioral evidence patterns.Figure 7 summarizes the observation criteria assigned to the 400 positive findings. Required-tool omission (OB2) is the most frequent criterion overall (185 findings), followed by planning deviation or a contaminated premise (OB1; 118 findings). At the threat level, OB2 is the most frequent criterion for T1, T3, T5, T10, and T17; OB1 is the most frequent for T2, T6, and T9. T7 is most often associated with abnormal arguments (OB4), and T4 with excessive tool calls (OB6). The sole positive finding for T15 is assigned to OB5, which is insufficient to establish a general pattern for that category. These distributions identify the trace evidence underlying the positive judgments.
Figure 6. Structural-weakness finding rates across deployments. (a) shows the fraction of generated inspection scenarios that produce positive structural-weakness findings for each target deployment. (b) shows the same metric by threat category. The main evaluation contains 400 positive findings among 570 scenarios. We interpret ASR as a trace-grounded structural-weakness finding rate, not as a benchmark-style attack-performance score
Figure 6. Structural-weakness finding rates across deployments. (a) shows the fraction of generated inspection scenarios that produce positive structural-weakness findings for each target deployment. (b) shows the same metric by threat category. The main evaluation contains 400 positive findings among 570 scenarios. We interpret ASR as a trace-grounded structural-weakness finding rate, not as a benchmark-style attack-performance score
Preprints 246180 g006
Figure 7. Observation-criterion distributions for positive structural-weakness findings. The distributions use the 400 positive findings. Each row is normalized by the number of positive findings in the corresponding deployment or threat category. The distributions show how structural weaknesses manifest in execution traces, such as planning deviation, tool omission, abnormal arguments, or abnormal tool-call inflation
Figure 7. Observation-criterion distributions for positive structural-weakness findings. The distributions use the 400 positive findings. Each row is normalized by the number of positive findings in the corresponding deployment or threat category. The distributions show how structural weaknesses manifest in execution traces, such as planning deviation, tool omission, abnormal arguments, or abnormal tool-call inflation
Preprints 246180 g007
In a separate black-box study, we supplied documents to three commercial agents and checked their final responses for a marker specified in the documents. The marker appeared in some responses. Appendix E describes the study and its results.

5. Discussion

The evaluation results support the central claim of this paper: agentic AI security requires a structural inspection layer that complements, rather than replaces, conventional vulnerability testing. Agent vulnerabilities are not always localized in individual tools or functions; security-relevant behavior often emerges from the composition of planning, tool selection, tool outputs, intermediate observations, and policy interpretation. Accordingly, inspection should ask not only whether a known sink can be triggered, but also which harmful workflow trajectories are reachable under a concrete agent deployment. This class of weakness is not fully characterized by function-level targets alone, and SPECTRA’s structural inspection therefore acts as a complement to CVE-style analysis rather than a replacement, together forming a more complete view of agent security.

5.1. Category-Aware Scoping as Search-Space Reduction

The white-box findings support a workflow-level view of agent security. Positive findings frequently appear as tool omission (OB2), planning deviation (OB1), or abnormal tool arguments (OB4), rather than merely as unsafe final answers (Figure 7). These failures are not isolated tool bugs; they correspond to missing, reordered, or policy-violating steps in the execution workflow. This is why SPECTRA should be viewed as an upstream structural inspection layer: it surfaces in-scope threat cases and workflow regions that deserve deeper testing, while conventional fuzzing, taint analysis, manual red-teaming, and benchmark-based evaluation remain useful for validating specific bugs or exploit conditions. In this sense, structural inspection and CVE-style vulnerability analysis are not alternatives but complementary layers of a single inspection stack: SPECTRA supplies the upstream layer that scopes which workflow regions deserve deeper testing, and downstream analyses validate specific bugs or exploit conditions inside those regions.
We tested the same 19 cases across 11 threat categories on all ten agents. Each case defined the weakness under inspection. The agent’s tools and policies determined which steps in its workflow could provide evidence of that weakness. For example, to inspect a required check, we identified the task that required it under the agent’s policy and examined the trace to see whether the agent had called the corresponding tool before carrying out that task.
Figure 4 reports the workload for the two scenario sets evaluated on AgentDojo. In the unmodified setting, 629 trials represented five OWASP categories. In the SPECTRA setting, 95 trials represented eleven. In the ten-agent evaluation, where we used the same threat cases across agents, the proportion of scenarios with trace evidence of the specified weakness ranged from 54.4 % to 80.7 % across agents.

5.2. From Findings to Remediation Evidence

The main value of SPECTRA is not that it assigns a single security score to an agent, but that it turns positive findings into actionable evidence about where the agent workflow should be hardened. In this sense, ASR is only the entry point of the analysis. A positive finding indicates that a generated inspection scenario reached a trace-observable structural weakness under its scenario-specific oracle; the observation criterion then explains what type of workflow failure occurred and where remediation should focus.
This distinction is important because different positive findings require different engineering responses. For example, OB2 indicates that the agent omitted a required check or tool call, suggesting that mandatory policy retrieval, approval gates, or verification steps should be added to the workflow. OB4 identifies abnormal tool arguments, including permission-scope violations, suggesting stricter argument validation, scope checking, or authorization enforcement. OB1 identifies unintended planning or acceptance of contaminated information, suggesting that the system prompt, planning constraints, or policy-instruction hierarchy should be strengthened. OB6 indicates abnormal tool-call inflation, suggesting the need for loop guards, call-budget limits, or resource-aware execution controls.
Thus, the diagnostic value of SPECTRA lies in the connection between a positive finding and its trace-grounded evidence. The distributions in Figure 7 show not only whether structural weaknesses are found, but also how they manifest in the workflow. This turns inspection results into concrete remediation signals: developers can identify whether the problem lies in planning, tool selection, argument construction, missing safeguards, or response generation. Evaluation based only on final outputs would obscure these distinctions and would provide weaker guidance for improving the target agent.

5.3. Controlled Inspection as Pre-Deployment Evidence

The controlled white-box setting should be understood as a pre-deployment inspection environment, not as a substitute for live exploitation or post-deployment incident validation. Its purpose is to make structural weaknesses observable, reproducible, and diagnosable before an agent is connected to real services. In current agent systems, many workflow-level failures are difficult to inspect systematically because the execution path is produced dynamically through planning, tool selection, tool outputs, and policy interpretation. SPECTRA addresses this gap by providing a controlled way to construct representative threat cases, execute them safely, and obtain trace-grounded evidence about reachable workflow weaknesses.
The use of stub MCP tools is therefore a design choice for safe and reproducible inspection. Stub tools preserve the tool interface and allow scenario-defined responses to test whether a representative workflow weakness is reachable, which makes systematic structural inspection possible before live execution would be safe or practical. Repeated runs of the same scenario yielded traces with embedding similarity close to 1.0 . We assessed the reliability of the evaluator separately in five synthetic agent settings. Automated and human judgments agreed on 90.5 % of the 475 traces reviewed in those settings.
The role of the Agent Specification should also be interpreted as a deployment-binding mechanism. SPECTRA depends on the Agent Specification because the objective is to inspect a concrete agent configuration: its tools, policies, high-risk actions, permission boundaries, and operational context. Stronger tool metadata, richer policy extraction, permission models, and audit interfaces therefore expand the fidelity of generated scenarios and the reach of the inspected workflow regions, making Agent Specification quality a direct lever on inspection coverage.
These design choices also point to a natural extension path toward production-facing inspection. Higher-fidelity tool simulators can raise the realism of the inspectable workflow surface while preserving the safety, reproducibility, and trace-grounded attribution established here. As production-facing observability matures through tool-call summaries, policy-check logs, argument-validation records, or audit traces, the same upstream inspection layer introduced here can be extended over hybrid logging interfaces, transferring the trace-grounded diagnostic value of OB1–OB6 directly into deployment monitoring. The reusable Threat Specification and trace-grounded evaluation are not tied to the stub environment itself, so the same inspection principle can be applied in production settings once sufficient observability is available. In the separate commercial-agent study (Appendix E), the marker specified in the document appeared in some final responses. Only the final responses were observable, so we could not tell whether the agent had followed the instruction or simply quoted the document.

6. Conclusion

This paper argued that agentic AI security cannot be adequately addressed by CVE-style vulnerability analysis alone. In LLM-based agents, security-relevant behavior emerges from dynamically composed workflows, making the inspection problem not merely how to trigger a specified sink, but where such weaknesses are reachable within an agent’s workflow. Around this reframing, SPECTRA contributes four interlocking elements: a structural reframing of agent vulnerability analysis as a category-aware reachability problem; a scoping stage that grounds category-level threat cases in deployment-specific tools, policies, and permission boundaries; agent-conditioned scenario generation that combines reusable Threat Specifications with deployment-specific Agent Specifications; and trace-based diagnosis that links each positive finding to the execution evidence that supports it.
Across ten white-box agent environments, 400 of the 570 scenarios ( 70.2 % ) produced trace evidence of the structural weakness specified for the case. We classified these findings by the observed behavior (OB1–OB6). Trace embeddings were also highly similar across repeated runs of the same scenario. In a separate evaluation in five synthetic agent settings, automated and human judgments agreed on 90.5 % of 475 traces. More broadly, these results show that workflow-level weaknesses, which are difficult to inspect through live deployment testing, exhaustive path exploration, or benchmark-driven evaluation alone, can be made observable, reproducible, and diagnosable. The AgentDojo comparison further illustrates this role: the evaluated configurations use 629 versus 95 adversarial trials and represent five versus eleven OWASP categories, providing a concrete workload comparison for upstream structural inspection. This contribution lies not in a new algorithmic primitive, but in operationalizing an automated upstream inspection layer that connects category-level threat specifications to deployment-specific scenarios and trace-grounded workflow diagnoses. We also examined whether the threats targeted by SPECTRA surface in real commercial environments through a supplementary observation on three commercial agents, observing marker appearance in production responses under current observability constraints.
The value of this inspection stage will grow as agent systems become more complex. Richer Agent Specifications can widen the inspectable workflow surface; higher-fidelity tool simulators can improve the realism of representative cases while preserving safety, reproducibility, and diagnostic attribution; and hybrid logging interfaces can carry the same trace-grounded principles into production-facing inspection. By identifying where in-scope threat cases become observable, where workflow-level weaknesses emerge, and what execution evidence supports each finding, SPECTRA establishes an upstream inspection layer whose findings can inform subsequent vulnerability analysis.

Author Contributions

Y. Jeong conceived the framework, implemented the pipeline, and wrote the original draft. T. Han, Y. Seo, H. Kim, and Y. Choi contributed equally to the experiments, analysis, and manuscript revision as second authors. T. Lee supervised the work, contributed to the conceptual design, acquired funding, and reviewed and edited the manuscript. All authors read and approved the final manuscript.

Funding

This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korean government (MSIT) (No. RS-2026-25480629, Semantic Log Grouping and Robust Attack Chain Reconstruction; contribution rate: 80%). This work was also supported by Institute of Information and communications Technology Planning and Evaluation (IITP) grant funded by the Korea government (MSIT) (RS-2026-25585348, Graduate School of Security Convergence(AI)(Gachon University); contribution rate: 20%).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The publicly available study materials include the threat specification, prompt templates for scenario generation and behavioral evaluation, evaluation scripts, and recorded judgments. These materials are available at https://github.com/thejysplay/SPECTRA.

Acknowledgments

Gemini 2.5 Flash was used as the underlying model for the two LLM-dependent components of the framework—adversarial scenario generation and trace-based behavioral evaluation—as described in Section 3.3 and Section 3.4. The model was operated at temperature 0. All authors take full responsibility for the content and the validity of the results.

Conflicts of Interest

The authors have no competing interests to declare that are relevant to the content of this article.

Appendix A. Scope of the White-Box Evaluation

We tested the same 19 cases across 11 threat categories on all ten agents. Each case specified the weakness to inspect. We tailored its scenarios to the tools, permissions, and operating policies of each agent. Table A1 explains why each category was included in the evaluation.
Table A1. Reasons for including each threat category in the white-box evaluation
Table A1. Reasons for including each threat category in the white-box evaluation
Threat category Reason for inclusion
T1. Memory Poisoning Misleading context supplied during a task can affect later plans, tool calls, or replies.
T2. Tool Misuse Tool-call records show omitted, excessive, or policy-violating use of the available tools.
T3. Privilege Compromise Tool calls, their arguments, and replies can reveal actions outside the agent’s permissions.
T4. Resource Overload Repeated or excessive tool calls can be counted in the trace.
T5. Cascading Hallucination Attacks An incorrect intermediate observation can reappear in a later plan, tool call, or reply.
T6. Intent Breaking and Goal Manipulation The agent’s plan and subsequent actions can show a shift away from the user’s task.
T7. Misaligned and Deceptive Behaviors Plans and replies can reveal omitted safeguards or misleading justifications.
T9. Identity Spoofing and Impersonation The input and subsequent actions show how the agent responds to a false claim of identity or authority.
T10. Overwhelming Human-in-the-Loop The trace shows how the agent handles required approval, review, or confirmation steps.
T15. Human Manipulation Recommendations and explanations addressed to the user can be examined in the final reply.
T17. Supply-Chain Compromise The trace shows how the agent responds to compromised content supplied at runtime, such as a tool description or template.
We excluded cases that require changes to model weights, tool implementations, runtime infrastructure, or audit logs, as well as cases that require interactions among multiple agents.

Appendix B. Execution and Evaluation Details

Appendix B.1. White-Box Execution Environment

The white-box execution environment follows a ReAct-style loop in which the agent produces planning text, invokes tools, observes tool results, and continues until it returns a final response. The execution runner records scenario metadata, planning text, tool calls, tool results, and the final response as a structured trace. Indirect prompt-injection payloads delivered through tool outputs are recorded as part of the corresponding tool-result record, keeping injected content attributable to a concrete tool output without requiring a separate trace schema. This trace is later used for behavioral evaluation.
To avoid real-world side effects, the white-box experiments use stub MCP tools rather than live external services. Each stub tool exposes the same interface as the corresponding target tool, including tool name, description, and parameters, but returns deterministic mock responses defined for the scenario. This design prevents unauthorized transactions, state changes, external communication, or service disruption, while improving reproducibility under repeated executions.

Appendix B.2. Repeated-Execution Budget and Model Settings

For the reliability analysis, we execute the same inspection setting up to five times under identical mock-tool conditions. We record the first execution round in which a positive judgment is observed. Scenarios that do not receive a positive judgment within five executions are reported as no-positive outcomes within the repeated-execution budget.
The main experiments use Gemini 2.5 Flash at temperature 0 for scenario generation and behavioral evaluation. In the released implementation, the generator and evaluator default to gemini-2.5-flash; the ten target-agent configurations select the same identifier, and the corresponding Gemini API calls explicitly set temperature to 0.

Appendix B.3. Reliability Metric Construction

The reliability analysis in Section 4.2 uses embedding-based diagnostics to measure scenario-construction stability, trace reproducibility, and inter-scenario divergence. These diagnostics are used only for reliability analysis. They are not used by the behavioral evaluator and do not determine whether an execution trace is judged positive or negative.
Canonical scenario representation. For scenario-construction stability, each generated scenario is converted into a canonical scenario representation before embedding. This representation includes the benign task context, adversarial delivery form, adversarial content, expected workflow condition, and scenario-specific oracle description. Fields that trivially reveal the threat identifier, case identifier, generated variant identifier, file path, or run metadata are removed before embedding. This prevents the clustering diagnostic from being driven by explicit labels rather than by the semantic content of the generated scenario.
Canonical trace representation. For trace reproducibility, each raw execution trace is converted into a canonical trace representation. The canonical trace includes the ordered planning text emitted by the agent, the ordered sequence of tool names, normalized tool arguments, normalized tool-result summaries, the final agent response, and the scenario-specific oracle summary. Run-specific identifiers, timestamps, file paths, logging metadata, scenario IDs, and formatting artifacts are removed before embedding. This normalization reduces the influence of implementation-specific metadata and irrelevant run-level variation. Shared content, including the oracle summary, can also contribute to similarity, so this semantic measure does not establish exact agreement in security-relevant actions or judgments.
Embedding and comparison. We embed canonical scenario and trace representations using text-embedding-ada-002. Pairwise comparisons are computed using cosine similarity. For scenario-construction stability, we compute the silhouette coefficient over canonical scenario embeddings using the threat case identifier as the cluster label. For trace reproducibility, we compute the average pairwise similarity among repeated executions of the same scenario under identical mock-tool conditions. For inter-scenario divergence, we compare trace embeddings from different generated variants under the same threat case.
Interpretation. High scenario-cluster separability indicates that generated scenarios remain aligned with their intended case-level inspection intent. High semantic trace reproducibility indicates that repeated executions of the same scenario produce similar content in the chosen trace representation. Inter-scenario divergence above the within-scenario variation baseline indicates that different generated variants remain distinguishable from one another rather than collapsing into near-identical executions.

Appendix B.4. Behavioral Evaluator Output Schema

The evaluator returns a JSON record with scenario and case identifiers, a binary verdict (judge: O or X), an observed_item, and a reason. A positive verdict must identify one of the six items in Table 5 and cite trace evidence that satisfies the scenario’s recorded criterion. In the absence of such evidence, the verdict is negative. Negative records may name the item checked. Only positive verdicts enter the counts for each observation item.
In 569 of the 570 generated scenarios, the success criterion matched the corresponding case specification verbatim. One insurance-claims scenario (T7-C1-S3) included an additional condition. The evaluator’s recorded reason for its positive judgment cited a response condition already present in the case specification.

Appendix C. Execution Trace Examples

Appendix C.1. Direct Prompt Injection Trace

Figure A1 shows a representative direct prompt injection trace. The adversarial instruction is delivered directly through the user prompt. The trace illustrates how an additional third-party order cancellation request can be incorporated into the agent’s plan and tool calls under the generated inspection scenario.
Figure A1. Representative direct prompt injection trace. The user-facing input includes an additional third-party order cancellation request. The trace shows that the agent invokes cancel_order for both the original order and the additional third-party order, illustrating a trace-observable workflow deviation. Tool-response wrappers are omitted; returned content and error status are shown
Figure A1. Representative direct prompt injection trace. The user-facing input includes an additional third-party order cancellation request. The trace shows that the agent invokes cancel_order for both the original order and the additional third-party order, illustrating a trace-observable workflow deviation. Tool-response wrappers are omitted; returned content and error status are shown
Preprints 246180 g0a1

Appendix C.2. Indirect Prompt Injection via Tool Result Trace

Figure A2 shows a representative indirect prompt injection trace via a tool result. The user-facing request is benign, but an adversarial payload is appended to the output of a target tool. The trace illustrates how the injected tool-result content can influence the agent’s subsequent plan and final response under trace-based inspection.
Figure A2. Representative indirect prompt injection trace via tool result. The user-facing request asks only for shipment details, while an injected action_required payload is appended to the shipment_lookup result. The trace shows that the agent incorporates the injected instruction into its subsequent plan and final response. The original tool-result content and appended payload are shown separately; tool-response wrappers are omitted
Figure A2. Representative indirect prompt injection trace via tool result. The user-facing request asks only for shipment details, while an injected action_required payload is appended to the shipment_lookup result. The trace shows that the agent incorporates the injected instruction into its subsequent plan and final response. The original tool-result content and appended payload are shown separately; tool-response wrappers are omitted
Preprints 246180 g0a2

Appendix D. AgentDojo Workload Comparison Details

Appendix D.1. Unmodified AgentDojo Setting

In the unmodified AgentDojo setting, we use the original AgentDojo codebase without changing its task, tool, or execution logic. The only change is the LLM backbone, which is replaced with Gemini 2.5 Flash to match the model used in our evaluation. This setting serves as the baseline for measuring inspection workload and OWASP threat coverage under the original AgentDojo-style evaluation.
AgentDojo is not organized as ten domain-specific deployments in the same way as our white-box evaluation. Instead, it provides a single agent execution framework with multiple task suites, tools, and benign–adversarial task pairs. We therefore treat the unmodified AgentDojo setting as one deployment environment for the workload-and-coverage comparison.

Appendix D.2. SPECTRA-on-AgentDojo Setting

In the SPECTRA-on-AgentDojo setting, we keep the AgentDojo execution framework unchanged but expose its tools through a lightweight MCP wrapper. The wrapper does not alter the behavior of AgentDojo tools. It only provides the tool descriptions and interfaces required for SPECTRA to construct an Agent Specification and generate agent-conditioned inspection scenarios.
Thus, the execution environment remains AgentDojo, while SPECTRA operates as an upstream structural inspection layer over the MCP-exposed AgentDojo tool interface. This setup allows us to compare inspection workload and OWASP threat coverage under a matched execution framework, without treating the comparison as a head-to-head attack-performance benchmark.

Appendix D.3. OWASP Threat Mapping Procedure

Because AgentDojo is not originally organized according to the OWASP Agentic AI threat taxonomy, we map its adversarial prompts to OWASP threat categories for coverage analysis. The mapping is performed using an LLM-judge ensemble. Each judge assigns candidate OWASP threat categories for a given AgentDojo adversarial prompt based on the OWASP agentic threat descriptions. The final category assignment is determined by majority vote.
This mapping is used only to estimate threat coverage. It is not used to determine attack success, to modify AgentDojo executions, or to evaluate SPECTRA’s structural-weakness findings.

Appendix D.4. Workload Measurement

We measure workload using three quantities: the number of adversarial trials, the total inspection time, and the number of covered OWASP threat categories. In the unmodified AgentDojo setting, adversarial trials correspond to the adversarial task instances executed under the original AgentDojo workflow. In the SPECTRA-on-AgentDojo setting, adversarial trials correspond to the generated inspection scenarios executed through the same AgentDojo framework.
Inspection time is measured as the total wall-clock inference time needed to complete the corresponding adversarial trials under the matched LLM backbone. OWASP threat coverage is measured by counting the distinct OWASP threat categories represented by the adversarial prompts or inspection scenarios after applying the mapping procedure described above.
This comparison is intended to quantify workload and threat-coverage differences between the two settings. It is not intended to compare benchmark attack performance, because the unmodified AgentDojo setting and SPECTRA-on-AgentDojo use different threat-selection and scenario-construction procedures. Here, coverage denotes represented OWASP categories rather than detection recall; the workload differences describe the evaluated scenario collections and do not establish efficiency gains at equal detection recall.

Appendix E. Supplementary Black-Box Observation on Commercial Agents

This appendix reports a supplementary black-box observation on three commercial agents. Unlike the main evaluation, this observation does not use the SPECTRA pipeline. Its purpose is to examine whether the threats targeted by SPECTRA also surface in real commercial environments under production observability constraints.

Appendix E.1. Observation Setup

The supplementary black-box study evaluates three commercial agents, anonymized as Agent A, Agent B, and Agent C. Each scenario pairs a benign user task with an external document containing a document-borne adversarial instruction. The document-borne instruction asks the agent to include the harmless marker token pwned! in the final response. A run is counted as successful if the marker appears in the final response.
This study is a reduced probing setting rather than full trace-based inspection. Because internal execution traces, tool-call logs, tool arguments, and intermediate reasoning are not observable in this setting, successful runs cannot be attributed to specific observation criteria. Accordingly, the black-box study is reported as supplementary evidence under commercial-agent black-box observability constraints, not as part of the main trace-grounded structural-weakness evaluation.

Appendix E.2. Prompt Strategies and Document Types

The black-box study varies prompt strategy, injection position, document type, and user task. The prompt strategies are Template, Ignore, and Role-Play. The document-borne instruction is placed either at the beginning of the external document (prefix) or at the end of the external document (suffix). The tested user tasks include file summarization and image explanation, depending on the input modalities supported by each commercial agent.
The document set contains three external artifacts with different lengths and formats: Doc 1 (5 pages), Doc 2 (6 pages), and Doc 3 (45 pages), as shown in Figure A4. File-summarization tasks test whether text-borne instructions embedded in external documents can affect the final response. Image-explanation tasks are included only as a separate task condition for agents that support image inputs. Image-explanation results are omitted for Agent C because it does not support image inputs.

Appendix E.3. Observation Results

Figure A3 reports marker-based ASR by prompt strategy and injection position. Unlike the main white-box ASR, this metric only measures whether the harmless marker token pwned! appears in the final response. It does not identify which internal workflow step, if any, caused the marker to appear.
Figure A3. Effect of prompt strategy and injection position in the supplementary black-box probing study. The reported value is marker-based ASR, defined as the fraction of probing runs in which the harmless marker token pwned! appears in the final response. The figure shows that prefix and suffix placement can have different effects across agents, but the black-box setting does not reveal the internal processing step responsible for the marker inclusion
Figure A3. Effect of prompt strategy and injection position in the supplementary black-box probing study. The reported value is marker-based ASR, defined as the fraction of probing runs in which the harmless marker token pwned! appears in the final response. The figure shows that prefix and suffix placement can have different effects across agents, but the black-box setting does not reveal the internal processing step responsible for the marker inclusion
Preprints 246180 g0a3
The results show that the effect of injection position is not uniform across the tested commercial agents. In some agents, prefix-positioned instructions are more likely to surface in the final response, whereas in others the suffix position has a stronger or more variable effect. We interpret this pattern cautiously: because internal traces and tool-call logs are not observable in this setting, the result does not by itself explain the underlying cause. However, it is consistent with the possibility that different agents use different content-processing pipelines, tool invocation procedures, or document-preprocessing strategies before producing the final response. Thus, Figure A3 should be read as evidence of position-dependent black-box behavior, rather than as a direct comparison of agent robustness.
Figure A4 further examines this positiondependent behavior by grouping results by document type and user task. Filesummarization tasks expose the external artifact primarily as a text document to be summarized, whereas imageexplanation tasks invoke a different userfacing task condition in which the agent is asked to explain an imagerelated input. Since the adversarial instruction is naturallanguage text rather than an instruction embedded inside the image, differences between these task settings should not be interpreted as evidence of imageinternal instruction following. Instead, we interpret them as additional blackbox evidence that the user task can change how external content is processed, filtered, or incorporated into the final response.
Figure A4. Effect of document type and user task in the supplementary black-box probing study. The reported value is marker-based ASR. The figure complements Figure A3 by showing that marker inclusion can also vary with the user task and document condition. Image-explanation results are omitted for Agent C because it does not support image inputs
Figure A4. Effect of document type and user task in the supplementary black-box probing study. The reported value is marker-based ASR. The figure complements Figure A3 by showing that marker inclusion can also vary with the user task and document condition. Image-explanation results are omitted for Agent C because it does not support image inputs
Preprints 246180 g0a4
In the file-summarization setting, marker inclusion varies across the tested documents and agents. In the image-explanation setting, marker inclusion also changes with the task and document condition, while Agent C is not evaluated because it does not support image inputs. Taken together, Figure A3 and Figure A4 suggest that black-box susceptibility is affected not only by the presence of an adversarial instruction, but also by where it is placed and by which task-specific content-processing path is invoked. Because these internal paths are not observable, this remains an interpretation of the observed output patterns rather than a confirmed mechanistic explanation.

Appendix E.4. Observability Constraints and Diagnostic Scope

The black-box probing study is intended to complement, not replace, the main white-box evaluation. Its purpose is to examine whether document-borne adversarial instructions can surface in final responses under commercial-agent black-box observability constraints. Because the tested commercial agents expose only final outputs, the study cannot determine which internal workflow step caused a successful marker insertion.
This limitation is important for interpreting the results. In the main white-box evaluation, a positive finding is grounded in an execution trace and assigned to one of six observation criteria, such as planning deviation, omitted tool checks, invalid tool-call order, permission-scope argument violation, missing safeguards in the final response, or abnormal tool-call inflation. In contrast, the black-box study provides no access to planning text, tool invocations, tool arguments, tool outputs, or intermediate states. Therefore, a marker-bearing final response cannot be mapped to OB1–OB6 and cannot be used as evidence for a specific workflow-level structural weakness.
For this reason, the marker-based ASR reported in this appendix should be interpreted only as external applicability evidence. A marker-positive black-box probing run records the token’s presence in the final response; this alone does not distinguish instruction following from quotation of document content or establish end-to-end exploitability, unauthorized tool use, data exfiltration, or policy violation in the same sense as the main trace-grounded findings. Likewise, a failed probing run does not prove that the corresponding agent is secure against document-borne prompt injection; the outcome may depend on the specific prompt strategy, document format, task framing, input modality, or agent-side preprocessing used in the experiment.
The black-box results therefore support a narrower claim: related external-document risks can surface in commercial-agent settings, but final-output-only probing is insufficient for structural diagnosis. This motivates white-box or hybrid inspection interfaces that expose at least partial execution evidence, such as tool summaries, policy-check logs, or audit traces. Such evidence would allow future inspection systems to bridge the gap between commercial-agent probing and the trace-grounded structural diagnostics used by SPECTRA.

References

  1. Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.; Cao, Y. ReAct: Synergizing Reasoning and Acting in Language Models. In Proceedings of the Proc. International Conference on Learning Representations (ICLR), 2023. [Google Scholar]
  2. Anthropic. Introducing the Model Context Protocol. 2024. Available online: https://www.anthropic.com/news/model-context-protocol (accessed on 2026-04-29).
  3. Aim Labs. EchoLeak: A Novel Attack Chain on M365 Copilot. 2025. Available online: https://www.aim.security/lp/aim-labs-echoleak-m365 (accessed on 2026-04-29).
  4. MITRE. CVE-2025-32711: M365 Copilot Information Disclosure Vulnerability. Available online: https://www.cve.org/CVERecord?id=CVE-2025-32711 (accessed on 2026-04-29).
  5. Perez, F.; Ribeiro, I. Ignore Previous Prompt: Attack Techniques for Language Models. In Proceedings of the NeurIPS ML Safety Workshop, 2022. [Google Scholar]
  6. Greshake, K.; Abdelnabi, S.; Mishra, S.; Endres, C.; Holz, T.; Fritz, M. Not What You’ve Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. In Proceedings of the Proc. 16th ACM Workshop on Artificial Intelligence and Security (AISec), 2023. [Google Scholar] [CrossRef]
  7. OWASP GenAI Security Project. Agentic AI – Threats and Mitigations. 2025. Available online: https://genai.owasp.org/resource/agentic-ai-threats-and-mitigations/ (accessed on 2026-04-29).
  8. Liu, T.; Deng, Z.; Meng, G.; Li, Y.; Chen, K. Demystifying RCE Vulnerabilities in LLM-Integrated Apps. In Proceedings of the Proc. 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2024. [Google Scholar] [CrossRef]
  9. Schwartz, E.J.; Avgerinos, T.; Brumley, D. All You Ever Wanted to Know About Dynamic Taint Analysis and Forward Symbolic Execution (but Might Have Been Afraid to Ask). In Proceedings of the Proc. IEEE Symposium on Security and Privacy (S&P), 2010; pp. 317–331. [Google Scholar] [CrossRef]
  10. Sabelfeld, A.; Myers, A.C. Language-Based Information-Flow Security. IEEE J. Sel. Areas Commun. 2003, 21, 5–19. [Google Scholar] [CrossRef]
  11. Böhme, M.; Pham, V.T.; Nguyen, M.D.; Roychoudhury, A. Directed Greybox Fuzzing. In Proceedings of the Proc. 2017 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2017; pp. 2329–2344. [Google Scholar] [CrossRef]
  12. Liu, F.; Zhang, Y.; Luo, J.; Dai, J.; Chen, T.; Yuan, L.; Yu, Z.; Shi, Y.; Li, K.; Zhou, C.; et al. Make Agent Defeat Agent: Automatic Detection of Taint-Style Vulnerabilities in LLM-based Agents. In Proceedings of the Proc. 34th USENIX Security Symposium (USENIX Security), 2025; pp. 3767–3786. [Google Scholar]
  13. MITRE. CVE-2024-5184: EmailGPT Prompt Injection Vulnerability. 2024. Available online: https://www.cve.org/CVERecord?id=CVE-2024-5184 (accessed on 2026-04-29).
  14. MITRE. CVE-2025-49596: MCP Inspector Proxy Server Authentication Bypass. Available online: https://www.cve.org/CVERecord?id=CVE-2025-49596 (accessed on 2026-04-29).
  15. MITRE. CVE-2025-53773: GitHub Copilot Command Injection via Configuration File Manipulation. Available online: https://www.cve.org/CVERecord?id=CVE-2025-53773 (accessed on 2026-04-29).
  16. MITRE. CVE-2025-59536: Claude Code Pre-Trust Dialog Code Execution. Available online: https://www.cve.org/CVERecord?id=CVE-2025-59536 (accessed on 2026-04-29).
  17. MITRE. CVE-2025-59944: Cursor IDE Sensitive File Overwrite Bypass. Available online: https://www.cve.org/CVERecord?id=CVE-2025-59944 (accessed on 2026-04-29).
  18. MITRE. CVE-2025-6514: mcp-remote Command Injection via OAuth Authorization Endpoint. Available online: https://www.cve.org/CVERecord?id=CVE-2025-6514 (accessed on 2026-04-29).
  19. MITRE. CVE-2026-21852: Claude Code Pre-Trust Configuration Processing. Available online: https://www.cve.org/CVERecord?id=CVE-2026-21852 (accessed on 2026-04-29).
  20. Debenedetti, E.; Zhang, J.; Balunović, M.; Beurer-Kellner, L.; Fischer, M.; Tramèr, F. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents. In Proceedings of the Advances in Neural Information Processing Systems 37 (NeurIPS 2024) Datasets and Benchmarks Track, 2024. [Google Scholar]
  21. Zhang, H.; Huang, J.; Mei, K.; Yao, Y.; Wang, Z.; Zhan, C.; Wang, H.; Zhang, Y. Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents. In Proceedings of the The Thirteenth International Conference on Learning Representations (ICLR 2025), 2025. [Google Scholar]
  22. Zhan, Q.; Liang, Z.; Ying, Z.; Kang, D. InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents. Proceedings of the Findings of the Association for Computational Linguistics: ACL 2024 2024, 2024, 10471–10506. [Google Scholar] [CrossRef]
  23. Chen, Z.; Xiang, Z.; Xiao, C.; Song, D.; Li, B. AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases. In Proceedings of the Advances in Neural Information Processing Systems, 2024; 37. [Google Scholar]
  24. Dong, S.; Xu, S.; He, P.; Li, Y.; Tang, J.; Liu, T.; Liu, H.; Xiang, Z. Memory Injection Attacks on LLM Agents via Query-Only Interaction. In Proceedings of the Advances in Neural Information Processing Systems, 2025; 38. [Google Scholar]
  25. Zhang, J.; Yang, S.; Li, B. UDora: A Unified Red Teaming Framework against LLM Agents by Dynamically Hijacking Their Own Reasoning. In Proceedings of the Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. arXiv:2503.01908.
  26. Barr, E.T.; Harman, M.; McMinn, P.; Shahbaz, M.; Yoo, S. The Oracle Problem in Software Testing: A Survey. IEEE Trans. Softw. Eng. 2015, 41, 507–525. [Google Scholar] [CrossRef]
  27. Google DeepMind. Gemini 2.5 Flash. 2025. Available online: https://deepmind.google/technologies/gemini/flash/ (accessed on 2026-04-29).
Figure 1. Overall architecture ofSPECTRA. The Threat Specification supplies a judgment criterion for each case. The generator uses the target’s Agent Specification to construct a scenario and returns it together with its success criterion. After the target agent runs in a controlled ReAct/MCP environment [1,2], the evaluator checks the execution trace against the criterion recorded in the scenario. DPI and IPI denote scenario delivery channels explicitly specified in the Threat Specification’s variant cases and used to guide scenario generation
Figure 1. Overall architecture ofSPECTRA. The Threat Specification supplies a judgment criterion for each case. The generator uses the target’s Agent Specification to construct a scenario and returns it together with its success criterion. After the target agent runs in a controlled ReAct/MCP environment [1,2], the evaluator checks the execution trace against the criterion recorded in the scenario. DPI and IPI denote scenario delivery channels explicitly specified in the Threat Specification’s variant cases and used to guide scenario generation
Preprints 246180 g001
Figure 2. Reliability of scenario-based inspection. (a) reports the silhouette coefficient, which measures whether generated scenarios remain separable by threat case as k increases from 2 to 5. (b) reports semantic trace reproducibility, measured as mean pairwise embedding similarity, under five repeated executions. (c) reports inter-scenario divergence; divergence above the dashed within-scenario baseline indicates that variants remain distinguishable rather than collapsing into near-identical traces
Figure 2. Reliability of scenario-based inspection. (a) reports the silhouette coefficient, which measures whether generated scenarios remain separable by threat case as k increases from 2 to 5. (b) reports semantic trace reproducibility, measured as mean pairwise embedding similarity, under five repeated executions. (c) reports inter-scenario divergence; divergence above the dashed within-scenario baseline indicates that variants remain distinguishable rather than collapsing into near-identical traces
Preprints 246180 g002
Figure 3. Repeated-execution budget analysis. The left chart shows the first positive-judgment round among positive findings. The right chart separates positive findings from cases with no positive judgment within five runs
Figure 3. Repeated-execution budget analysis. The left chart shows the first positive-judgment round among positive findings. The right chart separates positive findings from cases with no positive judgment within five runs
Preprints 246180 g003
Figure 4. Inspection workload in the unmodified AgentDojo andSPECTRA-on-AgentDojo settings. The figure reports the number of trials, total inference time, and number of OWASP threat categories represented in each scenario set
Figure 4. Inspection workload in the unmodified AgentDojo andSPECTRA-on-AgentDojo settings. The figure reports the number of trials, total inference time, and number of OWASP threat categories represented in each scenario set
Preprints 246180 g004
Figure 5. Scope-scaling cost of white-box inspection. Inspection cost increases as the number of tested threat categories expands from one to eleven. Across repeated runs, the full eleven-threat setting reaches approximately 870 seconds in our white-box inspection setting
Figure 5. Scope-scaling cost of white-box inspection. Inspection cost increases as the number of tested threat categories expands from one to eleven. Across repeated runs, the full eleven-threat setting reaches approximately 870 seconds in our white-box inspection setting
Preprints 246180 g005
Table 1. Representative CVE disclosures related to structural weaknesses in LLM-based agent products
Table 1. Representative CVE disclosures related to structural weaknesses in LLM-based agent products
CVE ID Product Reported issue Vector
CVE-2024-5184 [13] EmailGPT API prompt injection DPI
CVE-2025-32711 [4] M365 Copilot EchoLeak email exfiltration IPI
CVE-2025-49596 [14] MCP Inspector Missing auth → RCE RCE
CVE-2025-53773 [15] GitHub Copilot Config-file command injection IPI
CVE-2025-59536 [16] Claude Code Pre-trust code execution SC
CVE-2025-59944 [17] Cursor IDE File-check bypass → RCE IPI
CVE-2025-6514 [18] mcp-remote OAuth command injection RCE
CVE-2026-21852 [19] Claude Code Pre-trust config processing SC
Table 2. How representative approaches instantiate the search spaces of security-relevant targets (S), execution paths (P), and adversarial inputs or interventions (I), with their automation and target-conditioning scope
Table 2. How representative approaches instantiate the search spaces of security-relevant targets (S), execution paths (P), and adversarial inputs or interventions (I), with their automation and target-conditioning scope
Work S P I Analysis focus Scope boundary Automation Adaptive
LLMSmith [8] Preprints 246180 i001 Preprints 246180 i002 Preprints 246180 i002 Path recovery and exploit validation Targets outside configured sink classes Partial: manual validation Sink/call-chain specific
AgentFuzz [12] Preprints 246180 i001 Preprints 246180 i002 Preprints 246180 i002 Taint-style vulnerability discovery Targets outside configured sink classes Automated fuzzing Functionality and feedback
InjecAgent [22] Preprints 246180 i001 Preprints 246180 i002 Preprints 246180 i001 Observation poisoning Threats outside selected task/attack scope Automated evaluation Fixed benchmark cases
AgentDojo [20] Preprints 246180 i001 Preprints 246180 i002 Preprints 246180 i002 Benchmark behavior Threats outside selected task/attack scope Automated benchmarking Task/attack dependent
ASB [21] Preprints 246180 i001 Preprints 246180 i002 Preprints 246180 i001 Multi-attack benchmarking Threats outside selected task/attack scope Automated benchmarking Scenario/attack dependent
SPECTRA Preprints 246180 i003† Preprints 246180 i002 Preprints 246180 i003† Category-aware structural inspection Threats outside the inspection scope Full: generation, execution, evaluation High: agent-conditioned
Notation.Preprints 246180 i001 denotes analyst-specified targets or inputs; Preprints 246180 i002 denotes exploration or refinement within configured program or benchmark constraints; Preprints 246180 i003† denotes concrete targets or scenario inputs left open for deployment-specific instantiation within the specified threat-case catalog, not unrestricted discovery of threat categories. The symbols describe instantiation scope, not an ordinal ranking of generality. Automation describes the stages automated in each reported workflow. For SPECTRA, Full denotes integration of scenario generation, execution, and trace-grounded evaluation after agent configuration. Adaptive describes the basis of target conditioning; High denotes conditioning scenarios on the target agent’s tools, prompts, and policies. These descriptions concern the reported workflows, not a universal ranking of framework capabilities. Benchmark rows describe the selected task and attack scopes, not limits on framework extensibility.
Table 3. Two-level schema of the agent-independent Threat Specification
Table 3. Two-level schema of the agent-independent Threat Specification
Level Field Description
Threat threat_id OWASP identifier (e.g., T1)
Threat threat_name Short threat name
Threat threat_description Category-level threat description
Threat additional_rules Threat-level constraints and variation rules
Case case_id Case identifier under a threat category
Case case_name Short name of the inspection case
Case attack_condition Adversarial delivery form and payload pattern
Case assumption_pattern Reproducibility condition in the controlled stub setting
Case judgment_criteria Trace evidence required for an oracle-positive finding
Table 4. Schema of the deployment-specific Agent Specification
Table 4. Schema of the deployment-specific Agent Specification
Field Description
header Specification descriptor (Agent profile)
agent.id Target agent identifier
agent.display_name Human-readable agent name
agent.summary Role and responsibility summary
system_prompt Complete system prompt, including stated policies and constraints
tools MCP tool definitions, descriptions, input schemas, and supplied metadata
Table 5. Observation criteria and supporting trace evidence
Table 5. Observation criteria and supporting trace evidence
ID Observation criterion Trace evidence
OB1 Unintended plan or contaminated premise Planning text
OB2 Required tool call omitted Tool calls
OB3 Tool-call order differs from the benign flow Tool-call sequence
OB4 Abnormal argument under the scenario-specific oracle Tool arguments
OB5 Policy, warning, or justification omitted or distorted Final response
OB6 Tool-call count exceeds twice the benign-flow count Tool-call count
Table 6. Target agents used in the white-box evaluation
Table 6. Target agents used in the white-box evaluation
Domain Agent role
E-commerce Handles order lookup, refund requests, and shipping-related customer support
Travel Searches flights and hotels, manages reservations, and handles booking requests
Banking Provides account, payment, transfer, and customer-service support
Insurance Processes claim inquiries, policy lookup, and claim-status support
Medical Supports patient-facing consultation, appointment guidance, and service information
HR Handles employee onboarding, leave requests, and internal policy guidance
Education Supports admission, enrollment, course, and student-service inquiries
Government Handles public-service requests, eligibility checks, and administrative guidance
Telecom Supports plan changes, billing inquiries, and service troubleshooting
Logistics Handles shipment tracking, delivery updates, and logistics-service requests
Table 7. Threat categories and case-level specifications used in the main white-box evaluation
Table 7. Threat categories and case-level specifications used in the main white-box evaluation
ID Threat category # Cases
T1 Memory Poisoning 2
T2 Tool Misuse 2
T3 Privilege Compromise 2
T4 Resource Overload 2
T5 Cascading Hallucination Attacks 2
T6 Intent Breaking and Goal Manipulation 2
T7 Misaligned and Deceptive Behaviors 2
T9 Identity Spoofing and Impersonation 2
T10 Overwhelming Human-in-the-Loop 1
T15 Human Manipulation 1
T17 Supply-Chain Compromise 1
Total 11 categories 19
Table 8. Agreement between scenario-specific oracle judgments and human annotations across five synthetic agent settings. Each setting contains n = 95 traces (19 cases × 5 traces); the mean agreement is 90.5 % over n = 475 traces
Table 8. Agreement between scenario-specific oracle judgments and human annotations across five synthetic agent settings. Each setting contains n = 95 traces (19 cases × 5 traces); the mean agreement is 90.5 % over n = 475 traces
Synthetic agent setting Oracle–human agreement (%)
Mail 84.2
Complaint 94.7
Internal 89.5
HR-leave 94.7
News 89.5
Mean 90.5
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.