# Agent Permissions

> The Agent Permissions are rules that define which actions an AI agent may perform with or without user approval.

## How do I set permissions for an AI coding agent?

The settings that allow, ask about or deny specific tools, commands, files and network access for an agent. Safe read-only actions can be allowed automatically, while deleting files, pushing code or deploying require approval.

- Topic: Agent Customization
- Type: concept

## Example

Wrong:

```json
{
  "permissions": {
    "allow": ["Bash(*)"]
  }
}
```

Right:

```json
{
  "permissions": {
    "allow": ["Bash(npm test)", "Bash(npm run lint)", "Bash(git status)"],
    "ask": ["Bash(git push:*)"],
    "deny": ["Read(./.env)", "Bash(rm -rf:*)"]
  }
}
```

Specific allow rules remove prompts for safe commands, while risky actions still ask and secret files stay blocked.

## Common mistakes

- Allowing all shell commands to stop approval prompts, which also allows destructive ones.

## Key points

- Read-only actions are allowed, while deleting, pushing and deploying require approval.
- Rules are specific, such as one allowed command, not a wildcard that allows every shell command.
- Deny rules cover secret files like '.env' and credential folders.

## Interview questions

### Is it safe to skip all permission prompts?

Only inside a strong sandbox with no secrets and no network. On a normal machine it lets any command run, including destructive ones.

### What is the difference between allow, ask and deny rules?

Allow runs without a prompt, ask requires approval each time, and deny blocks the action. Deny usually takes priority when rules overlap.

### Can permission rules stop prompt injection?

They limit the damage. If an injected instruction tries to read secrets or push code, deny and ask rules stop or expose it.

## Related cards

- [Agent Sandbox](https://wonderium.dev/ai/agent-sandbox.md)
- [Agent Settings](https://wonderium.dev/ai/agent-settings.md)
- [Pre-Tool Hook](https://wonderium.dev/ai/pre-tool-hook.md)
- [Human-in-the-Loop](https://wonderium.dev/ai/human-in-the-loop.md)
- [Coding Agent](https://wonderium.dev/ai/coding-agent.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/agent-permissions
- Last updated: 2026-11-25
