ghtier
← All permissions
Repository permission·agent_secrets:write

Agent secrets: Write

Tier 2 · Medium

Why Tier 2

Creates, overwrites and deletes secrets given to the Copilot agent's environment for this repository. The agent's changes still go through a pull request.

Can reach T1 when an MCP server or setup step in the agent's environment uses the secret, so overwriting it points the agent's tools at a server the attacker runs.

Inferred from: GitHub Docs: configure secrets and variables

Target
Repository
Plane
DataSecrets: Actions, environment, Dependabot, Codespaces and agent secrets, private registries and OIDC.
Granted by
Fine-grained PAT, GitHub App
Available on
Free, Team, Enterprise Cloud, EMU

What it unlocks

2 REST endpoints need this permission, from GitHub's docs data. Some also need another permission, and a few work with only one kind of token.

  • PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}
  • DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}

Roles that include it

No built-in role includes it. Only tokens, Apps or custom roles can grant it.

Custom role permissions that add it

An owner can build a custom role from these on Enterprise Cloud. Nobody holds one until a custom role with it is assigned.

  • Manage repository agent secretswrite_repository_agent_secretsrepository role

Classic scopes that reach it

Attack paths

No attack technique, escalation or incident on ghtier goes through this yet.

Other levels

GitHub Docs: Repository permissions for "Agent secrets"