Best for
- Design a permission model for a coding-agent CLI or runtime
- Add tool approval prompts, ask/allow/deny rules, or sandbox escalation
- Model plan-mode entry and exit as part of the permission system
vasilyu1983/AI-Agents-public/frameworks/shared-skills/skills/ai-coding-agents-permissions/SKILL.md
Designs approval and permission systems for coding-agent runtimes. Use when modeling tool approvals, plan-mode transitions, sandbox prompts, or worker permission handoffs.
Decision brief
Use this skill to design or review the approval system for a coding-agent runtime: tool permission modes, plan-mode entry and exit, sandbox escalation, background-agent auto-deny behavior, and leader-worker permission routing.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-coding-agents-permissions"Inspect the Agent Skill "ai-coding-agents-permissions" from https://github.com/vasilyu1983/AI-Agents-public/blob/53f6cb73ea53a2646e3e7d4665062ad66f3683ac/frameworks/shared-skills/skills/ai-coding-agents-permissions/SKILL.md at commit 53f6cb73ea53a2646e3e7d4665062ad66f3683ac. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Model permission as runtime state, not scattered booleans. Keep a single host-owned permission context with mode, rule sources, and special-case flags. 2. Separate policy layers. Distinguish always-allow, always-deny, always-ask, org policy, and session-local overrides. 3. De…
Review the “ASCII Flow” section in the pinned source before continuing.
Review the “Quick Reference” section in the pinned source before continuing.
Design a permission model for a coding-agent CLI or runtime
Review the “Use Other Skills” section in the pinned source before continuing.
Permission review
The documentation asks the agent to read local files, directories, or repositories.
Decision order: allow/deny rules resolve first (except protected-path writes, which always route to the classifier) → read-only/in-directory edits auto-approve → everything else hits the classifierEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 96/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 80 | Source | Repository attention, not individual Skill quality |
| Compatibility | 2 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill to design or review the approval system for a coding-agent runtime: tool permission modes, plan-mode entry and exit, sandbox escalation, background-agent auto-deny behavior, and leader-worker permission routing.
This skill owns approval architecture for coding agents. For general hooks or callback automation, use ../agents-hooks/SKILL.md.
tool/action request
|
v
permission context
mode + actor + sandbox + tool + path + remote/local + worker role
|
v
policy route
allowlist | ask rule | deny rule | managed policy | plan-mode gate
|
v
decision
allow -> execute
ask -> prompt owner or lead session
deny -> return structured refusal
log -> trace permission reason
| Question | Read | Outcome |
|---|---|---|
| How should permission state live in the runtime? | references/permission-runtime-model.md | Central permission context, mode handling, and host-owned rules |
| How do local, remote, and swarm approvals differ? | references/permission-routing-local-remote-and-worker.md | Approval flows for REPL, remote sessions, and leader-worker teams |
How does OpenAI Codex model split filesystem policy and request_permissions? | references/openai-codex-request-permissions-and-split-policy.md | Read/write/deny entries, protected metadata, scoped permission grants, and sandbox-vs-approval separation |
| How does OpenAI Codex structure executable policy and network egress policy? | references/openai-codex-execpolicy-and-network-proxy.md | Prefix-rule evaluation, strictest-decision wins, structured justifications, network deny precedence, and local binding controls |
| Need | Use Instead |
|---|---|
| Hook automation and lifecycle callbacks | ../agents-hooks/SKILL.md |
| Plugin trust and install-time capability boundaries | ../ai-coding-agents-plugins/SKILL.md |
| Session resume and transcript recovery | ../ai-coding-agents-sessions/SKILL.md |
| Multi-agent worker coordination | ../agents-swarm-orchestration/SKILL.md |
| Full settings-source precedence, managed policy layering, env controls | ../ai-coding-agents-settings-policy/SKILL.md |
Six named modes are the complete enumeration. All are set via --permission-mode <mode>, the defaultMode settings key, or permissionMode in subagent frontmatter. As of v2.1.200, default is labeled Manual in the CLI, --help, and the VS Code/JetBrains extensions, and manual/"manual" is accepted as an alias for default everywhere the mode is configured — treat default and manual as the same mode when writing tooling against it.
| Mode | What runs without prompting | Key notes |
|---|---|---|
default (aka Manual, v2.1.200+) | Reads only | Starting mode; Shift+Tab cycles default → acceptEdits → plan |
acceptEdits | Reads, file edits, common filesystem commands | Auto-approves edits in working directory only; never auto-approves protected-path writes |
plan | Reads only | Research without writing; exit via Shift+Tab or plan approval |
auto | Everything except protected-path writes, with background classifier checks | v2.1.83+ required; protected-path writes route to the classifier, not auto-approval; see below |
dontAsk | Only pre-approved tools (allow-list only) | Named headless auto-deny mode; for CI/locked environments; never appears in Shift+Tab cycle; protected-path writes are denied outright |
bypassPermissions | Everything, no classifier, including protected-path writes | Isolated containers/VMs only; never appears in default cycle; explicit ask rules and rm -rf / / rm -rf ~ still prompt as a circuit breaker |
Shift+Tab cycle: default → acceptEdits → plan. Optional modes slot in after plan: bypassPermissions first (if started with --permission-mode bypassPermissions or --allow-dangerously-skip-permissions), then auto last (if eligible). dontAsk never appears in the cycle.
A small set of paths (.git, .config/git, .vscode, .idea, .husky, .cargo, .devcontainer, .yarn, .mvn, .claude except .claude/worktrees, plus files like .gitconfig, shell rc files, and package-manager rc files) are never auto-approved in any mode except bypassPermissions, and the check runs before permissions.allow rules are evaluated — an Edit(.claude/**) allow rule does not change this. This is the pattern to copy for any runtime: repository metadata and the agent's own config directory should have a hard-coded carveout that ordinary allow rules cannot reach, independent of mode.
auto mode — model-classifier approval system:
/model selection) evaluates each action before execution; do not hard-pin a specific classifier model name in downstream tooling — it can change without a version bump to the mode's behavior.auto, broad allow rules (Bash(*), PowerShell(*), wildcarded interpreters, package-manager run commands, Agent allow rules) are dropped and restored on exit; narrow rules like Bash(npm test) carry over-p) mode there is no user to prompt, so the run aborts instead/en/permission-modes at ship time rather than trusting a cached listdefaultMode: "auto" set in .claude/settings.json or .claude/settings.local.json is silently ignored (v2.1.142+) so a repository cannot grant itself auto mode; it must be set in user (~/.claude/settings.json) or managed settingspermissionMode: auto in subagent frontmatter is ignored when the parent is in auto mode — the parent's auto mode applies to all subagent actions, checked at three points: before spawn (task description), during execution (each action), and after completion (a full-history review that can prepend a security warning to the result, v2.1.178+)permissionModedisableAutoMode: "disable" in managed settings removes auto from the Shift+Tab cycle and rejects --permission-mode autocode.claude.com/docs/en/permission-modes and anthropic.com/engineering/claude-code-auto-modedontAsk mode — named headless auto-deny: every tool call that would normally prompt is auto-denied; only allow-rule-matched tools and read-only Bash commands execute, and an MCP tool marked requiresUserInteraction is denied even when an allow rule matches it (its consent card needs an answer this mode never collects). This is the correct mode for CI scripts that must not hang waiting for approval.
Background subagents and the "auto-deny vs. escalate" judgment call: prior to v2.1.186, a background subagent that hit a tool call requiring approval was auto-denied outright, because the main session had no way to interrupt it — subagents got stuck in silent denial loops. Since v2.1.186, the denied-by-default call instead surfaces as a prompt in the parent/main session, labeled with the subagent's name; the parent can approve or deny that single call without stopping the subagent. Treat this as the reference pattern for this skill's own "promptability" principle: auto-deny is the correct answer only when no controller exists to escalate to. When a background or worker context has any reachable parent/leader session, route the pending approval there as a first-class object (see Permission Runtime Model) rather than defaulting to silent denial.
Inheritance rules: a parent session in auto overrides any permissionMode set in subagent frontmatter. Plugin-shipped agents are additionally restricted: hooks, mcpServers, and permissionMode fields in plugin agent definitions are silently ignored by the runtime.
Bash(aws *) deny still blocks a narrower Bash(aws s3 ls) allow; there is no allowlist-exception mechanism inside a deny rule.Tool(param:value), v2.1.178+) let deny/ask rules gate on any top-level scalar input field, e.g. Agent(model:opus) or Agent(isolation:worktree) or Bash(run_in_background:true). This is distinct from — and composes with — the older Agent(AgentName) subagent-identity rule. Fields a tool already canonicalizes (command for Bash, file_path for Read/Edit/Write) are excluded from this path and must use the tool's own specifier syntax; a Bash(command:rm *) rule is silently ignored with a startup warning because it would be bypassable by a compound command.//path is filesystem-absolute; /path is relative to the settings file that defines the rule, not the project root or the CLI's cwd. A Read(/secrets/**) deny written into ~/.claude/settings.json blocks ~/.claude/secrets/**, not a project's secrets/ directory — reviewers should flag every single-leading-slash path rule in user settings as a likely mistake.PreToolUse hook's if field scopes it with permission-rule syntax (e.g. if: "Bash(rm *)"), but the filter fails open — if the Bash command can't be parsed, the hook runs anyway. Deny/ask permission rules are evaluated independently of what a hook returns, so a hook cannot be the sole enforcement point for a hard boundary; it can add checks, not replace deny/ask rules. See ../agents-hooks/SKILL.md for hook event and matcher design.Full precedence chain — managed settings > CLI arguments > local project (.claude/settings.local.json) > shared project (.claude/settings.json) > user (~/.claude/settings.json) — is ../ai-coding-agents-settings-policy/SKILL.md's territory; use it for full source layering and managed-policy design.
The one nuance load-bearing for a permission audit: that precedence order governs plain settings (e.g. spinnerTipsEnabled), but permission rules do not simply follow "higher scope wins." A deny rule from any scope blocks the action regardless of scope precedence — a user-level deny blocks a project-level allow and a project-level deny blocks a user-level allow, because deny is evaluated before allow at every scope and rules merge across scopes rather than one file overriding another wholesale. Do not assume "project settings win over user settings" applies to allow-vs-deny conflicts — check which rule is a deny before applying the file-precedence mental model.
AskForApproval Policy EnumSource: live codex-rs/protocol/src/protocol.rs (main branch, re-verified July 2026) — re-check before shipping, since Codex's config surface has changed shape twice within a few months.
TOML key: approval_policy (type Option<AskForApproval>, in the top-level [config] section of ~/.codex/config.toml)
| Variant | TOML value | Behavior |
|---|---|---|
UnlessTrusted | "untrusted" | Auto-approves only commands is_safe_command() judges "known safe" and read-only; asks for everything else |
OnRequest | "on-request" (also accepts legacy "on-failure" as a deserialization alias) | Default. The model decides when to ask for approval |
Granular(GranularApprovalConfig) | "granular" + sub-keys | Fine-grained per-category control: sandbox_approval, rules (execpolicy prompt rules), skill_approval, request_permissions, mcp_elicitations |
Never | "never" | Never submits commands for approval; failures returned immediately to the model |
Correction from an earlier snapshot of this skill: a prior pinned-commit source (2026-05-22) showed UnlessTrusted serializing as "unless-trusted" and a separate deprecated OnFailure variant ("all commands auto-approved, rely on the sandbox"). The live source now serializes UnlessTrusted as "untrusted", and OnFailure is gone as a distinct variant — "on-failure" is now only a backward-compatible TOML alias that deserializes into OnRequest, so a config still carrying approval_policy = "on-failure" gets OnRequest behavior, not the old always-auto-approve behavior. Treat this as a general lesson, not just a one-time fix: pinned-commit citations for a fast-moving CLI's config surface expire faster than the rest of this skill; re-fetch the live source (or current config-reference docs) before trusting an enum-value table, and prefer on-request/never explicitly over relying on the on-failure alias.
GranularApprovalConfig lets operators selectively enable or suppress approval prompts per action class, allowing a policy like "always ask for MCP tool calls, never ask for skill-script approval."
Design rule: treat AskForApproval as the canonical approval-mode type when implementing Codex-compatible runtimes — do not invent a parallel enum. Do not write new code that branches on a standalone on-failure semantic; it is an alias, not a policy.
Goose exposes two approval surfaces the current skill does not model: identity-aware approvals via an OIDC proxy, and ACP-bridged approvals where approvals must round-trip across a stdio boundary to a delegating agent.
Goose ships an oidc-proxy/ crate that bridges agent calls to external providers through an OIDC-authenticated proxy. Approvals tied to external side-effects (deploy, merge, paid API use) can be gated on the authenticated identity, not just on "the user accepted a local prompt."
auth_proof field to the permission context; rules can declare require_fresh_auth: true. For those, every N minutes or per-call, the host demands re-authentication via OIDC proxy. Record the identity with the approval outcome for audit.When a session delegates work to an external ACP agent (see ai-coding-agents-remote-runtime agent-delegating mode, and ai-coding-agents-provider-runtime agent-as-provider), tool approvals requested by the delegated agent must round-trip back to the orchestrator's local UI. The skill's current worker-routing model assumes same-process workers.
references/permission-runtime-model.md — Central permission context, plan-mode restore, and host-owned rule layersreferences/permission-routing-local-remote-and-worker.md — Approval flows for REPL, remote sessions, and swarm workersreferences/openai-codex-request-permissions-and-split-policy.md — OpenAI Codex split filesystem policy, protected metadata, request_permissions, and hostile-case testsreferences/openai-codex-execpolicy-and-network-proxy.md — OpenAI Codex executable policy engine and network proxy boundary patternsreferences/hostile-path-test-checklist.md — Adversarial path, symlink, and containment cases for permission-boundary testsdata/sources.json — Primary documentation and source references for approval-system design../agents-hooks/SKILL.md../agents-swarm-orchestration/SKILL.md../ai-coding-agents-plugins/SKILL.mdclaude_code source snapshot. Verify current permission field names, event names, and remote control schemas before shipping.Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
Frequently asked questions
Use this skill to design or review the approval system for a coding-agent runtime: tool permission modes, plan-mode entry and exit, sandbox escalation, background-agent auto-deny behavior, and leader-worker permission routing.
The source record exposes this install command: npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-coding-agents-permissions". Inspect the command and pinned source before running it.
The pinned source record declares support for: codex, claude code.
Static rules flagged read-files in the source; the page lists the matching lines and excerpts.
Alternatives
vasilyu1983/AI-Agents-public
Configures Claude Code hooks and Codex hooks.json/notify callbacks. Use when adding guardrails, preflight, audit trails, worktree automation, or budget enforcement.
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
vasilyu1983/AI-Agents-public
Guides multi-GPU pre-training: DDP, FSDP2, ZeRO, tensor/pipeline/expert parallelism, fp8/Muon. Use when scaling a run, training MoE, or reproducing GPT-2 on rented GPUs.
vasilyu1983/AI-Agents-public
Scans public GitHub repos for agent skills, dev practices, and code patterns. Use when enriching skills, setting team policy, or researching a build domain.