The control breaks because HTTPS_PROXY is only a client-side hint. A subprocess, alternate transport, or NO_PROXY-listed relay can route around it without violating the process's apparent behaviour. If the kernel does not deny direct egress from the agent identity, the proxy is advisory rather than enforceable.
Why HTTPS_PROXY fails as an enforcement boundary for agent egress
HTTPS_PROXY changes where a well-behaved process sends HTTPS traffic, but it does not prove that all outbound traffic must go there. The agent can still open sockets directly, call a different library path, or use a relay excluded by NO_PROXY. Kernel-enforced egress changes the trust boundary from “asked to proxy” to “cannot leave except through approved paths”.
That distinction matters because proxy settings are advisory to the process, while kernel policy is authoritative for the host. If the question is whether the agent is actually constrained, the answer depends on whether the enforcement sits below the runtime the agent controls.
For agentic systems, that difference is not cosmetic: a single unconfined subprocess, helper binary, or alternate transport can bypass the proxy and still make external requests. A reliable design has to assume that any user-space setting can be bypassed unless the operating system or network control denies the route.
What bypass paths usually defeat proxy-only control
The most common failure modes are alternate egress paths that never consult the proxy configuration. That includes direct TCP connections, non-HTTPS transports, libraries that ignore environment variables, and child processes launched with different network behavior. A split-path design can also emerge when only some destinations are proxied and others are implicitly trusted.
This is why proxy-based egress control often looks effective in logs but still leaves the agent able to reach the internet. The control is only as strong as the weakest code path the agent can invoke. If the agent has tool access, plugin execution, or shell escape capability, it can often choose a path the original policy did not anticipate.
Kernel enforcement closes that gap by making the route a system property rather than an application convention. When the host denies direct egress, the proxy becomes the only permitted path instead of a preferred path. That also makes policy failures easier to detect because an attempted direct connection is blocked rather than silently succeeding.
What secure egress control should look like for AI agents
A defensible control model separates policy intent from transport mechanics. The agent should not merely be configured to use a proxy, it should be prevented from reaching the network except through an approved enforcement point. Zero Trust for AI Agents is useful here because it frames egress as a policy decision attached to the agent’s identity and request, not a convenience setting.
When the agent can initiate tool calls or external requests, authorization has to be per action, not implied by the process environment. AI Agent Authorisation Guide helps when you need to align least privilege with runtime decisions, especially where a tool can make outbound connections on the agent’s behalf.
If you are assessing the broader control surface, Agentic AI Security Guide is the better lens for the combination of inputs, tools, orchestration and identity. In practice, egress control belongs in the same containment story as tool permissions, because the same runtime that can call a tool can often attempt a network escape.
Risk and Threat Considerations
Proxy-only egress control creates a false sense of containment. If the agent can still open a direct connection, exfiltrate data, call external APIs, or retrieve malicious content, the proxy policy becomes a logging aid rather than a security boundary.
Failure mechanism: The agent or one of its subprocesses bypasses the proxy by using a direct socket, alternate transport, or an excluded destination, while the host still allows outbound connectivity.
Impact: Attackers or faulty agent behavior can leak secrets, reach unauthorized services, or move outside the intended monitoring path without triggering the proxy control.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-04 — Insecure Authentication | Proxy-only egress depends on runtime trust that can be bypassed by the agent. |
| NHI-05 — Overprivileged NHI | Agents that can bypass proxy settings effectively hold excess network privilege. | |
| NHI-06 — Insecure Cloud Deployment Configurations | Misplaced trust in proxy configuration is a deployment control weakness for agent egress. | |
| Recommendation — Enforce host-level egress denial so agent network use cannot rely on environment settings. Reduce agent network privilege to approved destinations and routes only. Move outbound control from application config to enforced network or host policy. | ||
| NIST SP 800-53 Rev 5 | AC-4 — Information Flow Enforcement | Egress control is an information-flow problem requiring enforceable routing constraints. |
| IA-9 — Service Identification and Authentication | Agent egress should be tied to the authenticated service identity making the request. | |
| SC-7 — Boundary Protection | A proxy is only effective when boundary controls prevent alternate direct paths. | |
| Recommendation — Enforce approved outbound flows at the host or network boundary. Bind outbound authorization to the agent identity before allowing network access. Block direct egress paths so boundary policy cannot be bypassed. | ||
| NIST Zero Trust (SP 800-207) | SC-7 — Boundary Protection | Zero trust requires enforced, not assumed, control over outbound connections. |
| Recommendation — Place egress under explicit policy enforcement instead of trusted client settings. | ||
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | The issue is the agent using more network authority than intended. |
| ASI02 — Tool Misuse | A proxy bypass is a misuse path for tools that can generate external requests. | |
| Recommendation — Constrain agent actions so network reach stays within explicit privilege bounds. Restrict tools so outbound calls cannot escape approved policy paths. | ||
Practitioner Guidance
What to verify: Test the control from the agent’s actual runtime, not from a workstation shell. Confirm that direct outbound connections fail even when the agent spawns child processes or uses a different HTTP stack.
What good looks like: A blocked direct egress attempt produces a clear denial at the host or network layer, while approved traffic is forced through the intended enforcement point and is attributable to the agent identity.
Common mistake: Treating environment variables as network policy. If the policy can be removed, overridden, or bypassed by runtime behavior, it is configuration, not enforcement.
Practitioner takeaway: Use HTTPS_PROXY for routing convenience and observability, but treat kernel or network-layer denial as the real control whenever agent egress must be constrained.
Related resources from NHI Mgmt Group
- What breaks when an autonomous AI agent is the attacker instead of a human?
- What breaks when AI agent access is managed per server instead of centrally?
- What breaks when AI agent findings are sent to the SIEM instead of cases?
- What breaks when AI agent baselines are defined per pod instead of per deployment?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org