Skip to content
Preptima
hardDesignScenarioSeniorStaffLead

You are shipping an agent that can call tools. How do you stop it exfiltrating data?

5 min readUpdated 2026-08-15

Answer

Short answer

Assume the agent's context can be manipulated and control the exits instead. Scope each tool to the least data it needs, resolve the caller's identity in the executor rather than from a model-supplied argument, treat generated arguments as hostile input, and allow-list egress destinations.

Was this answer helpful?

Likely follow-ups

  • The agent renders markdown in your UI. Why is that an exfiltration channel and what do you do about it?
  • How do you scope a search tool that legitimately needs to query across tenants?
  • Your agent runs code in a sandbox. What does the sandbox still need to prevent?
  • How would you detect a slow exfiltration spread across many normal-looking requests?

Related questions

Masterclass guide

Further reading