DART: Detecting emerging safety risks in multi-turn LLM agents with representation shiftRepresentation Transitions Reveal Emerging Safety Risks in Multi-Turn LLM Agents
The authors propose DART, which detects multi-turn attacks via denoised representation shift, reducing the average ASR of 6 models on MT-AgentRisk from 84% to 25%.
Covers multi-turn task decomposition and indirect prompt injection. Attackers combine compliant inputs over multiple turns to achieve harmful goals, or inject malicious instructions through tool returns to induce unauthorized operations. Does not include the agent's own intrinsic misuse.
- Multi-turn agent attacks can combine individually compliant steps into harmful outcomes, and existing single-step detection or action blocking is difficult to prevent. Defenses such as speculative simulation rely on additional models and incur high computational overhead.
- Proposes a runtime defense framework called DART. It constructs a safety direction by transferring internal representations of the agent, removes drift by eliminating benign mean and covariance principal components, and when the cumulative transfer exceeds a threshold, it locates the triggering context and appends a targeted prompt.
- Across 6 models, DART reduces the average ASR on MT-AgentRisk from 84% to 25%, and on ASEval from 97% to 52%. On M3 Ultra, it adds only 0.14–0.56 seconds of overhead per step.
- Prompt attribution may increase compliance on 8B models; intrinsic misuse lacks clear representation shift; multi-turn decomposition tasks lack removable external harmful segments; experiments were conducted only on local 8-bit models and simulated tool environments.
- Evaluated models
- Qwen3-8BQwen3-14BQwen3-32BQwen3-30B-A3BLlama-3.1-8BMistral-Small-24B
- Benchmarks
- MT-AgentRiskASEvalAgentDojoInjecAgentActorBreakerR-JudgeAgent-SafetyBench
- Metrics
- ASRUtilitycatchFPRAUROCclean flip
Researchers from Singapore Management University and other institutions propose DART, a runtime defense framework that reuses agent hidden states, detecting multi-turn attacks by monitoring representation shifts caused by context updates. Multi-turn attacks are composed of multiple individually compliant steps. DART projects the representation shift caused by each context segment onto a denoised safety direction and accumulates them; when a calibrated threshold is exceeded, it attributes the shift to the context segment with the largest contribution and appends a targeted reminder without deleting context or aborting execution. Across six models and two multi-turn benchmarks, DART reduces the attack success rate on MT-AgentRisk from 84% to 25%, detects all attacks but does not block all of them, with an average false positive rate of 12% and an 8% decrease in the non-refusal rate for benign requests; under the same protocol, ToolShield has an attack success rate of 55%, and DART outperforms it on all six models. On ASEval, the attack success rate drops from 97% to 52% with no loss in benign non-refusals. Denoising is key: without denoising, the monitor captures only 7%–40% of attacks on ASEval, versus 60%–85% after denoising. The same monitor covers single-turn indirect injection without modification, adding only 0.14–0.56 seconds of overhead per step, and requires no auxiliary model.
Why it was selectedThe paper presents a runtime monitor that reuses agent hidden states, using denoised representation shift to detect and attribute triggering contexts in multi-turn attacks.
Related events and news
1 events · 0 news mentions
- This event's paper
DART 框架检测多轮 Agent 表征转移攻击
Paper analysis
What problem does this paper attempt to solve?
Multi-turn agent attacks can combine compliant steps into harmful behavior; existing single-step defenses are difficult to identify, and representation accumulation is easily disturbed by benign drift.
The core problem is preventing harmful behavior in large language model agents that is composed from individually compliant steps across multi-turn interactions.
- Multi-turn attack scenarios and importance: The authors point out that when agents interact with users, tools, and the environment, attackers can first induce them to obtain or transform information, which is later used for harmful operations such as exfiltrating data or redirecting funds; single-step checks cannot detect risks that evolve across turns.
- Limitations of existing defenses: Existing input/output guardrails and action-level monitoring (e.g., AgentSpec) mainly evaluate individual states or tool calls, and fail against multi-turn compositional attacks; speculative defenses (e.g., SSH) and knowledge-augmented methods (e.g., ToolShield) rely on additional model predictions or static knowledge, incurring high computational overhead or lacking dynamic awareness.
- Core observation on representation transfer: The authors find that harmful multi-turn behavior causes representation transfer along a specific safety direction in the internal hidden states of a fixed layer of the agent, but directly accumulating the transfer is disturbed by benign interaction drift, leading to premature false alarms on benign steps.
- Proposed defense framework: The authors propose a runtime framework called DART, which constructs a denoised safety direction by removing benign drift mean and principal components, and when the cumulative displacement exceeds a threshold, attributes the triggering context and injects a reminder.
- Threat model:
- Attack goal: Induce the agent to perform unauthorized or harmful actions, or bypass safety restrictions when exfiltrating sensitive data.
- Attacker capability: Attackers can combine tasks through multi-turn user inputs (multi-turn task decomposition), or implant malicious instructions in tool returns, retrieved documents, or the environment (indirect prompt injection).
- Attacker knowledge: The paper does not assume attackers have white-box access to weights or gradients; it is designed for black-box interaction scenarios.
- Victim system: Autonomous agent systems built on LLMs with tool-calling capabilities (e.g., file system, terminal, SQL database, and browser interactions).
What related research exists?
Existing research covers single-step action guardrails, multi-turn speculation or knowledge-based defenses, and internal representation monitoring. DART is positioned as a lightweight trajectory-level defense that reuses its own hidden states.
Related work mainly centers on agent runtime protection, trajectory-level internal monitoring, and representation engineering.
Runtime protection and action monitoring
- Input/output and action interception guardrails: Llama Guard (Inan et al., 2023), ShieldGemma (Zeng et al., 2024), and Qwen3Guard (Team, 2025d) classify input or generated text; AgentSpec (Wang et al., 2026a) and GuardAgent (Xiang et al., 2025) intercept unsafe tool calls at the action level based on rules or reasoning. The authors note that such methods judge independent actions and cannot identify the cumulative harm of individual legitimate calls in cross-turn decomposition attacks, and rules lack cross-domain transferability.
- Temporal and multi-turn agent defenses: ToolShield (Li et al., 2026b) explores tool experiences offline and embeds them as static prompts persistently in context; SSH (Wang et al., 2026c) uses an auxiliary large model to predict future actions and builds a speculative tree for scoring. The authors note that ToolShield's rules are fixed before execution and remain continuously active, unable to locate which specific context introduced harm; SSH requires maintaining an auxiliary model and frequent speculation, incurring high computational overhead.
Trajectory-level internal state monitoring
- External observers and attention feature monitoring: TRACES (Li et al., 2026a) trains a separate observer model to learn prefix-level risk states; Rennervate (Zhong et al., 2026) detects injection based on attention features within a single context window; Zhang et al. (2025) and Korbak et al. (2025) monitor reasoning chains. The authors note that these methods require additional models or are limited to single windows, unable to directly track sparse injections and accumulation of compliant steps across context turns.
Representation engineering and behavior steering
- Activation directions and control mechanisms: Zou et al. (2023), Rimsky et al. (2024), and Arditi et al. (2024) find that linear activation directions can represent safety attributes and be used for model behavior intervention. The authors note that predictive representation directions may not provide reliable causal control mechanisms, and directly manipulating activations in the residual stream can easily disrupt model outputs.
Comparison baselines and evaluation benchmarks
- Baseline methods and datasets: The paper compares ToolShield, AgentSpec, and a reproduction of the SSH architecture; evaluation benchmarks cover MT-AgentRisk, ASEval, AgentDojo, InjecAgent, ActorBreaker, R-Judge, and Agent-SafetyBench.
The authors position DART as a lightweight, trajectory-level general defense: it directly reuses the agent's own single forward pass hidden states to monitor representation shift, avoiding the high computation of auxiliary models, while enabling transparent and interpretable intervention through contextual reminders.
How does the paper address this problem?
DART extracts representation shift at fixed layers and projects it onto a denoised safety direction, detecting attacks by accumulating displacement, attributing contexts by maximum increment, and injecting targeted reminders.
The overall idea is to extract the agent's internal representation shift during interaction, construct a denoised safety direction that eliminates benign drift, use cumulative displacement to determine risk, locate suspicious contexts based on maximum contribution, and intervene through targeted reminders; the framework is named DART.
Problem formalization and representation shift
- Context segment division: The agent interaction stream is divided into an ordered sequence c0 to cn, where each segment contains newly received external context (e.g., user messages, tool returns) and the agent's own generated content since the previous segment, ensuring that concatenated segments cover all tokens.
- Representation shift extraction: At a pre-selected fixed model layer, the last token hidden state at each segment boundary is read. Let the initial state of the system prompt be the baseline anchor h0; the representation shift caused by segment ci is defined as delta_i = hi+1 - hi. The authors note that the differencing operation eliminates baseline offset inflation caused by different lengths and positional encodings.
Safety direction construction and denoising projection
- Contrastive direction initialization: Using labeled sets of harmful trajectory shifts and benign trajectory shifts, class means are computed separately, and the initial safety direction is the difference between the two means.
- Eliminating benign mean drift: Benign interactions produce systematic drift during accumulation, causing false positives. DART removes the projection component of the initial direction onto the benign mean direction via orthogonalization, anchoring the benign flow mean at zero.
- Eliminating benign covariance perturbation: The covariance matrix of benign shifts is computed, the top p-1 principal eigenvectors are extracted, and these principal variation directions representing benign tool calls and modality differences are further projected out of the safety direction and normalized. The layer number and truncation rank p are determined on a validation split within the fitting set (e.g., p=16 for ASEval, p=2 for MT-AgentRisk).
Cumulative detection and context attribution
- Cumulative displacement calculation: Each segment computes a scalar projection score ri = delta_i multiplied by u. The cumulative score over the first t steps is:
At = ∑i ≤ t ri = (ht+1,ℓ⋆ − h0,ℓ⋆)⊤ uℓ⋆ This formula represents the cumulative displacement of representation shifts caused by the first t context segments along the denoised safety direction, using telescoping summation to convert it into the difference between the current state and the initial baseline state.
- Threshold setting and triggering: Based on a preset false positive rate budget b, the detection threshold tau is set as the (1 - b) quantile of cumulative scores on benign calibration trajectories. An alarm is triggered when the cumulative score exceeds the threshold.
- Maximum contribution attribution: Since the cumulative score can be strictly decomposed into the sum of segment scores, DART directly locates the segment causing the largest positive shift:
c⋆ = cj⋆, j⋆ = argmaxj ≤ t rj This formula identifies the single segment with the largest projection score among observed segments and directly designates it as the attributed context causing the risk shift.
Prompt intervention and runtime flow
- Targeted reminder injection: After triggering an alarm, DART does not directly interrupt the process or remove context, but appends a defensive reminder at the end of the context targeting the attributed segment, explicitly stating that the segment leads to unsafe consequences and instructing the agent to stop executing that step or task.
- Regeneration and continuous monitoring: The agent regenerates the current action under the updated context; DART then continues monitoring subsequent steps to prevent harmful content from reappearing in later retrieval or tool returns.
What experiments did the paper conduct?
The paper evaluates detection rate, ASR, benign utility, and computational overhead on 6 models and multiple multi-turn and injection benchmarks, verifying the effectiveness of the denoising mechanism and prompt intervention.
Experimental Setup
- Models under test: 6 8-bit models deployed locally via MLX, including Qwen3-8B, Qwen3-14B, Qwen3-32B, Qwen3-30B-A3B (approximately 3B activated parameters), Llama-3.1-8B, and Mistral-Small-24B; additionally, Qwen3-4B is used as the speculation and review model when reproducing SSH.
- Test benchmarks and scale: Multi-turn decomposition benchmark MT-AgentRisk (evaluation split: 40 harmful and 40 benign trajectories per model, average 3.2 turns); indirect injection benchmark ASEval (40 harmful and 40 benign trajectories, average 6.7 segments, 1.8 injection segments); as well as AgentDojo (Slack suite and 4 suites), InjecAgent (dh and ds categories), ActorBreaker (600 attacks and paired benign dialogues), R-Judge (5 domains), and Agent-SafetyBench.
- Comparison baselines: No-defense baseline, non-denoised DART (directly using unprojected contrast directions), static empirical defense ToolShield, rule-based interception defense AgentSpec, and speculative simulation defense SSH architecture.
- Metric definitions: Detection metrics are catch (proportion of harmful trajectories flagged) and realized FPR on benign trajectories; intervention metrics are ASR (proportion of harmful trajectories whose final response is not refused) and Utility (proportion of benign trajectories whose final response is not refused).
- Review and decision mechanism: Deterministic greedy decoding is used; attack/defense outcomes are determined based on whether the final action and reply are refused; the detection threshold tau is computed on benign calibration trajectories with a preset 10% false positive rate budget.
- Samples and repetitions: Core comparisons for each model are conducted as paired evaluations on the same 40 harmful and 40 benign test trajectories; the fitting set uses separate 30 harmful and 30 benign trajectories.
Main Results
According to Table 1, the detection performance of non-denoised and denoised directions on the two multi-turn benchmarks is as follows (format: non-denoised → denoised):
Swipe horizontally to read the table
Model ASEval AUROC ASEval catch ASEval FPR MT-AgentRisk catch MT-AgentRisk FPR Qwen3-8B 0.712→0.958 0.33→0.78 0.00→0.00 1.00→1.00 0.00→0.00 Llama-3.1-8B 0.644→0.897 0.25→0.75 0.00→0.00 1.00→1.00 0.12→0.05 Qwen3-14B 0.603→0.979 0.07→0.75 0.12→0.00 1.00→1.00 0.15→0.05 Qwen3-30B-A3B 0.573→0.946 0.12→0.85 0.00→0.00 1.00→1.00 0.35→0.17 Mistral-24B 0.710→0.943 0.40→0.60 0.00→0.00 1.00→1.00 0.28→0.28 Qwen3-32B 0.651→0.942 0.10→0.78 0.00→0.00 1.00→1.00 0.30→0.17 - Denoising improves sparse injection detection capability: On ASEval, the trajectory-level detection rate of the non-denoised direction is only between 0.07 and 0.40, which improves to 0.60–0.85 after denoising, while the false positive rate remains at 0.00.
- Multi-turn decomposition attacks are fully captured: On MT-AgentRisk, the capture rate for harmful trajectories remains at 1.00 for all models before and after denoising; the denoising projection reduces the false positive rate on 4 models.
- End-to-end attack success rate decreases: The authors report that with prompt intervention, the average ASR on MT-AgentRisk drops from 84% to 25% (benign non-refusal rate changes from 93% to 85%), and the average ASR on ASEval drops from 97% to 52% (benign non-refusal rate remains 97%).
Comparison with Existing Defenses and Overhead Analysis
- Comparison with rule-based interception baseline AgentSpec: On the multi-turn decomposition benchmark MT-AgentRisk, since each individual step operation complies with local rules, AgentSpec does not trigger interception, and ASR remains at 0.80–1.00; on AgentDojo, AgentSpec causes over-interception on Llama and Mistral, reducing benign utility to 0.40 and 0.10 (Table 7 and Appendix B).
- Comparison with multi-turn knowledge defense ToolShield: On MT-AgentRisk, ToolShield reduces the average ASR from 84% to 55%, while DART reduces it to 25%, outperforming ToolShield on all 6 models (one-sided sign test p = 0.016); because ToolShield uses resident general rules and does not dynamically gate based on trajectory drift, its average utility is 91%, higher than DART's 85% (§5.3).
- Speculative simulation and monitoring overhead comparison: Reproducing the SSH speculative simulation architecture based on Qwen3-4B introduces approximately 6.7 seconds of additional latency per step on Apple M3 Ultra; in contrast, DART reuses its own forward hidden states, adding only 0.14–0.56 seconds per step (143 ms for Qwen3-8B, 564 ms for Qwen3-32B, with scoring taking only 0.019–0.022 ms, Figure 6 and §5.3).
Denoising Projection Mechanism and Peak Alignment Analysis
- Physical semantics of removed subspaces: Principal component analysis shows that the benign mean mainly encodes sequence position (explained variance R2=0.57 on Qwen3-8B, 0.65 on Qwen3-32B), the first two principal components mainly distinguish tool responses from user inputs (correlation ratios up to 0.51 and 0.72), subsequent components distinguish different tools, and token length explains variance no more than 0.21 (Table 3 and §3).
- Cumulative peak alignment with attack position: On ASEval, the non-denoised cumulative score peaks at the first segment in 45% of Qwen3-8B runs and 100% of Qwen3-32B runs due to benign negative drift; after denoising, 84%–87% of alarm runs peak at or after the first injection segment (Figure 4 and §5.4).
- Attribution accuracy verification: After denoising, the maximum increment segment hits the actual injection segment with 78%–83% probability across 5 models, higher than the 22%–30% random guess baseline (§5.4).
Limitations of Prompt Intervention and Fallback Mechanisms
- Instruction inversion of prompt intervention on 8B models: In the data theft task (ds) of the single-turn injection benchmark InjecAgent, prompt reminders cause Qwen3-8B's ASR to rise from 0.33 to 0.87, and Llama-3.1-8B's ASR from 0.07 to 0.38; on AgentDojo, Qwen3-8B's ASR rises from 0.18 to 0.22 (Table 8). The authors explain that the reminder template quotes the suspicious segment verbatim, and smaller models cannot maintain the semantic frame that "quoted content is prohibited," mistakenly treating the quoted imperative as the latest instruction to follow.
- Residual stream direct steering ablation: Strong steering (alpha=2) at intermediate layers achieves a 0.68 action flip rate, but this control effect is limited to a network depth window of 0.35–0.65; both shallow and deep layers fail (Table 15); moreover, compared to reminders, it discards attribution information and lacks a calibration process (Appendix F.3).
- Read interception fallback strategy: Withholding reads of attributed external inputs and re-anchoring the accumulator after withholding suppresses ASR below 0.09 across all models and benchmarks (Table 17), but it reduces completion rates for some benign tasks (completion rates of 0.24–0.71 on flagged runs).
Other Ablations and Analyses
- Projection truncation rank analysis: On ASEval, Qwen3-8B's AUROC varies with rank: p=0 gives 0.712, p=1 gives 0.750, p=2 gives 0.912, p=8 gives 0.966, p=16 gives 0.958 (Table 4).
- Transfer representation vs. state representation comparison: In leave-one-out cross-validation across the four AgentDojo tool suites, the average AUROC for transfer representation delta_i is 0.925, while for full state representation h_i it is 0.884 (Table 12).
- Orthogonal projector vs. sequential dimensionality reduction: In online state re-scoring on ASEval Qwen3-8B, the AUROC for orthogonal projector and sequential dimensionality reduction at p=2 are 0.911 and 0.912, respectively; at p=16 they are 0.965 and 0.958 (Table 5).
- Attribution prompt content comparison: On MT-AgentRisk, the average ASR for single-segment maximum contribution attribution is 0.438, for path top-2 attribution is 0.444, and for no attribution warning is 0.500 (Table 16).
- Non-injection task generalization probe: In leave-one-out validation across five R-Judge domains, Qwen3-8B achieves an average AUROC of 0.77, and Qwen3-32B achieves 0.80 (Table 11).
- Intrinsic misuse task boundary probe: On Agent-SafetyBench, the cross-validation held-out AUROC is at most 0.65–0.71, and its transfer representations interleave with safe samples in the principal component space (Figure 5 and §E.1).
What are some points that can be further explored?
The authors point out that current defenses face limitations such as intervention failure, lack of fine-grained information preservation, and difficulty in eliminating multi-turn decomposition; future work needs to explore stronger mitigation methods and cascaded architectures.
Limitations and future directions noted by the authors
- Fine-grained content retention mechanism: The authors note that attributed segments may contain both harmful instructions and task-related information; attribution alone cannot determine which content to retain, and the authors leave this fine-grained decision to future execution mechanism research (§4).
- Residual attack success and intervention failure: The authors note that on MT-AgentRisk all attacks are detected but a quarter still succeed, and on ASEval half succeed; residual failures stem from insufficient intervention rather than missed detection, indicating the need for stronger multi-turn agent defense mitigation strategies in the future (§5.2).
- Complementarity with speculative simulation cascades: The authors note that DART can serve as a lightweight trigger, waking high-cost speculative simulation on demand when representation drift appears, forming a complementary cascaded defense scheme (§5.3 and §6).
- Attribution and withholding limitations in multi-turn task decomposition: The authors note that in multi-turn task decomposition there are no externally injected segments; turns crossing the threshold belong to the user's own requests, so segment deletion is inapplicable, and mechanically withholding user input cannot eliminate attack intent (§E.1).
- Untested verification in intrinsic misuse scenarios: The authors note that the directly harmful multi-step agent benchmark AgentHarm falls under intrinsic misuse, where predicted representation shift signals perform weakly; the paper does not test on such benchmarks and labels them as natural experiments to test this prediction (§E.1).
- Path attribution under long-chain sparse setup: The authors note that in current experiments multi-turn attacks average only 3.2 turns; whether path-based cumulative attribution rules can show advantages in longer, more sparsely set attacks remains unresolved, and the paper does not draw conclusions on this (§F.4).
Experimental coverage
- Tested model coverage: Evaluation covers 6 open-source models: Qwen3-8B, Qwen3-14B, Qwen3-32B, Qwen3-30B-A3B, Llama-3.1-8B, and Mistral-Small-24B, all using 8-bit quantized versions under the MLX framework; closed-source commercial API models were not tested.
- Multi-turn benchmark coverage: Multi-turn evaluation covers MT-AgentRisk (evaluation split of 40 harmful and 40 benign trajectories per model, plus the full set) and ASEval (40 harmful and 40 benign trajectories); injection benchmarks cover AgentDojo (Slack suite and 4-suite leave-one-out cross-validation) and InjecAgent (direct harm and data theft).
- Comparison baseline coverage: Defense baseline comparisons cover ToolShield static experience prompts, AgentSpec rule interception, and SSH speculative simulation overhead comparison based on Qwen3-4B.
- Hardware and sampling settings: Inference and timing tests were conducted on a single Apple M3 Ultra device with 96GB unified memory; agent generation step length was fixed at 256 tokens with greedy decoding.
- Unreported information: The paper does not report dynamic evasion evaluation against adaptive attackers, nor consistency checks between human evaluation and automated metrics.
Summarize the main content of the paper
DART uses denoised representation transfer to monitor multi-turn attacks and inject reminders, reducing attack success rate while maintaining benign utility, with only a few tenths of a second overhead per step.
The paper proposes DART, a lightweight runtime defense framework targeting multi-turn safety risks in large language model agents.
- Problem addressed: Multi-turn attacks often decompose overall harm into multiple individually compliant execution steps; single-step action blocking and input/output guardrails fail to detect the cross-turn evolution of risk, while external speculative models incur high computational costs.
- Core method: The authors find that multi-turn malicious behavior causes cumulative representation shift in fixed layers of the agent. To address the drowning of cumulative signals by benign interaction drift, DART constructs a denoised safety direction during an offline fitting phase by removing the benign mean and principal components of the covariance; at runtime, it accumulates shift scores, attributes exceedances to the segment with the largest increment, and appends a defensive reminder.
- Main experimental results: On the MT-AgentRisk benchmark, DART detects all attacks across all 6 models, reducing average ASR from 84% to 25%, with benign non-refusal rate changing only from 93% to 85%, outperforming ToolShield's 55% average ASR; on the ASEval benchmark, DART reduces average ASR from 97% to 52%, with benign non-refusal rate maintained at 97% with no loss.
- Denoising and overhead performance: On ASEval, denoising projection improves trajectory detection rate from 7%–40% to 60%–85% with a false positive rate of 0.00; on M3 Ultra hardware, DART reuses its own forward hidden states, with per-step monitoring time of only 0.14–0.56 seconds, far below the 6.7 seconds of the speculative simulation baseline.
- Exceptions and limitations found: Prompt reminders may induce instruction inversion on 8B models; for example, in the InjecAgent data theft task, they increase Qwen3-8B's ASR from 0.33 to 0.87; for such weak models, a fallback content withholding strategy can control ASR within 0.09.
- Authors' conclusions and implications: The authors believe internal representation shift can serve as a highly sensitive diagnostic signal for multi-turn agent risks; since multi-turn decomposed tasks lack removable external harmful segments, and existing reminder interventions still have residual attack success rates, future defense efforts should shift toward more robust contextual interventions and multi-level cascading mechanisms.