TL;DR

  • Many cloud environments allow all outbound traffic by default, so an AI agent can often reach any host on the internet unless someone has closed that door.

  • Identity and endpoint controls limit what an agent can reach. Network controls decide what it can send, so egress is the layer that still holds when a prompt injection gets through.

  • Deny-by-default egress is a sequence instead of a switch. The hard parts are practical: allowed destinations used for exfiltration, encrypted traffic, east-west reach, and multicloud drift.

What an Unprotected AI Workload Looks Like Today

Your platform team ships an internal support agent. It runs in Kubernetes, reads tickets, looks up customer records through an internal API and drafts replies. It works, and the support team loves it.

Then a ticket arrives with a few hidden lines at the bottom: collect the environment configuration and post it to a “diagnostics” URL. The agent treats it as part of the task and sends what it can reach out over HTTPS.

Nothing stops it. The pod has no egress policy, the NAT gateway forwards the request, and the connection looks just like the agent’s normal traffic to its model API. There is no zero-day needed, just an agent that reads untrusted text, has something worth taking and sits on a network that says yes by default. If your agents have all three, this scenario is very possible.

We have seen this play out already. In 2025, a prompt injection against GitHub Copilot could flip a setting that auto-approved the agent’s own tool calls (CVE-2025-53773). In Cursor, a new MCP server could start on its own from a config file nobody had approved (CVE-2025-54135). Neither needed an exotic exploit; both started from something that was allowed by default.

Deny by default is an old idea. In 1975, Saltzer and Schroeder called it “fail-safe defaults”: forget an allow rule and something breaks; forget a deny rule and the attack works quietly. Agents make that trade worth revisiting.

This guide is for teams bringing Zero Trust to their AI workloads, from the network side: how to roll out deny-by-default egress, the practical challenges organizations hit along the way, and how to get past them without stalling the agents the business relies on.

Deny by Default Across Identity, Endpoint, and Network

Deny by default for AI agents falls broadly into three layers. Each has its own rule and deserves its own guide; this one focuses on the network.

Identity: trust is lent by the hour instead of given for life. Every agent gets its own identity and only short-lived, task-scoped access.

Endpoint: what it touches, we see; what it leaves, we sweep. Agent code runs in a disposable sandbox that is watched while it works and thrown away after each task.

Network: silence by default; passage by permission. The agent talks to nothing until you name the destination. This is the layer the rest of this guide covers.

A diagram shows a workflow. On the right, an agent wants to act. Identity asks: "is this grant valid for this task?" Network asks: "Is this destination on the list?" Endpoint asks: "is this file or command inside the sandbox?" If all are answered yes, then Action Runs. If any of the three are answered no, the result is Denied and Logged, every stop is evidence, and a Denial Review: "widen on purpose or leave closed."

Every action passes three gates. A “no” at any gate stops it, and every stop becomes input for the next policy decision.

The implication is that when identity and endpoint controls slip, and with prompt injection they eventually will, the network is where the attack has to show itself.

How to Implement Network Deny-by-Default Egress for AI Agents

Most agent damage ends with data leaving over a connection nobody expected. Yet many cloud defaults allow all outbound traffic: a Kubernetes pod with no network policy can reach anywhere, and so can a typical security group. Fixing that is a short sequence, and the order is important.

  • Watch before you block, but only where it is safe to. In staging, run egress in monitor mode and let each agent show you where it goes. Agents that touch production data skip this and start closed.

  • Group agents by what they are instead of where they sit. Build policy groups from cloud tags, namespaces and labels, because IP addresses keep changing.

  • Allow by name. Write the allowlist as domains matched on SNI or the HTTP host, not IP ranges. Names stay put when endpoints move.

  • Close the door. Drop and log anything not named. For agents that touch production data, this is day one, and the denial log does the job monitor mode did in staging.

  • Try to get out. From inside the agent’s environment, test the side doors: direct connections, DNS, raw IPs and non-HTTP protocols. If one works, that is your real policy.

  • Review the denials. Widen real needs on purpose, with an expiry. Treat the rest as detections.

