Agents secrets and variables
Why Tier 2
Credentials handed to the agent's environment. The agent and anything it runs can read them, so a prompt-injected agent can use or leak them. How bad that is depends on what each one unlocks.
Secrets and variables of the Agents type, set by repository administrators or, for many repositories at once, organization owners. They are environment variables in the agent's development environment, including copilot-setup-steps.yml; names starting with COPILOT_MCP_ only reach MCP servers.
Available on: Free (with a Copilot plan), Team (with a Copilot plan), Enterprise Cloud, EMU. Source
Attack path
An issue or comment the agent reads can tell it to print or send its environment. The firewall limits where it can send them, but setup steps and MCP servers run outside it.
Mitigations
- Decide which AI coding agents and MCP servers may work on the organization's repositories
- Give the agent only the secrets its task needs, scoped to single repositories
- Prefix secrets meant for MCP servers with COPILOT_MCP_ so the agent itself cannot read them
- Keep the agent firewall on
Detect
Nothing in the organization or enterprise audit log shows this. Review it on a schedule instead.
Related permissions
GitHub Docs: Configure secrets and variables for Copilot cloud agent