Permissions
Code CLI has a granular permission system that controls which tools the agent can use and whether they require user approval.
Permission Modes
| Mode | Description | Use When |
|---|---|---|
| default | Prompt for dangerous operations, auto-approve reads | Interactive development |
| acceptEdits | Auto-approve file writes within project | Trusted codebase changes |
| plan | Read-only — agent can only read and plan | Reviewing code, analysis |
| auto | Auto-approve all safe operations | CI/CD, automated workflows |
| bypassPermissions | Auto-approve everything (dangerous) | Trusted environments only |
Per-Tool Rules
Each tool can be set to one of three actions:
| Action | Behavior |
|---|---|
| allow | Always allow without prompting |
| ask | Prompt the user for approval |
| deny | Always block the operation |
Permission Flow
- Agent requests a tool call
- Check permission rules for the tool
- If
allowordeny, proceed immediately - If
ask, prompt the user - User can approve once or select "Always allow" to cache the decision