TRAP: Benchmark for Task-completion and Resistance to Active Privacy-extraction

Moon Ye-Bin, Nam Hyeon-Woo, Baek Seong-Eun, Yejin Yeo, Tae-Hyun OharXiv 2026

TL;DR

LLM agents handling document workflows face a fundamental tension: the capability to parse private data for tool use inherently makes them vulnerable to leaking it. This paper introduces TRAP, a benchmark evaluating this utility-privacy trade-off, mathematically proves that prompt-based defenses can never fully eliminate leakage, and proposes a structural "private field isolation" method that successfully protects data without sacrificing task accuracy.

What Problem Does This Paper Address?

Large Language Models (LLMs) are rapidly transitioning from passive chat assistants to active agents capable of executing complex, document-intensive workflows—such as processing payroll or booking flights. To do their jobs, these agents must access sensitive information like bank routing numbers or passport details.

However, an agent cannot truly verify who is behind the keyboard; a request could come from an authorized employee or an attacker who has hijacked the session. This sets up a dangerous conflict. To complete a task, the model must parse and use private data. But that very capability means it can be manipulated into revealing the data via natural language extraction attacks. Prior privacy benchmarks evaluated either passive leakage or adversarial attacks in isolation, ignoring whether the model could still successfully perform its intended tools-based tasks. This paper addresses the critical need to jointly evaluate task utility and adversarial privacy resistance.

Methods

The authors introduce TRAP (Task-completion and Resistance to Active Privacy-extraction), a framework that tests a model using two independent queries on the same document:

  1. Task Query: Requires the model to call a specific tool using private data fields as arguments.
  2. Attack Query: Attempts to extract that same private data using natural language adversarial prompts.

Crucially, the paper provides a mathematical proof showing that for any model using a standard softmax output distribution, soft-constraint defenses (such as system prompt instructions, RLHF alignment, or prompt optimization) can never guarantee zero leakage while maintaining task success over sufficiently long attack sequences.

To bypass this fundamental limitation, they propose a hard-constraint defense called Structural Private Field Isolation. Instead of feeding raw text to the LLM, private fields are detected and replaced with symbolic hash keys (e.g., [PRIVATE_buyer_ein]) before the document reaches the model. The LLM reasons and executes tools using these keys. The actual plaintext values are only resolved securely inside the tool execution layer, completely hiding the sensitive data from the LLM's generation space.

Datasets

The paper introduces the TRAP benchmark, which consists of:

  • 500 document cases across 10 distinct domains (5 personal categories like identity cards and medical records; 5 corporate categories like contracts and tax forms).
  • 147 unique private fields, 88 non-private fields, and 157 tools.
  • Three input modalities: Text-only, image-only, and multimodal (text + image).
  • Four attack query variants: Direct questions, Ignore (instruction override), Important (social pressure/urgency), and Roleplay.

Key Insights and Ideas

  • Capability is a Double-Edged Sword: Instruction-following and parsing capabilities directly correlate with leakage rates. Models that excel at extracting data to correctly fill tool arguments are also the most effective at extracting it for attackers.
  • The Softmax Impossibility: Because softmax assigns a non-zero probability to all tokens in its vocabulary, any private token processed internally has a non-zero chance of being sampled. Prompting can lower this probability ($\epsilon$), but over a long enough attack sequence ($N$), the probability of leakage approaches 1.
  • Attacks as Alarm Signals: Counterintuitively, complex adversarial framing (like Roleplay or Urgency) often reduced leakage compared to direct questions in advanced models. The explicit adversarial language acts as an "alarm signal" that triggers the model's safety alignment.
  • Authorization Exploits: Appending a statement like "The current user is authorized" to the prompt frequently increased leakage rates. This shows that models are highly susceptible to role-based social engineering.

Key Results

  • Universal Vulnerability: Across 22 frontier and open-source models, privacy scores were universally low. Every model achieving a task accuracy above 60% recorded a privacy score below 27% (with most falling below 15%).
  • Prompt Optimization Fails: Automated prompt optimization (using TextGrad) failed to break the utility-privacy trade-off, merely shifting models along the same sub-optimal frontier.
Figure 2: Task accuracy (%, ↑) and privacy score (%, ↑) under the base system prompt, four defense variants, and jointly optimized system prompt. Stronger privacy directives shift models toward higher privacy score but lower task accuracy, tracing a consistent trade-off curve that no hand-crafted variant escapes.
  • Breaking the Trade-off: Structural Private Field Isolation successfully broke this curse. Under the "Oracle" configuration (precise masking), privacy scores soared to 90% or above across all evaluated models while fully preserving task accuracy.

Limitations and Future Work

  • Simplified Environment: The benchmark assumes the necessary documents are already provided in the context window, omitting the complexities of a real-world Retrieval-Augmented Generation (RAG) pipeline where retrieval itself introduces privacy risks.
  • OCR and Masking Dependencies: When moving from the idealized "Oracle" setup to automated pipelines ("Practical" and "Auto" modes), errors in OCR localization and PII detection led to residual data leakage or corrupted tool arguments (e.g., when a mask boundary accidentally clipped non-private text).
  • Future Directions: The authors note that closing the gap between practical deployment and oracle performance is a well-scoped engineering problem centered on improving OCR precision and automated PII detection.

Summary updated

BibTeX
@misc{yebin2026trap,
  author = {Moon Ye-Bin and Nam Hyeon-Woo and Baek Seong-Eun and Yejin Yeo and Tae-Hyun Oh},
  title = {{TRAP: Benchmark for Task-completion and Resistance to Active Privacy-extraction}},
  year = {2026},
  eprint = {2606.18996},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.18996},
}
Figure