Egress filtering means checking traffic leaving a network and only letting it go to approved places.
This guide is for students, small business owners and anyone new to IT who knows firewalls keep attackers out, but wonders about the way out. You do not need to run a network to be affected: if your business uses cloud apps or AI tools, data leaves it every day.
In short
- Most security talk is about stopping things coming in. Egress filtering controls what goes out.
- Many networks let outgoing traffic go anywhere unless someone changes the settings.
- If an attacker or a tricked AI agent gets in, it still needs a way out to send data away. Egress filtering narrows that way out.
- Start by listing the places your systems really need to reach, then allow those and question the rest.
What you will learn
- Explain the difference between incoming and outgoing traffic.
- Spot why an open way out is a risk, even with a good front door.
- Check whether your systems can reach any website they like.
- Ask what an AI agent is allowed to connect to.
- Outgoing traffic (egress)
- data leaving your network or computer for somewhere on the internet.
- Approved list (allowlist)
- a list of places that are allowed. Anything not on the list is blocked or checked.
- Data theft (exfiltration)
- moving data out of an organisation without permission.
What is egress filtering?
Think of a warehouse where a guard checks bags on the way out. The front gate stops strangers walking in. The exit check stops stock walking out.
A firewall often focuses on the front gate. It blocks unwanted traffic coming in from the internet. Egress filtering is the exit check. It looks at traffic leaving your network and asks: is this going somewhere it should?
The simplest rule is "allow only what we need". A shop's till might only need to reach its card payment service. If it suddenly tries to send data to an unknown website, the filter can block it and raise an alert.
Where the comparison stops working: a guard can open a bag and see what is inside. Most traffic is scrambled for privacy, so a filter often sees only where it is going, not what it carries. That is why the destination matters so much.
Why does it matter?
Attackers who get in usually need to send something back out. It might be stolen files, passwords or a message to their own server. AI agents add a new twist. Hidden notes in what an agent reads can trick it into sending data away. So where it can connect matters as much as what it can read.[4]
If you run a small business
What could happen: a hacked till or office computer quietly sends customer data to a stranger's server.
Check this: ask your IT supplier whether your firewall controls outgoing traffic, or only incoming.
Next: Firewalls for Beginners
If your team uses AI agents
What could happen: an agent reads a web page with hidden instructions and sends your files to an outside address.
Check this: ask which websites and services the agent can reach, and whether that list is as short as possible.
If you are new to IT or cloud work
What could happen: you build a cloud server and leave the default setting, which lets it connect anywhere.
Check this: look at the outgoing rules, not just the incoming ones, on everything you build.
What does it look like?
Here is a made-up set of outgoing rules for an AI agent that helps a small firm answer customer emails.
Example only. All values are made up.
# Outgoing rules: support-helper agent (EXAMPLE) ALLOW mail.example.com email service (1) ALLOW crm.example.com customer records (2) ALLOW ai-model.example.com AI model provider (3) BLOCK everything else (4) ALERT on any blocked attempt (5) # reviewed 0000-00-00 by FAKE-OWNER
- In a real file, this line would contain the address of the firm's email service.
- The customer records system the agent needs to read.
- The AI service that powers the agent.
- Any other destination is refused. This is called deny by default.
- A blocked attempt is a clue that something odd is going on, so someone is told.
Why this is risky: without these rules, the agent could connect to any website. Say a hidden note told it to send files to a stranger. Nothing would stand in the way.
The safer way: keep a short approved list for each system or agent. Review it regularly, and investigate blocked attempts rather than just widening the list.
How does it work?
Egress filtering usually works like this.
- Something inside wants to connect out. A laptop, server or AI agent asks to reach an address on the internet.
- The request passes a checkpoint. This may be a firewall, a filter on web addresses, or a proxy (a middle point that makes the connection on the system's behalf).
- The rules are checked. Common rules block everything by default, allow only certain destinations, or allow only certain kinds of traffic.[1]
- The traffic is allowed or blocked. Allowed traffic carries on. Blocked traffic is stopped.
- The result is recorded. Logs show who tried to reach where. Blocked attempts can point to an attack or a mistake.


Many systems start wide open. For example, in one large cloud provider, a new set of firewall rules allows all outgoing traffic until someone changes it.[2] AI tools are moving the other way. One AI coding service blocks its agent from the internet by default while it works, and lets teams allow only the websites they need.[4] Guidance for a popular way of connecting AI tools to other services also suggests routing some outgoing requests through a checkpoint that blocks internal addresses.[3]
A worked example
Dario Varga runs Larkspur Print, a made-up printing firm with twenty staff. His IT supplier is Uma Corrigan. Last month the firm started using an AI agent to read customer emails and draft replies.
Uma reads that AI agents can be tricked by hidden instructions in emails or web pages. She thinks of the warehouse exit check. The front door is locked, but what stops the agent carrying files out?
She checks the network. The agent, like every computer in the office, can reach any website. Nobody ever set outgoing rules.
Uma and Dario list what the agent really needs. It is three things: the email service, the customer records system and the AI provider. Uma sets the agent's outgoing rules to allow those three and block everything else. She turns on alerts for blocked attempts.
She does not switch it on blindly. For one week she runs the rules in "record only" mode. That way she sees what the agent tries to reach, without breaking anything. One extra address shows up: a spelling-check service the agent uses. Dario approves it, and she adds it to the list.
Two weeks later, an alert fires. A customer email contained hidden text asking the agent to upload order files to an unknown website. The upload was blocked. Uma removes the email, reports it to the AI provider and adds the sender to the spam filter.
Dario asks her to do the same for the office computers next.
Myths and mistakes
| What people think | What is true |
|---|---|
| A firewall already controls everything. | Many firewalls are set up mainly for incoming traffic. Check the outgoing rules too. |
| Outgoing traffic is our own, so it is safe. | Attackers and tricked AI agents use your own systems to send data out. |
| Blocking one bad website is enough. | There are endless bad websites. Allowing only approved places works better. |
| Egress filtering will break everything. | Start in record-only mode, learn what is really needed, then switch on blocking. |
| An AI agent only does what we ask. | Hidden instructions in content it reads can change what it tries to do. |
What can I do this week?
- Ask your IT supplier whether your firewall has outgoing rules.
- Pick one important system and list the places it really needs to reach.
- Find out which websites and services each AI agent can connect to.
- Check that blocked outgoing attempts are logged and that someone looks at them.
Checklist
- Outgoing rules exist, not only incoming ones.
- Important systems can reach only the places they need.
- Each AI agent has its own short approved list.
- New rules are tested in record-only mode before blocking.
- Blocked attempts are logged and reviewed.
- Approved lists have an owner and a review date.
- Requests to widen a list are approved and recorded.
Common questions
What is the difference between ingress and egress?
Ingress is traffic coming into your network from outside. Egress is traffic leaving your network for somewhere else. Most people think about blocking bad traffic coming in. Egress filtering adds a check on the way out, so stolen data has fewer places to go.
Does egress filtering stop all data theft?
No, but it makes theft harder. Attackers may try to hide data inside traffic to allowed services, or use a device outside your network. Egress filtering works best alongside other controls, such as limiting what each system can read and watching for unusual activity.
Why does egress matter for AI agents?
Because an AI agent can be tricked by hidden instructions in a document, email or web page. If it can connect anywhere, it may send data to an attacker. A short approved list means that even a fooled agent has few places to send things.
Is egress filtering only for big companies?
No. Many small business firewalls and cloud services have outgoing rules you can switch on. We suggest starting with one important system, such as the payment till or an AI agent, and growing from there. Your IT supplier can usually help.
What is a proxy in egress filtering?
A proxy is a checkpoint that outgoing web traffic passes through. The proxy makes the connection on the system's behalf, checks its rules first and keeps a record. It lets a team control and see outgoing traffic in one place.
Where next?
Ready for the detail? Read the practitioner guide: Agent Egress Control and Network Isolation Guide. It goes further into the ways agents leak data, how to design approved lists for each agent and how to roll out and monitor the controls.
Also useful:
- Cloud Egress Filtering
- Data Exfiltration for Beginners
- Data Loss Prevention for Beginners
- Prompt Injection for Beginners
- AI Agents for Beginners
Related NHI Mgmt Group resources: AI Agent Sandboxing and Code Execution Guide · Firewalls for Beginners · Non-Human Identities for Beginners
Key terms
- Egress filtering
- Rules that control where data from a network is allowed to go.
- Data egress
- Data leaving a network for somewhere outside it.
- Firewall
- A filter that decides which network traffic is allowed in or out, using a set of rules.
- Allowlist
- A list of approved places or items. Anything not on it is blocked or checked.
- Deny by default
- A rule that blocks everything unless it has been approved.
- Egress proxy
- A checkpoint that outgoing web traffic must pass through, where rules decide what may leave.
- Data exfiltration
- Moving data out of an organisation without permission.
- Indirect prompt injection
- Hidden instructions placed in content an AI reads, such as a web page or email, to change what it does.
Sources and further reading
- Outbound Traffic Filtering (D3-OTF). MITRE D3FEND. https://d3fend.mitre.org/technique/d3f:OutboundTrafficFiltering/, accessed 28 Nov 2026.
- Security group rules. Amazon VPC User Guide, Amazon Web Services. https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html, accessed 28 Nov 2026.
- Security Best Practices (draft specification). Model Context Protocol. https://modelcontextprotocol.io/specification/draft/basic/security_best_practices, accessed 28 Nov 2026.
- Agent internet access. OpenAI Codex documentation. https://learn.chatgpt.com/docs/cloud/internet-access, accessed 28 Nov 2026.