The short answer
In your organization's Settings, open Copilot. First, under Policies, set Suggestions matching public code to Block. Second, under Content exclusion, exclude secret and sensitive paths, such as "*": ["/.env"]. Third, keep MCP servers in Copilot** and the Copilot cloud agent off until you've reviewed them; both are off by default for Business. Then watch changes in the audit log with action:copilot.
Block suggestions that match public code
Copilot can suggest code that matches public code on GitHub, license and all. Blocking checks each suggestion, with about 150 characters of context, against public GitHub code and drops matches.
WhereOrganization›Settings›Copilot›Policies
- Open your organization's Settings, then Copilot, then Policies.
- Set Suggestions matching public code to Block.
- If you have an enterprise account, set it there: organization owners can't override enterprise policies.
Blocking applies to suggestions; GitHub's docs indicate it doesn't stop matching code in every Copilot surface, such as the cloud agent.
Exclude secret and sensitive files
Content exclusion stops Copilot using the files you list as context and offering suggestions in them.
WhereOrganization›Settings›Copilot›Content exclusion
- Under Repositories and paths to exclude, add patterns for secret files across all repositories, for example
"*": ["/.env", "/*.pem", "/secrets/"]. - Add whole repositories that hold regulated or highly sensitive code.
- Repository admins can add their own exclusions under the repository's Settings, Copilot, Content exclusion.
Changes take up to 30 minutes to reach open editors. GitHub says content exclusion isn't a filesystem security boundary, so keep secrets out of repositories in the first place.
Keep MCP servers and the cloud agent off until reviewed
MCP servers and the Copilot cloud agent let Copilot reach other systems and act on its own. For Copilot Business both are off by default. Keep them that way until you've decided who should have them and with what.
WhereOrganization›Settings›Copilot›Policies
- Check that MCP servers in Copilot is disabled, or enable it only once you've chosen which servers are allowed.
- Check that the Copilot cloud agent is disabled, or enabled only for the repositories that need it.
- Search the organization audit log for
action:copilotto see who changed Copilot settings and seats.
The audit log keeps 180 days and records settings, policy, license and agent activity. It doesn't record prompts.
More you can do today, for free
- Remove Copilot seats from people who have left or don't use them.
- Turn on secret scanning and push protection so secrets don't reach repositories at all.
- Require pull request review for changes made by the Copilot cloud agent, as for any contributor.
Free and open-source tools to check out
None of these needs a purchase. Read each tool's own documentation before you run it on company systems.
- OpenSSF ScorecardApache-2.0Scores a repository's security practices, such as branch protection, code review and pinned dependencies, so agent-written changes land in protected repos.
- GitleaksMITScans repositories and their history for committed secrets, such as API keys an AI agent wrote into a config file. Runs as a pre-commit hook or in CI.
- TruffleHogAGPL-3.0Finds leaked credentials across git history, buckets and chat exports, and checks whether each one still works, so you know what to rotate first.
- Semgrep Community EditionLGPL-2.1Static analysis that catches insecure patterns in code, including the code AI assistants write, before it merges.
At scale
Copilot is one agent among many: where Glasswarden comes in
GitHub's policies govern GitHub Copilot. Your developers also run Claude Code, Codex CLI and Cursor, and GitHub's audit log doesn't record what any of them did on a laptop. Glasswarden, from Drycraf, sees every agent's sessions and tool calls, holds them to one policy, and sends fixes straight back to the agent that caused the problem.
Questions admins ask
Does blocking public code matches matter for IP protection?
Microsoft's training material says the Block setting is required for GitHub's IP indemnity for Copilot. Check your own contract.
Is content exclusion a security boundary?
No. GitHub says it isn't a filesystem security boundary, and it doesn't apply to symlinks or remote filesystems. Keep secrets out of repositories with secret scanning and push protection.
Does the audit log show prompts?
No. It records Copilot settings, policy, license and agent activity for 180 days, but not prompts typed in the editor.
Sources
- Manage Copilot policies for an organization
- Suggestions matching public code
- Exclude content from Copilot
- About content exclusion
- MCP and Copilot
- Review Copilot audit logs
Checked against the vendors' own documentation on November 6, 2026. Admin consoles change: if a menu has moved, the vendor's page above is the authority. Product names are trademarks of their owners; Drycraf is independent of them.