mlsanityData to 7 Oct 2026

Twin Agent: Context Residual Compression for Privilege Separated Agents

arXiv 2607.19595 ↗First posted 21 Jul 2026cs.CR cs.CLcited by 0

On the map: LLM agents and tool use → Agent threats, guardrails and governance

also in 1 more
Abstract (arXiv)

Large language model (LLM) agents are vulnerable to security risks, such as prompt injection attacks from untrusted context that manipulate downstream reasoning and tool use. Existing secure-by-design approaches mitigate this risk by separating untrusted observations from privileged execution and careful control of information flow, but often degrade utility and require extensive task-specific engineering. We thus propose Twin Agent, a general privilege separation design pattern inspired by residual coding in the agent context. Twin Agent consists of two nearly symmetric agents: an Explore Agent that inspects untrusted information and a Safe Agent that executes privileged actions. The Explore Agent is conditioned on the Safe Agent's current context and communicates only compact hints to the Safe Agent about the next action to take. This design reduces the information needed to preserve task utility and thus achieves a better security--utility tradeoff, which we empirically verify by measuring how utility and attack success change as the length of hints varies. We evaluate Twin Agent on long-horizon software engineering tasks with SWE-bench Lite and on heterogeneous multi-tool interaction tasks with AgentDojo and DecodingTrust-Agent. Across both benchmarks, Twin Agent preserves high task utility while preventing prompt injection attacks, outperforming both undefended agents and privilege separation baselines.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 19 of its 26 references that are in the map. First posted on arXiv 21 Jul 2026.

Builds on

19 of 26 references.

Closest ancestors · 4

Same direction, newest first

  1. 2025Preventing Prompt Injection with Type-Directed Privilege Separation30 Sep
  2. 2025Design Patterns for Securing LLM Agents against Prompt Injections10 Jun
  3. 2025Defeating Prompt Injections by Design24 Mar
  4. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar

Other references · 15

  1. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  2. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  3. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
  4. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  5. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
  6. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  7. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
  8. 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
  9. 2018DVC: An End-to-end Deep Video Compression Frameworkcited by 324
  10. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
  11. 2025Securing AI Agents with Information-Flow Controlcited by 108
  12. 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuningcited by 89
3 more
  1. 2024CYBERSECEVAL 3: Advancing the Evaluation of Cybersecurity Risks and Capabilities in Large Language Modelscited by 56
  2. 2025PromptShield: Deployable Detection for Prompt Injection Attackscited by 43
  3. 2026DecodingTrust-Agent Platform (DTap): A Controllable and Interactive Red-Teaming Platform for AI Agentscited by 10

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Toward Secure LLM Agents: Threat Surfaces, Attacks, Defenses, and Evaluation
  2. 2026AgentVisor: Defending LLM Agents Against Prompt Injection via Semantic Virtualization
  3. 2026SecureClaw: Clawing Back Control of LLM Agents
  4. 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration
  5. 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection
  6. 2026AgentLeak: Cloning Stronger LLM Agent Capabilities onto Weaker Agents Beyond Skill Stealing
  7. 2026Securing LLM Agents Need Intent-to-Execution Integrity
  8. 2026Agent-Fence: Mapping Security Vulnerabilities Across Deep Research Agents