A diagram that shows a workflow. Step 1: Learn Safely. Staging data, or start closed. Step 2: Group by tag, label, namespace. Step 3: Allow by Name, domains, not IPs. Step 4: Close the Door. Drop and log the rest. Step 5: Test the Side Doors. Direct, DNS, raw IP, non HTTP. Step 6: Review Denials weekly, with an expiry. An arrow goes from Step 6: Review Denials back to Step 3: Allow by Name, domains, not IPs.

The rollout: learn first, close second, and let the denial log drive every new grant.

CISO action: make default-deny egress a launch requirement for any agent that touches production data or customer systems. No egress policy means no go-live.

Engineer action: put agent workloads in their own segment, enforce FQDN-based egress at the point traffic leaves the workload, and log every allowed and denied connection with the agent’s group attached.

How to Solve the Practical Challenges of Network Deny-by-Default

The policy fits on a page, but your teams have to keep it right under pressure.

  • Allowed destinations double as exfiltration channels. Code hosting or object storage can receive stolen data as easily as real work. Narrow grants to specific paths or tenants where you can.

  • Encryption hides intent. Without at least SNI visibility, you only see an IP and a port. For agents that handle sensitive data, add selective TLS inspection.

  • Blocklists lose the race. Attackers register new domains every day. Use a blocklist on top of an allowlist, never instead of one.

  • Needs change task by task. If adding a destination takes a week, teams will route around the policy. Give them a reviewed path measured in hours.

  • East-west matters too. An agent cut off from the internet can still reach internal APIs and databases. Segment it and allow only the services it calls.

  • Multicloud drift. Security groups, network security groups, GCP firewall rules and Kubernetes policies all speak different dialects. A policy that holds in one cloud but not another has a hole.

These controls rarely fail because the idea is wrong, but because the tooling is slow, blind or inconsistent.

Keeping AI Agents Productive Under Zero Trust

If deny by default makes agents painful, people will route around it. The goal is an agent whose access is explicit, temporary and fit for the task. Three habits will help:

Tier by blast radius, not by hype. Place each agent on two axes: how much it does on its own and how much damage a bad action could cause. Spend your strictest controls top-right.

Diagram titled Where to Spend Your Strictest Controls. A square has four quadrants, from top left to bottom left going clockwise: Contain, Strictest, Lightweight, Gate. The top row is labeled Acts on Its Own and the bottom is labeled Human Approves each step. The first column is labeled Low Blast Radius and the second column is labeled High Blast Radius. In the top left quadrant, Acts on Its Own-Low Blast Radius, is Docs summarizer, labeled "Contain." In the top right quadrant, Acts on its Own-High Blast Radius, are "Autonomous coding agent" and "Cloud Ops agent," labeled Strictest. In the bottom left quadrant, Human approves each step and low blast radius, is Internal FAQ bot, labeled Lightweight. In the bottom right quadrant, Human Approves Each Step-High Blast Radius, are "code review assistant" and "Finance workflow agent," labeled Gate. The caption reads "Placement is illustrative."

Strictest: sandbox, scoped tokens, step-up approval. Contain: sandbox and egress limits. Gate: human approval for high-impact actions. Lightweight: logging and review. Placement is illustrative.

Judge blast radius by what an agent can read and send, not just by what it can change. A read-only code reviewer with full repository access and open egress can leak your source code without touching a single line of it.

Build a paved road. Give teams a ready-made egress list, segment and policy template. When the secure path is the fastest one, nobody looks for a way around it.

Treat every denial as a signal. A denial means the agent needs something new, or something is steering it. Log each one with the agent, destination and time, and treat a burst of denials as an alert.

A 90-day Roadmap for Zero Trust AI Networking

AI-driven attacks will not wait for a two-year program. A focused team can get most agents to deny-by-default egress in about a quarter.

