T-MAP: Red-Teaming LLM Agents with Trajectory-Aware Evolutionary SearchT-MAP: Red-Teaming LLM Agents with Trajectory-aware Evolutionary Search
For MCP agents, T-MAP uses trajectory evolution search for attacks; on GPT-5-mini, the average ARR across five environments is 57.8%.
The attacker seeks prompts that cause a target agent with a tool set to execute tool sequences in an external environment and produce harmful outcomes. The attacker submits prompts, has access to tool schemas, and observes trajectories containing reasoning, actions, and environment observations. Success is determined by an LLMJudge based on whether tool execution achieves the adversarial goal.
- Chat-based red teaming mainly elicits harmful text and misses operational harms that only emerge when MCP agents execute multi-step tool calls. The authors consider such risks to include property loss and data exfiltration, requiring proactive red teaming before deployment.
- T-MAP evolves prompts in an 8×8 archive of risk categories and attack styles. Cross-diagnosis extracts success factors from parent cells and failure reasons from target cells; the tool call graph records tool transition successes and failures, then mutates, executes, and updates elites with a judge.
- The main experiment backbone is GPT-5-mini, with five types of MCPs and 100 iterations. T-MAP's average ARR is 57.8% and RR is 12.5% (Table 1), higher than the listed baselines. The authors state it remains effective on frontier models; the multi-MCP cross-server trajectory ratio is 46.28% (Table 5).
- The authors note that the evaluation covers only five MCPs and is in a sandbox; real permissions and confirmations may prevent ARR from being directly extrapolated, and it relies on DeepSeek-V3.2. Nine-model generalization is only on CodeExecutor; the paper does not report K.
- Evaluated models
- GPT-5-miniGPT-5.2Gemini-3-ProGemini-3-FlashOpus 4.6Sonnet 4.6Qwen3.5-397BGPT-OSS-120BKimi-K2.5GLM-5
- Benchmarks
- CodeExecutorSlackGmailPlaywrightFilesystemSlack+CodeExecutorPlaywright+FilesystemGmail+CodeExecutor+Filesystem
- Metrics
- ARRRRL0–L3|HL3|Self-BLEUcosine similaritypass@5SpearmanPearson
A Korean research team proposes T-MAP, a trajectory-aware MAP-Elites evolutionary search method for red-teaming LLM agents integrated with MCP. The method extracts success and failure reasons from execution trajectories via Cross-Diagnosis and maintains a Tool Call Graph recording success rates of tool-to-tool transitions, guiding the generation of attack prompts that both bypass guardrails and achieve harmful goals through real tool calls. Across five MCP environments—CodeExecutor, Slack, Gmail, Playwright, Filesystem—T-MAP achieves an average attack realization rate (ARR) of 57.8%, higher than baselines including Zero-Shot, Multi-Trial, Iterative Refinement, and Standard Evolution, and remains effective on frontier models such as GPT-5.2, Gemini-3-Pro, Qwen3.5, and GLM-5.
Why it was selectedThe paper advances attack success from the text level to the tool execution level and provides attack realization rates across MCP environments and frontier models, which can help agent deployers assess toolchain risk.
Paper analysis
What problem does this paper attempt to solve?
Existing red teaming mainly elicits harmful text, which makes it difficult to cover harms that only appear in multi-step tool execution by agents.
Existing red teaming mainly elicits harmful text and cannot detect harms that only materialize when MCP agents execute multi-step tool calls.
- Scenario: The authors state that after LLM agents directly access external environments via MCP, adversarial manipulation can lead to property loss, data exfiltration, or ethical violations (Figure 1). The authors consider red teaming before deployment necessary to discover these vulnerabilities.
- Limitations: Existing methods mainly find prompts that elicit harmful text, with less consideration of tool interactions, high-threat tool combinations, and execution strategies needed to achieve harmful goals. The authors state this leads to limited coverage of tool-integrated environments.
- Observation: The authors believe agent vulnerabilities often only appear in multi-step planning and specific tool sequences. Optimizing only for text responses may yield prompts that are superficially harmful but fail or remain incomplete in tool execution.
- Method: T-MAP is a trajectory-aware MAP-Elites. It uses execution trajectories to guide adversarial prompt search, aiming to bypass guardrails and achieve harmful goals through real tool interactions.
- Threat model:
- Goal: Discover prompts that cause the target agent to execute tool sequences, executed by the external environment Env and producing harmful outcomes.
- Victim system: The formalized object is an agent pθ with tool set T, operating in an external environment for at most K steps. The experimental environment is MCP servers.
- Input and feedback: The attacker provides prompts; seeds use risk categories, attack styles, and tool schemas. After execution, trajectories consisting of reasoning, actions, and environment observations are observed.
- Determination: LLMJudge determines whether tool execution achieves the adversarial goal, not just whether the text is harmful.
What related research exists?
The authors position T-MAP as MAP-Elites search with trajectory feedback, to distinguish it from text red teaming and fixed-environment evaluation.
Related work is divided by the paper into automated red teaming, diversity search, and agent tool safety; comparisons are conducted on five MCPs.
Automated red teaming
- Human to attack models: Wei et al. (2023) perform manual prompt probing. Perez et al. (2022) and Lee et al. (2025) train attack LLMs to generate adversarial prompts.
- Gradient and black-box search: Zou et al. (2023)'s GCG uses white-box gradients to optimize adversarial suffixes. Chao et al. (2025), Mehrotra et al. (2024), Liu et al. (2024), and Sabbaghi et al. (2025) use black-box iterative refinement or tree search to bypass aligned models.
- Multi-turn: Russinovich et al. (2025) and Yang et al. (2024) study multi-turn jailbreaks.
Diversity-driven vulnerability discovery
- Quality–diversity search: MAP-Elites by Mouret and Clune (2015) maintains elites across different phenotypes in a multidimensional archive. Rainbow Teaming by Samvelyan et al. (2024) and Nasr et al. (2025) frame red teaming as search that simultaneously optimizes attack success and style diversity.
- Paper's critique: The authors argue that these evolutionary methods still mainly stay in text interaction, and vulnerabilities that emerge when LLMs act as agents executing multi-step tools remain largely unexplored.
Agent and tool safety
- Harmful action evaluation: AgentHarm by Andriushchenko et al. (2025) shows agents can perform harmful multi-step actions without explicit jailbreaks. Agent-SafetyBench by Zhang et al. (2025c) proposes agent risk categories and conducts systematic evaluation.
- Indirect prompt injection: Greshake et al. (2023) study adversarial instructions in retrieved content or tool outputs hijacking subsequent actions. Zhan et al. (2024), Debenedetti et al. (2024), and Zhang et al. (2025a) provide environments for evaluating such attacks.
- Refinement with trajectories: Zhou et al. (2025) refine adversarial test cases using execution trajectories. The authors argue that these frameworks typically fix environments, tool sets, or task distributions, thus limiting systematic exploration of broader harmful behaviors; discovering diverse, multi-step harmful actions in open-ended agent settings remains an open problem in their view.
Baselines and environments
- Baselines: Zero-Shot (ZS), Multi-Trial (MT), Iterative Refinement (IR), and Standard Evolution (SE). IR is similar to Zhou et al. (2025), refining with its own trajectories and judge failure analyses. SE follows Samvelyan et al. (2024), mutating from elite parent prompts to target cells without trajectory analysis.
- Environments and coordinates: The five MCPs are CodeExecutor, Slack, Gmail, Playwright, and Filesystem. Risk categories and attack styles come from Zhang et al. (2025c) and Wei et al. (2023), respectively.
The authors position this paper's difference as: success is measured by whether tool execution achieves the harmful goal, and Cross-Diagnosis and Tool Call Graph bring trajectory-level feedback into evolutionary prompt search.
How does the paper address this problem?
T-MAP evolves prompts based on trajectory feedback using risk-style profiles, cross-diagnosis, and tool invocation graphs.
T-MAP evolves prompts in a MAP-Elites archive of risk categories and attack styles, and uses execution trajectories rather than only text responses to guide mutation.
Problem Setting
- Trajectory: Given a prompt x, the target agent pθ interacts with the environment for at most K steps. The trajectory h(x) contains reasoning r, actions a, and environment observations o; the first-step history is the prompt, and subsequent steps include previous r, a, and o. The paper does not give the value of K.
- Archive: A two-dimensional archive covers risk categories c and attack styles s. Defined as A={(xc,s, h(xc,s)) ∣ c ∈ C, s ∈ S}, i.e., each cell stores the current best prompt and its trajectory for that combination.
- Cells: |C|=8, |S|=8, totaling 64 cells (Appendix A.1). Category and style names are in Table 9 and Table 10, sourced from Zhang et al. (2025c) and Wei et al. (2023).
Initialization and Cell Selection
- Seeds: Each cell synthesizes a seed from the risk category, attack style, and tool schema, executes it on pθ, and then LLMJudge labels it with a discrete success level.
- Parent and target cells: The text states that parent cells are selected from cells containing high-success elites to reuse effective strategies. Algorithm 1 writes that sampling is from cells with success level greater than 0, or from all cells if none exist. Target cells are uniformly sampled across all risk–style combinations.
- Implementation roles: In the main experiment, DeepSeek-V3.2 serves as LLMMutator, LLMAnalyst, and LLMJudge, with the target backbone being GPT-5-mini. Each environment runs 100 iterations with 3 parallel prompts each, totaling 300.
Trajectory-Guided Mutation
- Cross-Diagnosis: LLMAnalyst extracts success factors from the parent trajectory and failure reasons from the target trajectory, so that mutation inherits effective frameworks and modifies parts that cause failure.
- Tool Call Graph: A directed graph whose nodes are the tool set plus END, with edges representing consecutive tool calls. Edge metadata includes success count, failure count, and success and failure reasons.
- Mutation: LLMMutator combines the diagnosis and the graph to generate a new prompt for the target cell. The text states that the mutator can query the empirical success rate of action sequences and avoid transitions with high failure records. Appendix A.2 gives the full prompts for each stage.
Evaluation and Graph Update
- Replacement: Execute the new prompt on pθ and collect the trajectory. If the success level is higher, replace the cell's elite. If the level is the same, LLMJudge compares which trajectory moves closer to the key steps of the intended harm.
- Graph update: LLMTCG extracts transitions between tool calls from the trajectory and records successes and failures in the graph for future mutations. Pseudocode is in Algorithm 1.
Success Levels
- L0 Refused: Refuses the request and does not call tools; the proportion is recorded as RR.
- L1 Error: Makes a tool call but errors due to illegal arguments, permissions, or execution exceptions.
- L2 Weak Success: Calls tools, but the harmful intent is only partially completed; the text gives an example of doing reconnaissance but missing key steps.
- L3 Realized: The harmful intent is realized through complete tool execution; the proportion is recorded as ARR. Finally, the elite of each cell is used to evaluate success levels and diversity.
What experiments did the paper conduct?
On GPT-5-mini and five MCPs, T-MAP's average ARR is 57.8% (Table 1).
In the main experiment with GPT-5-mini as the backbone and five MCPs as environments, T-MAP's average ARR is 57.8% and RR is 12.5% (Table 1).
Experimental Setup
- Target model: The main experiment backbone is GPT-5-mini. Section 5.3 additionally evaluates Gemini-3-Flash, Opus 4.6, GPT-OSS-120B, Gemini-3-Pro, Sonnet 4.6, Kimi-K2.5, Qwen3.5-397B, GPT-5.2, and GLM-5 on CodeExecutor.
- Other models: LLMMutator, LLMAnalyst, and LLMJudge are DeepSeek-V3.2. Cosine similarity uses Qwen3-Embedding-8B. Appendix D.4 additionally changes the attack model.
- Environments: CodeExecutor, Slack, Gmail, Playwright, Filesystem. Multi-MCP configurations are Slack+CodeExecutor, Playwright+Filesystem, and Gmail+CodeExecutor+Filesystem. Tools are in Appendix C, Table 11.
- Protocol: Each method runs 100 iterations, with 3 parallel prompts each time, totaling 300 per environment. The archive has 64 cells, and evaluation uses the elite of each cell. The paper does not report K, nor the number of queries per attack.
- Baselines: ZS uses one prompt per cell with no iterations; MT repeats ZS without using trajectories; IR refines using its own trajectories and judge failure analysis; SE mutates from elite parent prompts without trajectory analysis.
- Metrics: RR is the proportion of L0, and ARR is the proportion of L3. |HL3| is the number of distinct tool call sequences among L3. Self-BLEU and pairwise cosine similarity are computed on the final 64 elites. Transfer pass@5 means reaching L3 in at least one of five runs.
Main Results
According to Table 1, the backbone is GPT-5-mini, and cells are ARR (%).
Swipe horizontally to read the table
Environment ZS MT IR SE T-MAP CodeExecutor 0.0 1.6 3.1 48.4 56.2 Slack 0.0 10.9 10.9 28.1 64.1 Gmail 0.0 3.1 15.6 10.9 46.9 Playwright 1.6 3.1 7.8 3.1 37.5 Filesystem 7.8 31.2 40.6 71.9 84.4 Average 1.9 10.0 15.6 32.5 57.8 - Same-table RR: T-MAP has CodeExecutor 14.1%, Slack 15.6%, Gmail 9.4%, Playwright 21.9%, Filesystem 1.6%, averaging 12.5%, and is lower than each baseline in the same table across all five environments. The authors state that T-MAP has the highest ARR in all five environments.
- Baselines: The authors state that ZS, MT, and IR attacks do not succeed highly. IR's ARR on CodeExecutor is 3.1% and RR is 70.3%; on Playwright, ARR is 7.8% and RR is 76.6%. The authors state that SE is overall better than other baselines due to reusing elite prompt structure, but still lower than T-MAP.
- Exceptions and iterations: On average ARR, SE is 32.5% and IR is 15.6%, but on Gmail, IR's 15.6% is higher than SE's 10.9%, and on Playwright, IR's 7.8% is higher than SE's 3.1%. Figure 4's caption says five-environment average with 95% CI; the authors state that T-MAP reduces RR and increases ARR faster, while SE can reduce RR but stops at lower attack levels. The text does not give per-iteration readings.
Diversity and Archive
- What was measured: Figure 5 shows the average success level per cell after merging five environments. Table 2 shows the five-environment average of action, lexical, and semantic diversity.
- Results: T-MAP's |HL3|, Self-BLEU, and cosine similarity are 21.80, 0.25, and 0.47, respectively; SE is 12.80, 0.45, and 0.52; IR is 9.20, 0.30, and 0.52; MT is 6.00, 0.32, and 0.52; ZS is 1.20, 0.33, and 0.52.
- Authors' interpretation: The authors state that MT and IR successes concentrate in local cells, SE covers more broadly but mainly with L2, and T-MAP has broader L3. The authors believe that SE's mutation of parent prompts toward the target cell causes wording and semantics to converge. The text does not give heatmap cell values.
Judge, Target Models, and Transfer
- Judge: 96 T-MAP trajectories, uniformly sampled by success level, are divided into four batches of 24 each, and each batch is independently evaluated by 4 annotators. In Table 3, DeepSeek-V3.2's Spearman/Pearson with other judges: GPT-5.2 is 0.938/0.940, Opus 4.6 is 0.892/0.891, Qwen3.5-397B is 0.969/0.968, and human is 0.831/0.830. In Figure 9, 29.8% of samples labeled L3 by humans are labeled L2 by the model. The authors state that the judge is more conservative than humans but can still serve as a proxy for human consensus.
- Nine models: Figure 6 compares ZS, SE, and T-MAP on CodeExecutor, with the same protocol of 100 iterations and 300 total prompts. The authors state that T-MAP has the highest ARR on all nine models; Opus 4.6 and Sonnet 4.6 have relatively high RR, while Gemini-3-Flash, Kimi-K2.5, and GLM-5 have higher ARR. The text does not give percentages.
- Transfer: L3 attacks found on GPT-5.2 transfer to other models with pass@5 (Figure 7). The authors state that T-MAP is higher than SE and peaks on the same-family GPT-OSS-120B. The text does not give percentages.
Multi-MCP Chains
- Configurations: The target model is the same as in Section 5.1. The three combinations are Slack+CodeExecutor, Playwright+Filesystem, and Gmail+CodeExecutor+Filesystem; the latter server can use the output of the former server.
- Distribution: The authors state that in Figure 8, T-MAP has the highest ARR and lowest RR across the three configurations, and most methods have higher RR and lower ARR than in single-server experiments. The text does not give percentages.
- Cross-server trajectories: In Table 5, the proportion of unique tool trajectories spanning multiple MCPs is ZS 14.29%, MT 20.55%, IR 22.97%, SE 16.42%, and T-MAP 46.28%. The authors believe this is related to TCG aggregating cross-environment transfer statistics.
Other Ablations and Analyses
- Components (Table 4, five-environment average): Removing TCG changes L3 from 58.40% to 45.71%, L1 from 10.95% to 20.13%, and |HL3| from 23.88 to 21.38; removing Cross-Diagnosis changes L0 from 11.93% to 15.63%, L3 to 49.81%, and |HL3| to 21.13. This L3 is not the same aggregate as Table 1's 57.8%, and the paper does not explain the difference.
- Three seeds (Table 6): T-MAP's ARR means are CodeExecutor 55.2±1.5, Slack 64.6±5.8, Gmail 43.2±2.7, Playwright 25.0±9.2, and Filesystem 85.9±1.3. Playwright's 25.0 differs from Table 1's 37.5.
- Attack models (Table 7, CodeExecutor, other settings unchanged): DeepSeek-V3.2's ARR/RR/|HL3| is 56.2%/14.1%/17; Qwen3.5-397B is 32.8%/40.6%/10; Qwen3.6-35B-A3B is 25.0%/48.4%/6; GLM-5.1 is 23.4%/45.3%/3; Gemma-4-31B-IT is 18.8%/35.9%/7. The authors state that in qualitative checks, lower-capability models give lower-quality prompts and trajectory analyses, and more aligned models more often refuse to generate attacks; the paper does not map these two categories one-to-one.
- TCG (Appendix D.6): The authors state that the final graph is sparse, edge colors correspond to three success-rate tiers of ≥80%, 50–79%, and <50%, and edge thickness corresponds to transfer frequency. The text does not list edge weights.
What are some points that can be further explored?
The authors note that the evaluation is limited to five MCPs and a sandbox, and relies on DeepSeek-V3.2 as the attack model.
In Limitations, the authors wrote three points: environment scope, sandbox extrapolation, and attack model.
Limitations and Future Directions Noted by the Authors
- Environment scope: The evaluation covers five MCP servers; the authors state that extending to broader agent environments remains important future work (Limitations).
- Sandbox and additional protections: Experiments are conducted in a sandbox. The authors state that real deployments typically also have permission checks, user confirmation, input validation, and execution sandboxes, which may prevent the reported ARR from directly corresponding to practice (Limitations).
- Attack model: The framework relies on DeepSeek-V3.2. The authors state that its relatively weak safety alignment helps generate adversarial prompts; as safety alignment continues to strengthen, the framework's effectiveness may change (Limitations).
Experimental Coverage
- Main experiment: The target backbone is GPT-5-mini; environments are CodeExecutor, Slack, Gmail, Playwright, and Filesystem; baselines are ZS, MT, IR, and SE; each method runs 100 iterations with 3 prompts each, totaling 300 per environment (Section 5.1, Table 1).
- Diversity and judge: Table 2 shows five-environment average |HL3|, Self-BLEU on 64 elites, and Qwen3-Embedding-8B cosine similarity. Judge correlation uses 96 trajectories and compares with GPT-5.2, Opus 4.6, Qwen3.5-397B, and humans (Table 3, Appendix B).
- Generalization: Comparison of nine frontier target models is only on CodeExecutor (Figure 6). Cross-model transfer of L3 attacks is found on GPT-5.2, with pass@5 as the metric (Figure 7). The text does not give percentages for these two figures.
- Multi-server and ablations: Multi-MCP uses three server combinations, with the same target model as Section 5.1 (Section 5.5, Table 5). Component ablations remove TCG or Cross-Diagnosis (Table 4). Attack model comparison on CodeExecutor includes five attack models (Table 7). Single-server experiments use three random seeds (Table 6).
- Unspecified quantities: The paper does not report the value of the maximum trajectory steps K, nor the number of queries per attack.
Summarize the main content of the paper
T-MAP searches for executable attacks with trajectory feedback, achieving an average ARR of 57.8% across five MCPs.
T-MAP changes the success criterion for agent red teaming from harmful text to whether tool execution lands, and uses trajectory feedback for evolutionary search.
- Problem: The authors believe that the harm of MCP agents comes from multi-step tool actions, such as property loss and data exfiltration; only eliciting harmful text misses these operational risks.
- Approach: An 8×8 archive stores elites by risk category and attack style. Cross-diagnosis reads the success factors of the parent cell and the failure reasons of the target cell; the tool call graph accumulates the success/failure of tool transitions; then LLMJudge updates the archive according to L0–L3. The mutation, analysis, and judge models in the main experiment are DeepSeek-V3.2.
- Main results: With GPT-5-mini, five MCPs, and 300 prompts per environment, T-MAP's average ARR is 57.8% and RR is 12.5% (Table 1). In the same table, the five-environment ARR ranges from 37.5% for Playwright to 84.4% for Filesystem. The five-environment average |HL3| is 21.80, and Self-BLEU is 0.25 (Table 2).
- Extensions: The authors state that on CodeExecutor, T-MAP still has the highest ARR among nine frontier models; the text does not give percentages for Figure 6. L3 attacks found on GPT-5.2 transfer with pass@5, and the authors state this is higher than SE. Among three multi-MCP configurations, T-MAP's cross-server trajectory ratio is 46.28% (Table 5).
- Authors' conclusion: The authors believe that trajectory-aware evolutionary search corresponds to less-explored vulnerabilities in autonomous agents and is relevant to safe deployment. Limitations also states that results come from a sandbox, and permission checks and user confirmation in real environments may prevent ARR from being directly extrapolated.