Organizations: National University of Singapore · Singapore University of Technology and Design · University of Toronto · A*STAR Institute of Advanced Intelligence and Computing (A*STAR IAIC)
As large language models increasingly collaborate in heterogeneous multi-agent systems, latent communication has emerged as an efficient alternative to exchanging natural-language messages. By sharing internal representations, agents can avoid repeatedly processing the same context, reducing communication overhead and prefill computation. One such mechanism is cross-model Key-Value (KV) cache transfer, which uses a learned mapper to translate a source model's KV cache into one a target model can use. However, this handoff means the target model consumes context it did not encode itself, thus calling into question whether its safety alignment still holds. In this work, we investigate the security implications of latent handoffs by introducing Chasm, a framework characterizing cross-model handoff attacks across three new attack surfaces: the source model, mapper, and handoff mechanism itself. Our experiments reveal that latent handoffs substantially undermine safety alignment and prompt-injection defenses. Notably, a target model that follows only 0.4% of benchmark prompt injections natively, follows up to 44.2% when transferred through a mapper from a source model. On the other hand, for jailbreak attacks, transfer alone raises attack success by up to 24.6 pp within a model family and zero-shot attacks by up to 69.2 pp, whereas white-box optimization through the mapper boosts the attack success rate to 92.5%, against 37.5% for ordinary GCG on the same target. To address these vulnerabilities, we propose a lightweight target-side cache guard that corrects transferred caches to restore the target model's refusal, considerably mitigating these attacks.
Figures & tables
Fig. 1: Overview of native inference and latent handoffs. Top: jailbreaks. \scriptsize1⃝ Under native inference, the aligned agent T encodes the prompt and generates the answer. \scriptsize2⃝ Under model cascading, source agent S encodes the prompt, and mapper M converts its KV cache for target agent T . Subsequent model switches or relays trigger further mappings. Bottom: indirect prompt injection (IPI). \scriptsize3⃝ Under native inference, the agent fetches and encodes external content. \scriptsize4⃝ Under delegate and return, the main agent transfers its cache to subagent S via mapper M′ , then receives the subagent’s cache via mapper M , answering without encoding the fetched content itself. Red arrows denote untrusted data. Red badges mark the four jailbreak entry points: prompt templates (J1), model switching (J2), an untrusted source (J3), and mapper-aware GCG (J4). The violet badge marks an instruction planted in content fetched by the subagent. Dashed boxes enclose the computation between input and answer.
#
Attack
Attack surface
What the attack does
Jailbreaks
–
No attack
–
Sends plain harmful requests through an aligned pipeline
J1
Templates
Input
Wraps requests in published jailbreak templates
J2
Model switching
Repeated handoffs
Maps the cache back and forth between models before the answer
J3
Untrusted source
Source
Controls the source model
J4
Mapper-aware GCG
Mapper
Optimizes suffixes through source model, mapper, and target model
TABLE I: Chasm comprises classical attacks run through the parts of a latent handoff: four jailbreaks (J1–J4) and indirect prompt injection (IPI). Attack surface : the part of the handoff the attack exploits (Section III-B ). All attacks except J4 are zero-shot. Beyond the target model’s native safety, which these attacks and a backdoored mapper (Appendix B ) target, we also examine the confidentiality of the prompt (Appendix A ) and the availability of the target model (Appendix C ).
Fig. 2: Jailbreaks across a latent handoff, one per attack surface. Each pattern shows the transfer path (source S , its KV cache, mapper M , mapped cache, aligned target model T ) and where the attack acts (red, dashed; hatched: an attacker-controlled component).
Fig. 3: Indirect prompt injection natively (top) and in a delegate-and-return handoff (bottom). An attacker plants an instruction in external content. Natively, the defended main agent encodes the content itself and ignores the instruction. In the handoff, (1) the user gives the main agent a task, (2) its cache passes through M′ to the subagent, (3–4) the subagent fetches the content and prefills it, and (5) its cache returns through M , so (6) the main agent decodes without encoding the content itself and follows the instruction. Red marks untrusted data and the hijacked path.
TABLE II: The 24 settings: three families × four mapper types × two calibration corpora (FineWeb-Edu, the published default, and UltraChat). Every pair is also run in reverse. De-aligned checkpoints are listed with their publisher.
Fig. 4: Model switching (J2). HarmBench ASR (left) and MMLU (right) after m switches, with m=0 the larger model alone. Chains alternate between the two models. Colour and marker give the mapper, and dashed and solid lines give FineWeb and Chat calibration. In the ASR column, filled markers are significant changes against the model that ends the chain, and faded points and segments are where switching does not raise ASR.
Fig. 5: Untrusted source (J3). HarmBench ASR of the standalone target model, through handoff (ridge, FineWeb), and of the standalone de-aligned source. De-aligned sources are marked by publisher (hh: huihui-ai ; na: Nitral-Archive ). Table III presents results for all mappers.
Fig. 6: The three defenses we evaluate. D1 calibrates the mapper on refusal conversations. D2 (VReparo) corrects the mapped values toward the target model’s own. D3 ( HandoffGuard ) adds a learned low-rank correction to the mapped keys and values, trained against a de-aligned source and perturbed inputs to reproduce the target model’s native reply.
Source
Mapper
None
p1
p2
Ministral-3-8B → Ministral-3-14B
Standalone target model : HB 25.0%, SR 2.2%
Aligned
Stock
35.0
20.4
8.8
De-aligned
Stock
57.1
26.2
9.2
Stock (SR)
47.3
6.1
3.5
Own
49.2
27.9
12.5
TABLE VI: HandoffGuard against an untrusted source (J3): HarmBench ASR (%), or StrongREJECT ASR in the (SR) rows, without a guard and through each guard. All guards are trained through the stock FineWeb ridge mapper only. Own: the de-aligned source’s own FineWeb mapper. In parentheses ( † ): p2 retrained through CacheBridge, for an operator who refits the guard for each mapper. Shaded: significant change from the target model’s replies in the same run; red toward the attacker, blue away from it.
Ministral 3
Qwen3
Llama 3
Capability through the guard’s mapper fit: no guard → p1
MMLU
68.2 → 69.2
71.4 → 72.8
52.8 → 51.0
GSM8K
86.8 → 88.4
80.0 → 85.6
69.6 → 79.6
XSTest safe prompts refused
Standalone
4.4
3.2
6.8
p1
4.0
4.4
7.6
TABLE VII: Utility of HandoffGuard (%). Refusal is keyword-based. Shaded: significantly more refusals than the standalone target model (exact McNemar, p<0.05 ). p1 refuses at most 1.3% of benign requests in any template.
Attack
Pair
No guard
p2
Standalone
PGD, ϵ=0.1
Ministral
68
38
≈ 21
Qwen
53
20
12
Llama
83
43
27
GCG through p2
Ministral
65
45
26–35
Qwen
20–40
10–30
10–20
Llama
30–40
20–40
20–30
TABLE VIII: HandoffGuard (p2) against white-box attackers: HarmBench ASR (%), and the refusal-direction probe at the last prompt token (1: the target model’s mean on the probe’s harmful calibration prompts, 0: on its harmless ones). Gray-box LoRA: trained without the guard. Shading as in Table VI . PGD and GCG use their own behaviour subsets, so their standalone rates differ from Section V ; the probe rows are not tested.
Adversarial attacks on large language models probe how crafted inputs, internal changes, and agent interactions bypass safety or disrupt reliable behavior.