Skip to content

Permissions

Permissions control what tools agents can invoke and with what arguments. Each permission rule targets a specific tool by name, optionally narrows the match with an argument pattern, and assigns a decision — allow, deny, or ask. Rules are evaluated in order; the first match wins.

interface Permission {
tool: string; // Tool name ("Bash", "Read", "Write")
pattern?: string; // Glob/prefix for argument matching
decision: "allow" | "deny" | "ask";
scope: Scope;
}

Permissions are defined in the permissions section of .ai/config.yaml.

permissions:
- tool: Bash
pattern: "npm run *"
decision: allow
scope: project
- tool: Bash
pattern: "rm -rf *"
decision: deny
scope: project
FieldTypeDescription
toolstringThe tool name to match, e.g. "Bash", "Read", "Write"
patternstringOptional glob or prefix pattern matched against the tool’s argument
decision"allow" | "deny" | "ask"What to do when the rule matches
scopeScopeScope tier this rule applies at
DecisionBehavior
allowAuto-approve the tool invocation without prompting the user
denyBlock the tool invocation entirely
askPrompt the user for approval before proceeding

The ask decision is the default behavior for most tools when no matching permission rule exists. Explicit allow rules are useful for automating repetitive, safe operations. Explicit deny rules create hard guardrails that cannot be bypassed by the agent.

dotai translates permissions into each tool’s native access control format. Coverage and granularity vary significantly across tools.

AspectClaude CodeCursorCodexOpenCodeCopilotAntigravity
GranularityPer-tool + argument patternsPer-tool-type + patternsGlobal policy onlyPer-tool + argument patternsNoneNone
Decisionsallow/deny/askallow/denysuggest/auto-edit/full-autoallow/deny/askN/AN/A
Tool targetingBash(npm run *)Shell(cmd)N/Anested patternsN/AN/A
SandboxN/AN/Aoff/read-only/fullN/AN/AN/A
  • Cursor — Does not support the ask decision. Rules with decision: ask are translated to deny so that the agent stops rather than proceeding silently.
  • Codex — Does not support per-tool permission rules. Fine-grained rules are coerced to the most restrictive matching global policy. A single deny rule for any tool forces Codex into suggest mode for the entire session.
  • OpenCode — Supports per-tool permission rules with nested argument patterns, mapping closely to the dotai model.
  • Claude Code — Full support for per-tool rules, argument patterns, and all three decision types.
  • Copilot — Does not support file-based permission configuration. All permission rules are skipped with a warning during ai sync.
  • Antigravity — Does not support permission rules. All permission rules are skipped with a warning during ai sync.
  • Codex — Only supports a global automation policy (suggest, auto-edit, full-auto). Per-tool and per-pattern granularity is lost.
  • Cursor — Does not support the ask decision. ask rules are emitted as deny to preserve safety.