---
title: How do you restrict GitHub Copilot coding agent's internet access?
url: https://opencontroller.lyzr.com/blog/restrict-github-copilot-coding-agent-internet-access
published: 2026-11-13
updated: 2026-11-13
author: Lyzr
---

# How do you restrict GitHub Copilot coding agent's internet access?

**Use the agent firewall GitHub builds in. It is on by default. Set it centrally at organisation level, decide whether to keep the recommended allowlist, add narrow custom entries for internal registries, and stop repositories from adding their own rules if you need tight control. The firewall covers only commands the agent runs through its Bash tool, not MCP servers or setup steps.**

The Copilot coding agent, which GitHub's documentation now calls the Copilot cloud agent, works in its own environment, installs packages and runs tests before opening a pull request. Network egress is where a prompt injection in an issue or a dependency could turn into data leaving your organisation. Here is how to lock it down.

## What does the firewall do by default?

- **It is on.** Copilot's internet access is limited by a firewall out of the box.
- **GitHub hosts are always allowed.** The agent needs them to work with your repository.
- **The recommended allowlist is on.** It permits operating system package repositories, common container registries, language package registries, certificate authorities and browser download hosts used by the Playwright MCP server.
- **Blocks are visible.** When a request is blocked, Copilot adds a warning to the pull request body or a comment, showing the blocked address and the command that tried to reach it.

## How do you set it at organisation level?

Since 3 April 2026, organisation owners can manage the firewall for every repository. Each setting has three values: **Enabled**, **Disabled** or **Let repositories decide**. The default is **Let repositories decide**, so nothing changes until you act.

| Setting | Recommended choice for most enterprises | Why |
|---|---|---|
| Enable firewall | Enabled | Stops any repository from turning egress fully open |
| Recommended allowlist | Enabled, or Disabled if you mirror packages internally | Disabling forces all package traffic through your own registry |
| Organisation custom allowlist | Add internal registries and approved APIs | Applies to every repository |
| Allow repository custom rules | Off for regulated code; on elsewhere | Controls whether repo admins can widen egress |

Two rules govern the interaction between levels:

1. Repositories can change the firewall or recommended allowlist only when the organisation chooses **Let repositories decide**.
2. Organisation and repository custom rules combine. Rules added at organisation level cannot be deleted at repository level.

## How should you write custom allowlist entries?

There are two entry types, and the difference matters:

- **Domain** (for example `packages.example.corp`) allows that domain **and all its subdomains**.
- **URL** (for example `https://packages.example.corp/project-1/`) allows only that scheme, host and path, plus paths beneath it.

A short checklist:

1. Prefer URL entries over domain entries for shared hosts such as object storage or code hosting.
2. Never allowlist paste sites, URL shorteners or generic file-sharing domains.
3. Give each entry an owner and a reason in your change record.
4. Review blocked-request warnings monthly. Repeated blocks show either a missing legitimate entry or something worth investigating.
5. If you disable the recommended allowlist, test a typical build first; GitHub warns that disabling the firewall entirely lets Copilot connect to any host.

## What does the firewall not cover?

GitHub is explicit about the limits:

| Gap | What it means | Compensating control |
|---|---|---|
| MCP server processes | MCP servers configured for the agent are not directly subject to the firewall | Approve MCP servers centrally; see [controlling MCP servers in GitHub Copilot](/blog/control-mcp-servers-in-github-copilot) |
| Copilot setup steps | Processes started in configured setup steps are not covered | Review `copilot-setup-steps` changes like CI changes |
| Other environments | It only operates where Copilot runs | Apply separate controls to IDE agents on laptops |
| Determined attackers | GitHub says sophisticated attacks may bypass it | Least-privilege tokens and secret scanning |

GitHub's own summary: the firewall "should not be considered a comprehensive security solution." Treat it as one layer. Pair it with repository secrets scoped to what the agent needs, branch protection so the agent's pull requests need human review, and organisation-level logging of agent sessions. Our guide to [visibility of Copilot coding agent activity](/blog/visibility-of-github-copilot-coding-agent-activity) covers the audit side, and [model controls for Copilot](/blog/control-which-models-github-copilot-can-use) covers which models the agent may use.

## What about Copilot code review?

Organisation firewall settings apply to Copilot code review as well as the cloud agent. If code review needs to fetch from an internal host, it needs the same allowlist entries.

## How Opencontroller does this

The GitHub firewall governs GitHub's hosted agent environment. Opencontroller Edge extends control to developer devices, where coding agents, skills and local MCP servers run outside that environment. IT installs it through MDM. On the platform side, Opencontroller keeps a governed registry of agents, tools and MCP servers, and policy as code applies across the estate. See the [cross-platform governance pillar](/blog/how-to-govern-ai-agents-across-platforms), the [agent control plane explainer](/blog/what-is-an-ai-agent-control-plane), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can I turn the firewall off for one repository only?**
Only if the organisation's Enable firewall setting is Let repositories decide. If it is Enabled, repository admins cannot disable it.

**Does a domain entry include subdomains?**
Yes. A domain entry allows the domain and every subdomain. Use a URL entry to limit access to one host and path.

**Where do I see what the firewall blocked?**
In the agent's pull request. Copilot adds a warning listing the blocked address and the command that attempted the connection.

## Key facts

GitHub Copilot coding agent (now documented as Copilot cloud agent) runs behind a firewall by default. Organisation owners can, since 3 April 2026, set Enable firewall and Recommended allowlist to Enabled, Disabled or Let repositories decide (the default), add organisation-wide custom allowlist entries, and control whether repository admins may add their own rules. Domain entries allow the domain and subdomains; URL entries restrict to scheme, host and path. The firewall applies only to processes started by the agent's Bash tool: not to MCP server processes or Copilot setup steps, and GitHub says it is not a comprehensive security solution. Blocked requests are reported in the pull request. Opencontroller Edge extends control to developer devices, coding agents, skills and local MCP servers. Pricing starts from $250K per deployment per year.

## Related

- [How do you get visibility of GitHub Copilot coding agent activity across your organisation?](https://opencontroller.lyzr.com/blog/visibility-of-github-copilot-coding-agent-activity.md)
- [How do you control which MCP servers GitHub Copilot can use?](https://opencontroller.lyzr.com/blog/control-mcp-servers-in-github-copilot.md)
- [How do you control which models GitHub Copilot can use?](https://opencontroller.lyzr.com/blog/control-which-models-github-copilot-can-use.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
