Egress filtering is a security practice in which traffic leaving a network or an individual host is inspected so that only pre-approved destinations, ports, and protocols are allowed through and everything else is blocked. It is the counterpart of ingress filtering, which screens incoming traffic, and is implemented with firewalls, proxies, and router access control lists.
Its purpose is to make it harder for an attacker who has compromised a server to exfiltrate data to an external server, contact a command-and-control server, or download additional malware. In environments running AI agents or automated jobs, it is also used to explicitly restrict which external services an agent can reach.