Skip to main content

2026-09-17

11 min

By Formatho Editorial

The Secure AI-Agent Stack: Zero Data Egress in Practice

AI AgentsSecurityMCPPrivacyZero Trust

"We don't store your data" is not a security model

Every AI-agent vendor makes some version of the promise. Almost none of them can survive the follow-up question: what code path could send my data out if you were breached, subpoenaed, or simply buggy? The honest answer for most SaaS tooling is "several" — because their architecture requires your payload to transit their servers to do anything useful.

Zero data egress, done seriously, is not a privacy policy. It is an architectural property: the absence of capability. No network client in the code, no outbound requests at install or runtime, no channel from your data to the network — so the question "will you send it?" becomes meaningless. There is nothing to send with.

This piece maps where agent stacks actually leak, layer by layer, and what the mitigations look like when they are structural rather than promissory.

Layer 1: The model call itself

The unavoidable layer. When your agent sends a prompt to a frontier-model API, that payload has left your perimeter — full stop. Everything else in this article is about minimizing what crosses this boundary, not pretending it doesn't exist.

Practical discipline for this layer:

  • Classify before you send. Scan prompts and context for PII, credentials, and keys before they reach the API — mechanically, not by asking users nicely. A redaction pass that strips emails, phone numbers, API keys, and token patterns turns "we hope the model vendor is fine" into "the worst case contains no identifiers."
  • Know your retention terms. The differences that matter are data-retention windows, training-use flags, and where the inference region is — not the marketing word "private."
  • When nothing may cross: local models exist and are getting capable. For genuinely regulated content, the only honest architecture is local inference; everything after this layer still applies.

Layer 2: Tool execution — the leak nobody budgets for

Here is the pattern that dominates "AI-ready" SaaS: your agent calls a JSON-to-YAML converter hosted at some endpoint, and your Kubernetes manifest — with its inline secrets and internal hostnames — transits that vendor's server to be converted. The model call was the planned disclosure; the tool call was the unplanned one. Agentic workflows multiply this: a single task might fan out to a dozen tool endpoints, each a separate disclosure of whatever context the agent passed.

The structural fix has two shapes, depending on who executes:

  • Browser-side tools. If the tool is a deterministic function — format, hash, decode, convert — it can run entirely in your browser tab. No upload path exists because the code contains no network call. This is the model behind the free tools on this site: paste a JWT, and the token that would be a firing offense to submit to a web form never moves.
  • Self-hosted tool servers. When an AI agent needs the tool (agents cannot use browser tabs), the same pure functions can run in a container you control. The decisive detail is the tool's capability declaration: a tool that declares network: false, filesystem: false, secrets: false, subprocess: false — and a registry that refuses to register anything claiming otherwise — has no exfiltration channel even if the tool code is fully compromised.

That last clause is the difference between safety-by-review and safety-by-construction. Review says "we read the code and it looks clean." Construction says "the runtime build contains no mechanism by which a tool could reach the network, so a malicious tool would still have nowhere to send your data."

Layer 3: The MCP server in the middle

The Model Context Protocol is how agents reach tools, and it re-creates the Layer 2 problem one level up: a hosted MCP server means your agent's tool calls — with their payloads — transit someone else's infrastructure. The protocol is transport-neutral, which is the opportunity: MCP does not require a SaaS in the middle. A self-hosted MCP server gives agents the same tool access with connections terminating on your network.

What to demand of a self-hosted agent server, concretely:

  • Per-key identity and policies. Each agent gets its own key; policy files say which tools that key may call (wildcards like evm.* for a narrow agent, deny-by-default for everything else).
  • Rate limits per key. A runaway agent loop is a data-volume problem as much as a cost problem.
  • Audit that cannot itself leak. You want to know what was called without recording what was sent. Metadata-only audit logs — tool, version, duration, byte sizes — give compliance a trail while ensuring the log file is never the incident.
  • A verifiable supply chain. Three pinned dependencies beat three hundred transitive ones. No postinstall scripts. Outbound-connection count: zero, checkable with a grep.

Layer 4: Telemetry, updates, and the quiet egress

The layer that escapes audits: crash reporters, update checks, analytics beacons, and "anonymous" usage stats that ship enabled-by-default in tooling. Each is a small, legitimate-looking outbound channel that turns into a data path when the payload includes, say, the document you were editing. The structural answer is boring and absolute: zero outbound requests in the runtime, ever — no update pings, no telemetry, no registry checks. If the feature matters, make it explicit and pull-based (you run a command), not ambient.

You can verify this yourself on any candidate tool: run it in a network-isolated namespace or container with an egress-deny rule and watch what breaks. A tool that works perfectly with no network route out earns a different kind of trust than one that phones home to function.

The evaluation checklist

Next time a vendor says "your data never leaves X," ask these — the answers map exactly to the layers above:

  1. Does the payload transit your servers to execute, or is execution local to my environment?
  2. May I see the tool's capability declaration — network, filesystem, secrets, subprocess — and what enforces it?
  3. What appears in your logs after my agent calls a tool — full payloads or metadata?
  4. What outbound connections does the runtime make on its own — telemetry, updates, anything?
  5. Which dependencies run at install time, and how many are in the supply chain?
  6. What happens under an egress-deny firewall rule — graceful local operation, or breakage that reveals a phone-home?

"Trust us" answers to any of these are your signal to keep looking.

Zero egress in practice — the honest version

A stack with literally zero egress including the model call means local inference, and for many workloads that trade is now reasonable. But the practical target for most teams is sharper than perfection: classify what crosses the model boundary, and make every other layer structurally incapable of egress. Prompt-time redaction handles the first. Browser-side execution and self-hosted, pure-function tool servers handle the rest — with policies, keys, rate limits, and metadata-only audit so the residual surface is governed rather than hoped away.

You can try every layer of this stack hands-on: the PII Redactor shows what mechanical pre-send classification looks like; the browser tools on this site demonstrate pure client-side execution (open your network tab — nothing sends); and the Formatho Runtime is a working self-hosted MCP server built on the capability-by-construction model — the registry refuses tools that declare any network, filesystem, or secret access, and its audit log is metadata by construction. Verify all of it: the code is open, and every claim above is checkable with a grep.

Formatho Editorial — written and maintained by the team behind formatho.com, a library of free, privacy-first developer tools that run entirely in your browser. Every guide is tested against the tools it describes. Corrections and suggestions: github.com/formatho.