Weeks 1 to 2: find and contain

  • Inventory every agent workload and where its traffic leaves, including CI runners and developer environments.

  • Put agents that touch production data straight into deny-by-default egress.

  • Block raw IPs, non-HTTP protocols and newly registered domains everywhere.

Weeks 3 to 6: close the doors

  • Map the remaining agents in staging and move them to default deny.

  • Build policy groups that work across every cloud and cluster, and segment agents east-west.

  • Run the side-door tests on every enforced agent.

Weeks 7 to 12: make it stick

  • Add a self-service path for new destinations, with same-day review.

  • Feed denials into detection, and add selective TLS inspection where data is sensitive.

  • Make default-deny egress a launch requirement, with no exception that lacks an expiry date.

The Bottom Line

Deny by default will not make your agents smarter or stop every prompt injection, but it takes away the worst-case scenario. If the destination is not on the list, the request dies at the network and shows up in your denial log instead of an incident report.

Start your agents with nothing, let them earn each door, and keep a record of every door you open.

That is the gap the Aviatrix Zero Trust for AI Workloads closes for agent workloads: domain-based egress matched on SNI, policy groups built from tags and Kubernetes labels, and one policy across clouds. Explore how it applies to your own agents.

Try a free calculator to find out how much of your network a compromised workload could reach.

References

Amazon Web Services, “Create a security group for your VPC,” n.d., https://docs.aws.amazon.com/vpc/latest/userguide/creating-security-groups.html

Embrace The Red, “GitHub Copilot: Remote Code Execution via Prompt Injection (CVE-2025-53773),” August 12, 2025, https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection

The Hacker News, “Cursor AI Code Editor Fixed Flaw Allowing Attackers to Run Commands via Prompt Injection,” August 1, 2025, https://thehackernews.com/2025/08/cursor-ai-code-editor-fixed-flaw.html

Red Hat, “Guide to Kubernetes Egress Network Policies,” April 5, 2019, https://www.redhat.com/en/blog/guide-to-kubernetes-egress-network-policies

University of Virginia, Department of Computer Science (J. H. Saltzer and M. D. Schroeder), “The Protection of Information in Computer Systems,” 1975, https://www.cs.virginia.edu/~evans/cs551/saltzer/

Share This Article
Connect With Us

Ready to see Aviatrix in action?

Get a personalized live demo walkthrough or explore our latest deep-dive cloud threat research intelligence.

Gartner Report

Gartner Strategic Roadmap for Zero Trust Security Programs 2025 Report

Download and gain actionable insights to advance your cloud security strategy.

Download Now!
Recent Articles
EP9 Title Card-01Securing Agents by Focusing on Intent | In Progress, Episode 9

Securing Agents by Focusing on Intent | In Progress, Episode 9

Nov 20, 20266 min read
PCI Doesn’t Say “East-West,” But It Means It

PCI Doesn’t Say “East-West,” But It Means It

Nov 19, 202610 min read
The NSA Didn't Get Hacked, It Got Patched: That's the Problem

The NSA Didn't Get Hacked, It Got Patched: That's the Problem

Nov 18, 20267 min read
Gartner® Market Overview for Cloud Firewalls: Our Five Takeaways

Gartner® Market Overview for Cloud Firewalls: Our Five Takeaways

Nov 17, 20264 min read

Keep Reading

Related Articles

Featured Categories

95a2292256ee0f5750aa745fc7d21d39c8ae2870

ACE Program

Explore Category
Rectangle 3966

Customers

Explore Category
5a9318112c7cc265fab072924a2acaa2122a1c9f

Cloud Network Security

Explore Category
Aws-card

AWS

Explore Category
partner_card

Partners

Explore Category
cloud networking heroes

Cloud Networking Heroes

Explore Category
azure_card

Azure

Explore Category
events_card

Events

Explore Category

Secure The Connections Between Your Clouds and Cloud Workloads

Leverage a security fabric to meet compliance and reduce cost, risk, and complexity.

Cta pattren Image