Agent egress control means an AI agent's sandbox can send network traffic to exactly one place, a gateway, and the gateway decides which tools, models, websites and other agents each call may reach. Data loss prevention (DLP) then scans what crosses that boundary, in tool arguments, tool results, prompts and completions, and redacts or blocks secrets and personal data. You need both: egress control removes the side doors, and DLP inspects what goes through the front one.
What is agent egress control?
Egress is traffic leaving a system. For an AI agent, it includes much more than HTTP: MCP tool calls, model API calls, calls to other agents, web fetches, browser sessions and anything code the agent writes might open. Egress control is the policy that says which of those may happen. The usual default for containers is "allow everything out". For an agent steered by a model that reads untrusted text, the safe default is the opposite: deny everything except one governed exit.
How do AI agents leak data?
Rarely through a dramatic breach. Usually through an ordinary tool used with the wrong arguments:
- Prompt injection with an outbound channel. A web page or ticket tells the agent to send what it found to an address. Simon Willison calls the combination of private data, untrusted content and external communication the lethal trifecta.
- Secrets in arguments. An agent pastes an API key or a customer record into a search query, a ticket comment or a model prompt. OWASP lists this as sensitive information disclosure.
- URLs as a channel. Data encoded in a URL the agent fetches, or in an image link a client renders, leaves the network without any "send" tool.
- Internal targets. An agent tricked into fetching cloud metadata or an internal admin page: server-side request forgery. The MCP security best practices recommend blocking private and link-local ranges and using an egress proxy.
- Direct connections. Code the agent runs opens a socket to anywhere the network allows, bypassing every tool-level control.
Why is DLP alone not enough for AI agents?
DLP finds patterns: card numbers, national ID numbers, keys. It cannot see a secret that has been summarised, translated, split across calls or encoded. And it only sees traffic that passes through it: if the agent can open its own connection, DLP is not in the path. That is why egress control comes first. Once there is only one way out, DLP and policy at that exit cover every call. Then a second control closes the gap DLP cannot: taint, which remembers that a session has read untrusted content and lets a rule hold or deny the tools that could leak, whatever the data looks like.
Which controls stop an AI agent leaking data?
- Default-deny network. The agent's sandbox may reach only the gateway (and DNS). No direct sockets, no direct MCP servers.
- A governed exit. Every tool, model, web and agent-to-agent call is a decision at the gateway, with domain allow-lists for web and browser traffic.
- SSRF protection at the exit. Block private, loopback, link-local and metadata ranges, and resolve DNS once so a rebinding trick cannot switch the address. See the OWASP SSRF prevention cheat sheet.
- DLP in both directions on arguments, results, prompts and completions, with redact or deny actions.
- Taint-based rules. After untrusted input, external sinks need approval or are denied.
- Human approval for external sends. See human-in-the-loop approval.
- Credentials outside the agent, so there is no key to leak. See agent identity and least privilege.
- A record of every decision, including denials, without storing the sensitive values themselves.
What can still leak with egress control in place?
Be honest about residual channels. DNS resolution can carry small amounts of data unless you restrict forwarding or remove DNS entirely for the most sensitive workloads. A proxy that allows a shared CDN domain may allow other customers of that CDN (domain fronting), so allow specific hosts. Anything an allowed tool is permitted to send, such as an email to an allowed address, is a legitimate channel that policy and approval must govern. And a model can leak by paraphrase, which no pattern detector catches; that is what taint and approval are for. Data leaving through a model provider is egress too: route model calls through the same gateway, or run models locally.
How does MAQPNA control agent egress and DLP?
From the MAQPNA docs on network and egress design and DLP and taint:
- Default-deny per session. The operator creates a NetworkPolicy for every session: egress only to DNS and the gateway, or a
deny-alltier with no egress at all. NetworkPolicies need a CNI that enforces them, andmaqpna preflightwarns if none is found. - Two guarded dialers. A residency dialer checks every upstream against allowed CIDRs and host names and blocks cloud metadata ranges; an SSRF guard refuses private, loopback and reserved ranges and numeric host tricks for agent-chosen destinations. Both resolve once and dial the checked address.
- Governed web and browser. The built-in
maqpna-webfetch and search tools check domain allow and deny lists and taint the session. Browser traffic goes through an egress relay to the gateway, which applies the domain policy and records each connection. A browser cannot wait, so an approval decision on egress is enforced as a denial. - DLP in-process. Deterministic detectors for IBANs, card numbers, several European and US national IDs and common cloud and AI provider keys, plus your own regular expressions. Actions are off, audit, redact or deny; nothing is sent to an outside classifier, and the ledger records detector IDs and counts, never the matched values. DLP is off until you define a profile. See DLP profiles.
- Taint rules. A rule with
sessionTaintsandsinks: [external]holds or denies exfiltration-capable tools after untrusted input. See taint and prompt injection.
The docs also list the known limits above, DNS as a covert channel and CONNECT-level domain decisions, with the mitigations. Related: is MCP safe?, prompt injection in tool calls, what is an MCP gateway? and sovereign and air-gapped agents.