All documentation pages

Permissions and scope

AgentDuo enforces nothing. What each agent may do comes from that CLI’s own configuration: Claude Code’s settings and permission mode, Codex’s sandbox and approvals. AgentDuo passes the flags its protocol needs, relays Claude’s permission prompts when someone can answer, and reports what the agents did.

On this page

Who decides what

AgentDuo passes only the flags its protocol needs: streaming JSON, the output schema, and the prompt on stdin. None of them grants a permission. Everything else comes from you:

  • Claude Code: your settings (~/.claude/settings.json, .claude/settings.json, .claude/settings.local.json). In non-interactive mode Claude can only use a tool your settings allow, or one you allow when it asks.
  • Codex: ~/.codex/config.toml, for example sandbox_mode. codex exec is read-only unless configured otherwise.
  • Your flags for AgentDuo’s calls only: args for every call of an agent, role_args per role, in .agentduo/config.yaml. They reach the CLI as written; your own Claude Code and Codex settings stay unchanged.
  • Your repository’s instructions: AGENTS.md and CLAUDE.md, which the CLIs read themselves.

.agentduo/config.yaml

claude:
  role_args:
    implementer: [--permission-mode, acceptEdits]
codex:
  role_args:
    code_reviewer: [--sandbox, read-only]

Note

A Codex implementer needs write access: sandbox_mode = "workspace-write" in Codex’s config, or codex.role_args.implementer: [--sandbox, workspace-write].

Claude’s permission prompts

When Claude wants a tool its settings do not allow, the run pauses and AgentDuo shows Claude’s own prompt, in the terminal, the desktop app or VS Code:

duo

⚠ Claude (implementer) asks to use Bash
  Bash  npm test
❯ Allow once
  Always allow Bash(npm test:*)  saved by Claude to .claude/settings.local.json
  Deny
  Deny with a message…
  • Always allow hands Claude back the rule it suggested, and Claude saves it in .claude/settings.local.json, as it does when you answer its prompt directly. That file is never part of a snapshot or of the diff the reviewer sees.
  • Deny with a message tells Claude what to do instead.
  • The agent’s timeouts stop while the prompt waits for you.

When AgentDuo relays prompts

Claude runs in host mode (--permission-prompts host --permission-prompt-tool stdio) only when someone can answer: a chat, a run in the desktop app or VS Code, a run in a terminal. Where nobody can (CI, the background, output piped elsewhere) every call gets --permission-prompts none, and Claude denies such tool calls itself instead of waiting forever. claude.permission_prompts: deny does that everywhere; the default is ask.

Changing permissions from the chat

Permission commands in the chat
CommandWhat it changes
/mode manual|acceptEdits|auto, Shift+TabClaude’s permission mode, in the chat and as the pipeline’s implementer; the plan critic is not affected
/claude permissions [allow|deny|remove <rule>]Claude’s tool rules for AgentDuo’s calls, e.g. Bash(npm test:*)
/claude add-dir <path>another directory Claude may work in
/codex permissions read-only|auto|full-access|defaultCodex’s sandbox; full-access asks you to confirm with --yes

They change only flags, and apply from the agent’s next call. Outside the chat, duo --accept-edits "<task>" does what /mode acceptEdits does. All commands: slash commands.

What AgentDuo reports

AgentDuo does not block what an agent does; it warns, on screen and in the run’s report.md:

  • tool calls Claude was denied: each shows as ⊘ denied, then a warning names the tools;
  • files changed by a planning or reviewing agent;
  • files changed outside the workspace (elsewhere in the same repository), with paths relative to the workspace, such as ../shared/x.ts.

Nothing is ever committed or pushed: review the changes with git diff and commit them yourself.

Unattended runs

A run nobody watches (CI, a background job) cannot answer a prompt, so whatever the implementer needs must be allowed before it starts. Without that, its tool calls are denied and the warning names them.

  • Edits (Edit, Write): "permissions": { "defaultMode": "acceptEdits" } in your Claude Code settings, or --permission-mode acceptEdits in the implementer’s role_args. It allows edits, not commands.
  • Commands (Bash): allow rules such as "Bash(npm test:*)". Without gates the implementer runs the project’s checks itself, so allow those commands.
  • Codex as implementer: a sandbox that can write, as above.
  • Never ask: claude.permission_prompts: deny makes Claude deny anything its settings do not allow, even with someone watching.

.agentduo/config.yaml

# For runs nobody watches (CI, a background job): Claude cannot ask, so allow what the implementer needs up front.
# These flags reach Claude Code only in agentduo's calls; your own Claude Code settings are unchanged.
claude:
  permission_prompts: deny            # never relay a permission prompt; Claude denies what its settings do not allow
  role_args:
    implementer: [--permission-mode, acceptEdits, --allowedTools, "Bash(npm test:*)"]
gates:
  - name: tests
    command: "npm test"
    required: true

Gates run your checks whatever the agents may do: the pipeline.