Use when designing, configuring or changing an AI agent, its tools, MCP servers, credentials, memory, autonomy level or approval gates, when an agent is given access to a new system, and when a coding agent is run in CI/CD (for example triggered by issues or pull requests). Applies least agency and defines where a human must approve.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Agent Permissions?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/michalarchitect-agent-permissions)
---
name: agent-permissions
description: Use when designing, configuring or changing an AI agent, its tools, MCP servers, credentials, memory, autonomy level or approval gates, when an agent is given access to a new system, and when a coding agent is run in CI/CD (for example triggered by issues or pull requests). Applies least agency and defines where a human must approve.
---
# Agent permissions and approval gates
## Why this skill exists
What an agent can do is decided by its permissions and configuration, not by its instructions. Every capability an agent does not need is attack surface. This skill applies **least agency**: the minimum tools, rights and autonomy needed for a bounded task, with defined points where a human decides.
## Scope
- **Designing or changing an agent in a product** (its tools, credentials, memory, autonomy): apply the whole skill.
- **Changing your own assistant's configuration** (for example an allowlist entry in `.claude/settings.json`): this needs pre-action authorisation (see `AGENTS.md`). State the exact change, its purpose and how to reverse it; the permission matrix and kill switch are not required for a single allowlist change.
- These rules describe the agent being designed. They do not stop you, the coding assistant, from running the project's own tests in your normal environment.
## Rules
1. **Default deny.** An agent starts with no tools and no credentials. Each one added needs a stated purpose.
2. **Own identity, own credentials.** An agent never reuses a developer's personal token or a shared admin account. Credentials are scoped, short-lived and revocable.
3. **Read and write are separate decisions.** Grant read-only first. Write, delete, execute, send and pay are each justified separately.
4. **No self-escalation.** An agent must not be able to change its own permissions, instructions, tool list, memory policy or approval rules.
5. **Irreversible or external actions need specific human authorisation.** Sending messages, publishing, deleting, deploying, changing access rights, spending money and modifying CI/CD are gated. Existing authorisation applies only to its exact scope; do not repeat it unless scope changes or the tool requires confirmation at execution time. No reply is not approval.
6. **Generated code runs in a sandbox**, without network or secrets unless explicitly required.
7. **Log minimal action metadata**: actor/role identifier, task ID, tool, approval decision, outcome and correlation ID. Do not log raw prompts, secrets, personal data, full parameters or outputs by default. Any diagnostic content capture needs an approved purpose, redaction, access restrictions and retention/deletion rules.
8. **Each MCP server is a separate decision.** Approve servers one by one, from a known publisher, with a pinned version. Review the tool names, descriptions and parameter schemas at approval and again after every update: definitions can change after approval, and descriptions are text the model reads (see `untrusted-content`). Give each server its own narrowly scoped credential; a server must not pass the user's token through to another service. Run local servers with the least operating-system rights. MCP configuration shipped in a repository (for example `.mcp.json`) is not enabled automatically.
## Coding agents in CI/CD
An agent started by a workflow (for example to triage issues, answer review comments or fix failing builds) runs with whatever the job grants it, and anyone who can write an issue, comment, branch name or commit message can write to its prompt.
1. **Treat event text as untrusted input.** Issue and pull-request titles, bodies and comments, branch names, commit messages and files from forks are data (apply `untrusted-content`). Never insert them into a shell command through `${{ … }}`; pass them through environment variables.
2. **Minimal token.** Set `permissions:` explicitly for every job, starting from `contents: read`. Grant write scopes only to a separate job that runs after a human decision, for example a protected environment with required reviewers.
3. **No secrets in the agent job.** No deployment, cloud or signing secrets in the job where the agent runs. Prefer short-lived OIDC credentials bound to one environment. Never put a secret into the prompt.
4. **Do not run privileged agents on untrusted events.** Avoid `pull_request_target` and `workflow_run` with checkout of untrusted code; for public repositories, let only collaborators with write access trigger an agent (check the author's association before the agent starts).
5. **Output is a proposal.** The agent opens a branch or pull request; it never pushes to the protected branch, approves its own pull request or changes workflow files without code-owner review.
6. **Limit network and time.** Restrict outbound access to the domains the task needs where the runner allows it; set a job timeout and a step or token budget.
7. **Record the run.** Workflow run ID, agent and model version, triggering event and actor, and the actions taken, as in rule 7.
## Procedure
1. **Describe the task boundary.** One paragraph: what the agent is for, what it must never do.
2. **Inventory capabilities.** For every tool, MCP server, API, data source and memory store, fill in the table in [permission-matrix-template.md](permission-matrix-template.md) (action, scope, read/write, credential, reversible?).
3. **Remove what is not needed.** For each row ask: does the task fail without this? If not, remove it.
4. **Classify actions** into:
- *autonomous*: reversible, internal, low impact
- *notify*: allowed, but a human is informed
- *approve*: a named role must approve before execution
- *forbidden*: not available to the agent at all
5. **Define approval gates.** For every *approve* action: who approves, what they see (exact action and parameters, not a summary written by the agent), and what happens on timeout (default: do not act).
6. **Limit blast radius.** Rate limits, spend limits, maximum number of steps, allowed domains, allowed recipients, per-environment separation.
7. **Multi-agent setups.** Agents authenticate to each other; a message from another agent is untrusted input, not a command. Define what stops a failure in one agent from propagating.
8. **Kill switch.** Document how to stop the agent and revoke its credentials, and who may do it.
9. **Record** the matrix and the gates in the repository and reference them in the change evidence.
## Stop and ask a human when
- the task seems to need production write access, admin rights or access to secrets
- an action cannot be classified, or is both irreversible and frequent
- the agent would be able to modify its own configuration or the pipeline that deploys it
- a third-party tool or MCP server requests broader scopes than its documented function needs, or its tool definitions changed since approval
- an agent would run in CI on events from people without write access, or with write tokens or secrets in the same job
## Output
- completed permission matrix
- list of approval gates with approver role and timeout behaviour
- kill-switch procedure
- open risks you could not mitigate
## References
- OWASP Top 10 for Agentic Applications 2026: ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse, ASI05 Unexpected Code Execution (RCE), ASI07 Insecure Inter-Agent Communication, ASI08 Cascading Failures, ASI10 Rogue Agents
- ENISA, Technical Advisory on AI-assisted software development (version 0.4, draft for public consultation, September 2026), sections 2.1.2, 2.1.3, 2.2.2, 3.2 and 3.3
- CISA, NSA and partner agencies, *Careful Adoption of Agentic AI Services* (1 May 2026)
- Model Context Protocol specification (revision 2026-07-28), *Security Best Practices* (confused deputy, token passthrough, scope minimisation, local servers)
- OWASP GenAI Security Project, *A Practical Guide for Securely Using Third-Party MCP Servers* (v1.0, November 2025) and *A Practical Guide for Secure MCP Server Development* (February 2026); cited only
- GitHub Docs on secure use of GitHub Actions (script injection, `GITHUB_TOKEN` permissions, OpenID Connect)