Permissions and approvals

How permission modes, agent tools, command rules and Action approvals decide what an agent may do on its own and what becomes an ask.

On this page

Duun decides whether an agent may act on its own in layers: the agent’s tools, its permission mode, the workspace command rules, and the factory’s guardrails. Anything that isn’t allowed outright becomes an ask in Inbox, and the run waits for a person.

The layers

LayerSet inQuestion it answers
ToolsThe agent’s Tools & permissionsCan this agent do this kind of thing at all?
Permission modeThe agent, or the factory’s GuardrailsDoes it need to ask first?
Command rulesSettings → Action approvalsIs this specific command allowed, asked or denied?
Factory guardrailsThe factory’s Guardrails tabShould this factory be stricter than the workspace?

The strictest answer wins. Factory guardrails can only tighten workspace rules, never loosen them.

Tools

Tools switch whole capabilities on or off for an agent:

ToolAllows
Read & search repoReading files and searching code in the run’s worktree
Edit filesWriting to files in the worktree
Run shell commandsRunning commands in the run’s terminal
Open pull requestsPushing the run branch and opening a PR
Network egressCommands that reach the network beyond package registries Duun caches

A tool that is off can’t be granted by an approval. A reviewer with Edit files off can’t edit a file even if you would approve it.

Permission modes

ModeBehaviour
Ask for everythingEvery write and command becomes an ask
Ask for writesReads and allow-listed commands run freely; writes and other commands ask
Autonomous in sandboxNo asks inside a disposable, offline sandbox

Autonomous in sandbox only applies when the run is in a cloud sandbox. If the same agent runs in a local worktree or on an SSH computer, it behaves as Ask for writes.

Command rules

Settings → Action approvals → Command rules is an ordered list of patterns. Each rule says allow, ask or deny. Rules are checked top to bottom and the first match wins. * matches anything.

Worked example

#PatternActionApplies to
1git push --force*denyAll steps
2rm -rf /* · sudo *denyAll steps
3pnpm test *allowAll steps
4pnpm lint * · pnpm typecheckallowAll steps
5git commit * · git push origin <run-branch>allowImplement, Deliver
6pnpm db:migrate *askDeploy
7curl * · wget *askAll steps

How some commands resolve with these rules:

CommandResultWhy
pnpm test ledgerRunsRule 3 matches first
git push --force origin mainBlockedRule 1 matches before anything else
pnpm db:migrate --env staging-euAsk in InboxRule 6
git push origin duun/plt-482 in ImplementRunsRule 5, <run-branch> is the run’s own branch
git push origin main in ImplementMode decidesNo rule matches, so the permission mode applies
curl https://example.comAskRule 7, and Commands with network access always asks

Put deny rules at the top so a broader allow can’t shadow them. When you add a rule it goes at the top of the list; drag it to where it belongs. The editor shows which pattern a sample command matches before you save.

Action approvals

The toggles at the top of Settings → Action approvals control how asks are handled:

SettingWhat it does
Auto-approve plans after a countdownPlans you don’t answer go ahead after the countdown. Never for factories in Ask for everything mode.
Auto-approve action proposalsProposed actions go ahead after the countdown. Never for actions that need a value from you, like secrets.
Auto-advance unanswered questionsAgents take their recommended option after a countdown.
Desktop approvalAsk before an agent takes control of a desktop or browser.
Commands with network accessAlways ask, regardless of factory rules.

When a countdown applies, the ask shows it, for example “auto-approves in 28m”. Approving, requesting changes or handing off stops the countdown.

Factory guardrails

Each factory’s Guardrails tab can set a stricter permission mode, require plan approval, and add command rules that only apply to that factory’s runs. They are merged with the workspace rules: a factory can turn an allow into an ask or a deny, but can’t turn a workspace deny into an allow.

Workflow rules add natural-language limits on top, such as “Never touch infra/prod without operator”, enforced as an instruction, a check or a block.

How asks appear

When something needs a person, the run status changes to waiting and an ask lands in the Inbox of the people who can answer it. The ask names what is waiting and offers one primary action:

AskPrimary actionOther actions
Approve the planApprove planRequest changes, Hand off
Allow a commandAllow onceRequest changes, Hand off
Answer questionsSend answersHand off
Review pull requestApprove & mergeRequest changes

In Inbox, ⌘ ↵ takes the primary action and Z undoes your last decision. Asks also go to Slack and email if you turned those on in Settings → Notifications, and fire the ask.created webhook event.

Allow once permits that exact command for that run only. To allow it every time, add a command rule.

    Type to search the docs, help center and blog.