SlotGuard: Stop Oversharing Private Local Context in LLM Agent Transcripts
Abstract
LLM agents can expose private local context (e.g., paths, emails) and credentials (e.g., API keys) as agent observations (e.g., tool outputs, shell logs, and file reads) are appended to provider-bound transcripts. Existing placeholder redaction is brittle: it can miss embedded or cross-turn references, over-redact benign lookalikes, and destroy the structure useful for reasoning. We present SlotGuard, a local transcript boundary that can hide sensitive data while retaining agents' performance. SlotGuard rewrites structural bindings as typed, suffix-aware slots, replaces secrets with format-preserving synthetic values, links cross-turn references with a lightweight session graph, and restores raw values only inside the trusted runtime. On controlled repository-oriented agent transcripts, SlotGuard removes all 20,814 annotated structurally sensitive characters across 9,229 paths and reduces credential leakage to 0.0% across 852 planted values. It remains close to raw-transcript task success across four upstream models, while generic redaction drops to 2.5%. Deterministic transcript rewriting takes a median of 14.424 microseconds per agent turn, excluding the optional semantic detector. The code is publicly accessible at https://github.com/illinoisdata/SlotGuard.
Create a lesson
Metadata
- Categories
- cs.CR, cs.CL
- Comments
- 11 pages; ICML 2026 AIWILD. v2: corrected truncated title and clarified notation, privacy claims, and evaluation reporting
Related papers
LLM Agent Authorization Across Context Compaction
Shared title terminologycs.CRZeming Fei, Hongming Fei, Yi Xu et al.
Twin Agent: Context Residual Compression for Privilege Separated Agents
Shared title terminologycs.CRZhanhao Hu, Dennis Jacob, Xiao Huang et al.
AgentLens: Graph-guided Security Auditing for LLM-based Agents
Shared title terminologycs.CRPeizhuo Lv, Tao Chen, Mengya Shi et al.
Poisoning Attacks to Local Differential Privacy Protocols for Dynamic Graphs
Shared title terminologycs.CRShang Liu, Yuhan Bao, Hongbin Zhao et al.
Latent-in-the-Middle: On the Security of Cross-Model Latent Communication in Multi-Agent Systems
Shared title terminologycs.CRManit Baser, Vyoman Jain, Rachel Yeo Hui Min et al.
Agentic-Level Adversarial Purification: Revisiting Diffusion Purifiers on Native-Resolution Agentic Inputs
Shared title terminologycs.CRYan Lin, Zhongliang Guo, Jingyu Lin et al.