On this page
Where an agent's tool call comes from
A language model never opens a network connection to your partner. It returns a structured request to call a tool. Some piece of code then makes the HTTP call. The partner's firewall sees the IP of the machine that runs that code, and that is the only address an allowlist can check.
Model vendors draw this line in their docs. Anthropic splits tools into client tools, which run in your application, and server tools such as web_search, web_fetch, and code_execution, which run on Anthropic's infrastructure. The OpenAI Agents SDK separates the Python functions you register as tools from hosted tools, which execute on OpenAI's servers. The same agent can use both kinds in one turn, so one conversation can reach the internet from two or three different networks.
| Where the tool runs | IP the partner sees | Can you pin it? |
|---|---|---|
| Your backend on Lambda, Vercel, Cloud Run, Railway, or Render | A shared platform address that changes over time | Yes, with the platform's paid static egress or a proxy |
| A VM or long-running container you control | The machine's public IP, until it is replaced | Yes, with a reserved IP or a proxy |
| A hosted sandbox such as E2B or Modal | The sandbox cloud's addresses, which rotate | Only through the sandbox's proxy setting |
| A provider-hosted tool (web fetch, MCP connector) | The provider's published ranges, shared by every customer | No |
| Anthropic's code execution container | None. The container has no internet access | Not applicable |
The platform rows are covered in why serverless egress IPs change. This post covers what is specific to agents. Tool calls come from several places, an agent chooses its own requests, and the partner on the other end usually wants to know exactly what will call it.
Why a partner will not allowlist your agent's sandbox
Agent sandboxes are built to be thrown away. A new one starts for each session, and its public address is whatever the underlying cloud hands out. Two vendors state this plainly.
- E2B's FAQ says there are no dedicated or static egress IP addresses on any plan, including Enterprise. Sandbox traffic leaves from ephemeral public IPs that rotate over time. For its Google Cloud regions, the page points to Google's published ranges and warns that they cover all Google Cloud workloads.
- Modal gives static exit IPs only through Modal Proxies, which are on the Team and Enterprise plans. Without a Proxy, the same function prints a different IP depending on where it runs.
Provider-hosted tools have stable addresses, but they are not yours. Anthropic lists its outbound ranges as 160.79.104.0/21 and 153.61.208.0/20, used for requests such as MCP tool calls to external servers. That is 6,144 IPv4 addresses, and every Anthropic customer's MCP calls and web fetches leave from them. OpenAI's IP egress ranges page says its allowlists identify traffic from an OpenAI-operated network, not a specific user or workspace, and that the ranges can change as its infrastructure changes.
A bank, a payout API, or an enterprise customer's security team will not accept either. Allowlisting a cloud's or a model vendor's ranges admits every other tenant on them, which is the problem described in cloud IP ranges are not an allowlist. They want a short list of addresses that only you send from.
There is a second limit with provider-hosted tools. You cannot attach your own proxy to them. Anthropic's MCP connector, for example, requires the MCP server to be publicly exposed through HTTP, and the request comes from Anthropic's ranges. If a call must reach a firewalled system, move it into a client tool that runs in your code. The MCP side of this, including which hosts let you pick the egress IP, is in MCP servers and egress allowlists.
Proxy the tool calls, not the model calls
Once the tool runs in your code, you can route its HTTP calls through a proxy with a fixed outbound IP. Route only those calls. The model API calls do not need a fixed IP, they carry most of the bytes, and they often stream. Sending them through the proxy adds a hop to every turn, uses proxy bandwidth, and buries the partner calls in the proxy's logs.
Do not set HTTPS_PROXY for the whole process. httpx reads HTTPS_PROXY by default, and the official Anthropic and OpenAI Python SDKs are built on httpx, so a global variable sends the model calls through the proxy too. Node's built-in fetch does the opposite and ignores the variable unless NODE_USE_ENV_PROXY=1 is set. Store the proxy URL under a name no library reads on its own, such as EGRESS_PROXY_URL, and pass it to one client. The rules each tool follows are in HTTPS_PROXY, NO_PROXY, and per-client agents.
The examples below use Anthropic's tool runner, which runs your tool functions when Claude calls them. The pattern carries over to any framework. The tool function owns a proxied HTTP client, and the model client stays direct.
# pip install anthropic "httpx>=0.28"
import os
import re
import httpx
from anthropic import Anthropic, beta_tool
client = Anthropic() # model calls go direct
# Partner calls go through the fixed-IP proxy. One client, reused.
partner = httpx.Client(
base_url="https://erp.partner.example",
proxy=os.environ["EGRESS_PROXY_URL"],
headers={"Authorization": f"Bearer {os.environ['PARTNER_API_KEY']}"},
timeout=15.0,
)
@beta_tool
def get_invoice(invoice_id: str) -> str:
"""Fetch one invoice from the partner ERP.
Args:
invoice_id: The invoice id, such as INV-2041
"""
# The model chose this value. Check it before it reaches a URL.
if not re.fullmatch(r"INV-\d{1,10}", invoice_id):
return "Invalid invoice id. Use the form INV-2041."
res = partner.get(f"/v1/invoices/{invoice_id}")
res.raise_for_status()
return res.text
runner = client.beta.messages.tool_runner(
model="claude-opus-5-5",
max_tokens=16000,
tools=[get_invoice],
messages=[{"role": "user", "content": "Is invoice INV-2041 paid?"}],
)
for message in runner:
print(message)// npm install @anthropic-ai/sdk undici zod
import Anthropic from "@anthropic-ai/sdk";
import { betaZodTool } from "@anthropic-ai/sdk/helpers/beta/zod";
import { fetch, ProxyAgent } from "undici";
import { z } from "zod";
const client = new Anthropic(); // model calls go direct
// Partner calls go through the fixed-IP proxy. One agent, reused.
const fixedIp = new ProxyAgent(process.env.EGRESS_PROXY_URL!);
const getInvoice = betaZodTool({
name: "get_invoice",
description: "Fetch one invoice from the partner ERP",
inputSchema: z.object({
// The model chose this value. Check it before it reaches a URL.
invoiceId: z
.string()
.regex(/^INV-\d{1,10}$/)
.describe("The invoice id, such as INV-2041"),
}),
run: async ({ invoiceId }) => {
const res = await fetch(
`https://erp.partner.example/v1/invoices/${invoiceId}`,
{
dispatcher: fixedIp,
headers: { authorization: `Bearer ${process.env.PARTNER_API_KEY}` },
},
);
if (!res.ok) throw new Error(`Partner returned ${res.status}`);
return await res.text();
},
});
const finalMessage = await client.beta.messages.toolRunner({
model: "claude-opus-5-5",
max_tokens: 16000,
tools: [getInvoice],
messages: [{ role: "user", content: "Is invoice INV-2041 paid?" }],
});
console.log(finalMessage.content);Three details matter here. The proxied client is created once and reused, so each tool call does not pay for a new proxy handshake. The tool checks the id the model produced before it goes into a URL, because a model can be talked into passing ../admin as easily as INV-2041. And the partner's API key lives in the tool's environment, never in the prompt, so the model cannot repeat it.
Agents that run inside a sandbox
Some agents run their tools inside a sandbox, such as generated code, a headless browser, or a shell. Then the tool call leaves from the sandbox, not from your backend. Set the proxy on the sandbox itself, outside the code it runs, so code the model wrote cannot route around it.
E2B
E2B's bring your own proxy feature sends the sandbox's outbound TCP connections through a SOCKS5 proxy you run. You set it when you create the sandbox, and nothing runs inside the guest. It is TCP only, so UDP traffic such as DNS leaves directly. It fails closed, so an unreachable proxy breaks connections instead of letting them go direct. The proxy must be reachable from the public internet.
Name the partner by hostname in allowOut. E2B then hands the hostname to the proxy, which resolves it. An IP-literal destination is sent as an address instead, and a proxy rule written for a hostname will not match it.
import { Sandbox } from "e2b";
const sandbox = await Sandbox.create({
network: {
// Reach only the partner, by name, and nothing else.
allowOut: ["erp.partner.example"],
denyOut: ({ allTraffic }) => [allTraffic],
// Every allowed TCP connection is dialed through this proxy.
egressProxy: {
address: "proxy.example.net:1080",
username: process.env.PROXY_USERNAME!,
password: process.env.PROXY_PASSWORD!,
},
},
});This sandbox cannot reach the model API, and that is intended. Keep the agent loop on your backend and use the sandbox only to run tools. If the loop runs inside the sandbox, its model calls need an allowOut entry too, and they would then go through the proxy as well.
Modal
A Modal Proxy is a WireGuard tunnel to exit nodes with static IPs, up to five per Proxy. You create it in your workspace settings and attach it by name. All traffic from that function or sandbox then uses it, model calls included. A Proxy set on a sandbox is not inherited by its sidecars, so set it on each one.
import modal
app = modal.App.lookup("agent-tools", create_if_missing=True)
sb = modal.Sandbox.create(
app=app,
proxy=modal.Proxy.from_name("partner-egress"),
)A Proxy with several IPs picks one at random for each run. Give the partner every address on it, not just the one you saw in a test.
Contain what the agent can reach
Once a partner allowlists your IP, traffic from it is trusted further than traffic from anywhere else. An agent decides its own requests from text it reads, and some of that text may come from an attacker through a web page, an email, or a document. OWASP calls the result Excessive Agency, with three root causes, excessive functionality, excessive permissions, and excessive autonomy. Each one has a fix that applies to tool calls on a fixed IP.
- Give the agent narrow tools with a fixed host, such as
get_invoice. Never put a generichttp_get(url)tool on the proxied client. A generic fetch on the allowlisted path lets an injected prompt use your trusted IP for anything. - Restrict the proxy credential to the partner's hosts and ports at the proxy. Then a bug or an injection in tool code still cannot reach other hosts from your IP.
- Use one proxy credential per agent or per partner. You can revoke one without breaking the others, and logs show which agent made each call.
- Ask the partner for the narrowest API key that works, such as read-only for lookup tools. OWASP's advice is to enforce authorization in downstream systems instead of trusting the model to decide what is allowed.
- Put a human approval step in front of writes that move money or change records, such as payouts, refunds, or CRM deletes.
- Keep a log of every destination and byte count per connection. When a partner asks what your agent did on a given day, you can answer from records.
What to tell the partner's security team
Partners who allowlist IPs usually ask a few questions before they add one, and an AI agent adds more. Send this in the first email and the review goes faster.
- Two IPv4 addresses, on separate hosts, and a request to add both. One address is a single point of failure, as static IP pairs and failover explains.
- A statement that both addresses send traffic for your account only, not a shared cloud or vendor range.
- The exact hosts and ports you will call, and that your proxy credential is restricted to them.
- What the agent does, roughly how often it calls, and which actions need a human to approve them.
- The authentication on top of the IP check, such as an API key, mTLS certificate, or request signature.
- A named contact, and how much notice you will give before an address changes.
- What connection records you keep, for how long, and that they hold metadata, not request bodies.
Indian banks have their own onboarding steps on top of this. See bank API onboarding and IP whitelisting in India before you start that conversation.
Doing this with Fixedmark
Fixedmark gives an app a pair of static outbound IPv4 addresses in Mumbai, Singapore, Newark, or Ashburn, reached through one proxy URL. It is in early access and not generally available yet. In the examples above, set EGRESS_PROXY_URL to your Fixedmark proxy URL, which looks like https://APP_ID:TOKEN@mum.egress.fixedmark.com:443. The Python and Node.js docs list the client versions that support this https:// proxy URL, and the AI agents use case has n8n and Deno variants.
For E2B's bring your own proxy, use the SOCKS5 endpoint on port 1080 with APP_ID as the username and TOKEN as the password. E2B's docs describe plain SOCKS5 with no TLS option, and port 1080 sends the token in cleartext, so put a destination allowlist on that credential.
- Destination allowlists restrict each credential to the hosts, CIDR ranges, and ports you list, such as
erp.partner.example:443. A denied CONNECT gets403 ForbiddenwithX-Proxy-Error: denied_by_policy. They come with the Business plan and up. - Connection logs record the destination, SNI, bytes, egress IP, result, and credential id for every connection. TLS is never decrypted and no content is stored.
- A dedicated pair comes with Pro at a planned $29 a month. The trial runs on a shared pair, so do not register its addresses with a partner. See pricing.
# Run from the same runtime as the tool. Prints the IP the partner sees.
# Run it a few times: you should only see the two IPs of your pair.
curl -sS --proxy "$EGRESS_PROXY_URL" https://fixedmark.com/api/ip
# Direct, for comparison. This is the platform's own, changing IP.
curl -sS https://fixedmark.com/api/ipTo try it before launch, join early access.
Sources
Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

