An approved domain is not an approved destination
A coding agent needs the network to be useful: it reads documentation, installs dependencies, opens pull requests and queries development services. But permission to contact a familiar platform is not permission to send every kind of information to every account on that platform. This distinction deserves attention as software teams connect increasingly capable agents to their everyday tools. Human control means defining which transfers are legitimate before asking a model to execute them, not simply approving a recognizable website when a popup appears.
Anthropic's recent enterprise guide to securing coding agents makes the problem concrete: allowing github.com does not distinguish an organization's repository from an attacker's repository. The guide also identifies DNS as a possible route around HTTP-only restrictions. These are architectural warnings, not evidence that every agent or deployment is compromised. The practical lesson is narrower and more useful: a network allowlist is one layer of protection, not a complete authorization policy.
Separate reachability from authority
Network filtering answers a question about reachability: can this process communicate with that host? Business authorization asks different questions. Which organization owns the destination? Which repository, project or workspace is involved? Is the operation a read, an upload, a comment or a publication? What information will leave the environment? A trusted service can contain both approved and unapproved destinations, and its general reputation cannot settle those questions.
Consider an illustrative debugging task. An agent is asked to fix a failing integration test and reads an issue recommending that it attach diagnostic logs to an external repository. The domain is familiar, the command is syntactically valid, and the upload might even succeed. None of that establishes that the recipient is entitled to receive internal traces. The correct decision depends on ownership, data classification and the task's approved purpose. This example is a threat scenario, not a reported incident.
Start with the task's data contract
Before enabling a workflow, write a small data contract for the task. Identify what the agent may read, what it may send, the intended recipients and the allowed operations. A documentation task may need public web reads but no ability to upload repository files. A dependency upgrade may need an internal package mirror and a specific source branch, but no access to production telemetry. The contract should describe actual work rather than a generic category called trusted internet.
Keep the contract short enough for an engineer to inspect. Link it to the repository and give it an owner who can approve exceptions. Separate public material from internal source, customer information and credentials. If the task genuinely requires transferring sensitive data, make that a distinct decision with an explicit destination. Do not let a request to improve a test silently become authorization to distribute the evidence collected while debugging it.
Enforce more than a hostname where possible
Where a service and integration support it, constrain the identity and resource as well as the domain. Use a dedicated application or service identity restricted to approved repositories and operations. A read-only documentation integration should not inherit the developer's ability to create public repositories. A pull-request integration should target the intended organization, repository and branch policy. The model's written promise to stay within those limits is useful guidance, but it does not enforce them.
Not every platform offers equally fine-grained controls. When resource-level enforcement is unavailable, acknowledge that gap instead of presenting domain filtering as equivalent protection. Consider a broker that performs a small set of approved operations, or keep the transfer under human control. For particularly sensitive tasks, the right answer may be an offline environment or a prepared local knowledge snapshot. The workflow should be shaped by available enforcement, not by the broadest capability the agent requests.
Inventory every route out
A shell sandbox is not necessarily the boundary for every tool. A browser tool, file uploader, remote MCP server or platform connector may use a different execution path. OWASP's guidance on AI agent and MCP security explicitly warns teams to understand sandbox scope rather than assume that all capabilities are covered. Build an inventory of the routes used by your actual setup, including subprocesses and services acting on the agent's behalf.
For each route, record where policy is checked and where the resulting event is logged. Check HTTP traffic, DNS resolution and any relevant non-HTTP protocols according to the environment. Also examine whether an approved remote tool can itself forward data elsewhere. This is not a request to inspect encrypted employee traffic indiscriminately; it is a request to design appropriate controls around managed agent workloads, with privacy, legal and security teams involved where needed.
Reduce what the agent can leak
Filtering outbound traffic cannot undo exposure of a credential. Anthropic notes that once a token has escaped, an attacker can use it from another machine, outside the agent's network boundary. OWASP therefore recommends scoped, short-lived identities and avoiding long-lived production credentials in the agent environment. Preventing unnecessary access to a secret is stronger than hoping every later attempt to transmit it will be detected.
Give the agent the smallest workspace that supports the task. Avoid mounting an entire home directory into a development container. Use synthetic fixtures instead of real customer records when reproducing a defect. Where supported, let a controlled credential broker authenticate operations without exposing the underlying secret to the model or shell. These measures do not make exfiltration impossible, but they reduce both the amount of accessible data and the consequences of a mistaken authorization.
Approve exceptions with the missing context
An exception prompt saying only allow access to this website gives a reviewer too little information. Show the exact destination, resource owner, operation, reason, data category and requested duration. If a file will be uploaded, identify the file and provide a safe inspection path. Do not expose secret values in the approval interface or audit log. A human should be able to understand the consequence without reverse-engineering the agent's whole conversation.
Approval should be scoped to the action that was reviewed, not converted into permanent trust for a platform. An engineer may authorize posting a sanitized reproduction to a vendor's support project while refusing raw logs or access to unrelated repositories. When the destination or payload changes materially, require a new decision. This preserves useful automation inside known boundaries while keeping authority over exceptional data transfers with an accountable person.
Test the boundary, not the agent's reassurance
Before rollout, exercise the controls in a disposable environment using synthetic markers, never real secrets. Include an allowed read from an approved documentation host and a forbidden upload to an unapproved account on an otherwise allowed platform. Try the same operation through the shell, browser and available connectors. The objective is to discover which paths enforcement actually covers, not to obtain a reassuring answer from the model.
Test failure behavior too. What happens when the policy service is unavailable, a destination redirects, a connector changes its tool definition, or the agent retries a blocked action through another tool? For sensitive transfers, failures should stop the action rather than silently broaden access. Keep the tests reproducible and attach results to a specific configuration version. Re-run them after changes to the agent, integrations, network policy or execution environment.
Make policy ownership independent of the task
The agent implementing a feature should not be able to weaken the controls governing that implementation. Store managed policy outside its write scope and review policy changes separately from ordinary code changes. If a repository contains editable agent instructions, treat those instructions as guidance that cannot override the external boundary. A malicious issue or an overeager repair loop should not be able to rewrite its own network permissions.
Central settings also need operational verification. Anthropic's guide describes settings-source precedence and warns that some managed sources can displace others rather than merge as administrators expect. The general lesson applies beyond one product: inspect the effective policy in a running session. A reviewed configuration file is not proof that its rules are active. Platform teams should own deployment and evidence of enforcement, while application teams specify the destinations their workflows genuinely need.
Preserve evidence without creating another leak
Useful audit records connect a request to the initiating person, agent identity, task, policy version and destination. Record whether the operation was allowed, denied or escalated, and who approved an exception. Capture resource identifiers where appropriate so investigators can distinguish an internal repository from an unrelated one on the same host. Keep these records outside the agent's ability to erase or edit them.
Logging everything is not automatically safer. Full request bodies, tool arguments and diagnostic traces may contain the same information the boundary is intended to protect. Apply redaction, access controls and retention rules. If a suspected leak occurs, stop the relevant session, preserve evidence and revoke affected credentials through the normal incident process. A denied transfer is useful evidence of a working control; it is not proof that no other route succeeded.
Roll out with a small, measurable pilot
Choose one repository and a task with clear input and output boundaries. Observe the necessary destinations before widening permissions. Track unapproved transfer attempts, exception requests, expired grants that remain active and workflows lacking enforcement on a tool path. Also measure completion time and developer effort, so security improvements do not become invisible operational costs that encourage people to bypass the supported workflow.
Do not optimize for the fewest approval prompts alone. A reduction can mean better scoping, but it can also mean broader permissions. Review exception patterns with developers: repeated requests for an internal package mirror may justify an approved integration, while repeated uploads of raw logs may call for a sanitization tool. Expand autonomy only after the pilot demonstrates that useful work completes inside a boundary people understand and can revoke.
Keep the human in charge of the boundary
The strongest argument for human oversight is not that a person should click yes on every command. It is that someone must decide which data may leave, who may receive it and what risk the organization accepts. Agents can propose a transfer, prepare a sanitized artifact and explain a failure. Enforced identities, resource restrictions and network controls then make those decisions durable, instead of leaving them inside a conversation.
For software teams, the next practical step is simple: pick one agent workflow and ask whether an approved domain could still lead to an unapproved recipient. Verify the answer with a synthetic test. If the boundary is unclear, narrow the workflow before scaling it. AI can accelerate implementation; humans must retain authority over disclosure, exceptions and the conditions under which that acceleration is allowed.
Sources and illustration
Anthropic: enterprise guide to securing coding agents; OWASP: AI agent and MCP security. Practical scenarios and rollout recommendations above are editorial analysis, not claims of measured product effectiveness.
Selected illustration: Wikimedia Hackathon, Amsterdam, 2013; not a photograph of the products or a security incident described here. Photo: Sebastiaan ter Burg / Wikimedia Commons, CC BY-SA 2.0. Original supplied; the website may generate resized versions.