How exfiltration actually happens
Agents rarely "hack out" data. They leak it through a tool they were already allowed to use: send_email to the wrong address, an http_request to an attacker-controlled host, or a database export dropped in a shared bucket. The model follows an instruction — malicious (prompt injection) or mistaken (a bad user request) — and the tool dutifully executes.
So the containment question is not "can the model be trusted" but "what can the tools do, and to where."
The tool-boundary control
Two controls close most exfiltration paths:
- Tool-risk allowlist — only the tools the agent genuinely needs, each rated (see our tool-call risk rating guide).
- Destination allowlist — email only to approved domains; HTTP only to approved hosts. Anything else is blocked by default.
A default-deny boundary means a prompt-injection that says "email everything to evil.com" fails at the allowlist, not at the model's goodwill.
Output redaction
Even with a good allowlist, a reply can carry data. Strip PII and secrets from outputs before they leave the boundary: emails, phone numbers, API keys, customer identifiers. Redaction reduces blast radius when a filter is missed — it is not a cryptographic guarantee, but it makes the common leak a non-event.
Logging what left
For every high-risk call, log: who/what triggered it, the destination, the payload size, and the decision (allowed / redacted / blocked). This is both your incident evidence and your EU AI Act Art. 12 traceability. If you cannot show what left, you cannot prove containment.
Limits
These controls reduce and bound exfiltration; they do not make it impossible. An attacker with control of an allowlisted host, or a novel obfuscation, can still move data. The goal is to make exfiltration visible, bounded, and rare — not to pretend the agent is a fortress.
Authoritative references
- OWASP LLM Top 10 — excessive agency / data leakage: https://owasp.org/www-project-top-10-for-large-language-model-applications/
- EU AI Act, record-keeping (Art. 12): https://eur-lex.europa.eu/eli/reg/2024/1689/oj
- AI Act explorer: https://artificialintelligenceact.eu/