Skip to content

Decision Agent Permission Model

Matthew Layton edited this page Oct 29, 2026 · 1 revision

Decision: the agent permission model, and where it surfaces

The design note for #1158 (part of the sandbox-escape epic #1157). It was written on 2026-10-29 and its five open decisions were ruled the same day (§7). It gates #1167 (the workspace Security & Permissions panel) and #1168 (Settings and the ribbon). The note follows as written, with the rulings folded in.

Agent permission model, and where it surfaces

1. What exists today

Read from the code on main (730cee69):

Control Where it is set What it does
Posture: prompt / auto-edits / auto-all Mission Control ribbon (Prompt All / Allow Edits / Allow All) and Settings (Ask every time / Auto-allow file edits / Auto-allow everything) Decides a gated tool when its per-tool policy is Ask. auto-edits covers Write/Edit/MultiEdit/NotebookEdit, and also skips the edit preview for Studio's document edits
Per-tool policy: Allow / Ask / Deny Settings → Tool permissions, for 7 tools: Write, Edit, MultiEdit, NotebookEdit, Bash, WebFetch, WebSearch Deny removes the tool from the model outright (the CLI auto-runs "harmless" commands without asking the gate). Allow skips the prompt even under Prompt All
Write paths: allowed / denied Settings A hard boundary that approving cannot widen. It is passed to the gate (file tools) and to the OS sandbox (shell)
Network locations: allowed / denied Settings Passed to the OS sandbox and to the API tools. An empty list means any host. Codex has one network switch, so any list turns its network off
Blocked commands (#853) Settings → Keep agents off the code host's CLI Refuses gh in the shell and in terminal input while a hosting plugin serves the repository
Remembered grants (#241, #979) The prompt card: once / session / workspace / always Stored in agent-permission-rules.json. Command tools (Bash, terminal input, open terminal, run document, run container) are remembered only for the exact command. Old tool-wide grants for them are dropped on load since #979
Studio's own tools — They bypass the harness gate and gate on Studio's side: hosting writes through the hosting write gate, document edits through the edit preview
OS sandbox not user-visible Claude: enabled, autoAllowBashIfSandboxed: false, failIfUnavailable: false, and escalation is never refused (allowUnsandboxedCommands is not set). Codex: workspace-write, with escalation declined

The gap #1157 found. Unsandboxed execution is not a permission at all. It runs under whatever covers Bash, the prompt card shows only the command, and nothing records that the sandbox was bypassed.

2. The permissions, whole

Each permission has a level: Allowed, Ask or Denied. It also has a scope: a global default in Settings, which a workspace can override in the panel.

# Permission Covers Default Scope Remember options on its card
P1 File edits Write, Edit, MultiEdit, NotebookEdit; Studio document edits, run configurations, create / rename files Ask global + workspace session, workspace, always
P2 Deleting files Studio's delete_path; the explorer's delete Ask global + workspace session, workspace
P3 Shell (sandboxed) Bash, terminal input, open terminal, run document, run container Ask global + workspace exact command: session, workspace, always
P4 Shell (unsandboxed) ⭐ new Any command asking to leave the OS sandbox Ask. Never covered by P3 global + workspace once, or the exact command for this session (D2)
P5 Network, per host ⭐ reworked Shell, WebFetch, API tools A built-in dev-host list is Allowed (§2.1). Other hosts Ask. Cloud metadata always Denied global list + workspace list once, workspace, always; Deny can also be remembered
P6 Localhost ⭐ new Connecting to and binding local ports Ask (D5) workspace session, workspace
P7 Docker socket ⭐ new The container engine's socket Ask (D5) workspace session, workspace
P8 Web search WebSearch Ask global session, always
P9 Code-host writes Hosting tools that change GitHub etc. Ask global + workspace session, workspace
P10 Studio reads Reading documents, explorer, source control, terminals Allowed. Not listed — —

Fixed boundaries. These are not levels, and no posture or prompt can widen them:

  • The write area: the workspace plus the allowed write paths. Widening it is a Settings decision only (the existing ruling).
  • Denied write paths and denied hosts.
  • Cloud metadata addresses.
  • Excluded commands per workspace (#1163): commands that must always run outside the sandbox, such as ng build. They live in the workspace panel. Excluding a command is the only way to grant P4 permanently, so the prompt card has no "always" button for unsandboxed runs.

2.1 The built-in dev-host list (P5)

github.com, api.github.com, *.githubusercontent.com, registry.npmjs.org, api.nuget.org, pypi.org, files.pythonhosted.org, crates.io, static.crates.io, proxy.golang.org, sum.golang.org, repo.maven.apache.org, plugins.gradle.org. The user can switch any of them off.

3. The postures

The postures are the two ends of the scale. One posture applies to all agents, and the levels decide everything between the ends.

  • Prompt All (strict): everything that isn't Denied asks, except P10. An explicit Allowed level does not skip the prompt (D4). This is a change from today, where an explicit Allow beats Prompt All; Prompt All now means what it says.
  • Custom (the middle button): it uses the levels as set (D1). It replaces Allow Edits. A fresh install's levels are today's Allow Edits (P1 Allowed, the rest Ask), so behaviour doesn't change until someone sets other levels.
  • Allow All (relaxed): everything that isn't Denied is allowed, unsandboxed included. The fixed boundaries still hold.

The rule, in order: fixed boundary → Denied → posture end (Prompt All asks / Allow All allows) → the permission's level → its remembered grant → prompt.

4. Where each control lives

Mission Control ribbon (a one-click change of how much agents may do):

  • The three posture buttons: Prompt All · Custom · Allow All.
  • A Permissions button that opens the workspace's Security & Permissions panel.
  • A count of prompts waiting, so a stalled agent is visible at a glance.

Settings → AI → Permissions (the global defaults):

  • The level of each of P1–P9 (it replaces the current 7-row Tool permissions list).
  • The write paths.
  • The global network list, with the dev-host list shown and switchable.
  • The global remembered grants, each with Revoke.

Workspace Security & Permissions panel (new, per workspace):

  • Overrides: a level per permission, or "use default".
  • Excluded commands (P4's only permanent grant).
  • The workspace's hosts, plus localhost and Docker.
  • The workspace's remembered grants, with Revoke.
  • Live state: each running agent, the posture it is answering to, prompts waiting, and recent unsandboxed runs, from the audit log (#1160).

5. The prompt cards

All cards get the same button order: grant first, then remember options, then Deny. No coloured buttons.

  1. Tool card (existing): the tool, its summary, Allow once · this session · this workspace · always. For command tools, the remember options name the exact command.
  2. Unsandboxed card (new):
    • Visually distinct: it is the one prompt that removes a safety net.
    • Shows the full command, not the 120-character summary.
    • Shows why: the sandbox refusal that came first, or "asked before trying sandboxed" for a pre-emptive request. That was 99% of cases in the #1157 investigation, so it is worth saying out loud.
    • Buttons: Run unsandboxed once · this session (exact command) · Deny (D2).
    • A link: Always run this command outside the sandbox in this workspace. It adds an excluded command, and states that it does so.
  3. Network host card (new): the host, which tool asked, Allow once · Allow always (this workspace / everywhere) · Deny (once / always). A remembered Deny adds the host to the denied list, so it can be found and revoked there. Unlike tool denials, this one is visible, so remembering it is safe.
  4. Localhost / Docker cards (new): the port or socket, and which command asked, Allow for this session · this workspace · Deny. The first use in a workspace prompts (D5).

6. Migration

Today Becomes
Posture prompt / auto-all Unchanged. Under prompt, an explicit Allow no longer skips the prompt (D4); a one-time notice says so if any Allow was set
Posture auto-edits Custom, with P1 = Allowed and everything else = Ask. Same behaviour as today
ai.toolPolicies Mapped onto P1 (if all four edit tools agree; otherwise the strictest), P3 (Bash), P5 (WebFetch → Ask for unknown hosts) and P8
Remembered tool-wide command grants Already dropped since #979. Exact-command grants are kept, but they no longer cover unsandboxed runs, so the first unsandboxed run after upgrade prompts once
Empty network list ("any host") Moved to the dev-host list, with any other host on Ask, and a one-time notice explaining it (D3)
Blocked commands (#853) Unchanged, and shown in the workspace panel beside the excluded commands
Codex It can't do per-host or per-escalation prompts. P4 = Denied unless Allow All. P5 = network on/off. The panel says so (#1169)

7. Rulings (Matthew, 2026-10-29)

  • D1. The middle button becomes Custom. It uses the per-permission levels, and a fresh install's levels match today's Allow Edits.
  • D2. Unsandboxed grants from the card last once, or for the session, for the exact command. A permanent grant is only possible by excluding the command in the workspace panel.
  • D3. Existing users with an empty network list move to the dev-host list, with any other host on Ask, and get a one-time notice.
  • D4. Prompt All asks for everything that isn't Denied, an explicit Allowed level included.
  • D5. Localhost and the Docker socket default to Ask, remembered per workspace.

Clone this wiki locally