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
| Layer | Set in | Question it answers |
|---|---|---|
| Tools | The agent’s Tools & permissions | Can this agent do this kind of thing at all? |
| Permission mode | The agent, or the factory’s Guardrails | Does it need to ask first? |
| Command rules | Settings → Action approvals | Is this specific command allowed, asked or denied? |
| Factory guardrails | The factory’s Guardrails tab | Should 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:
| Tool | Allows |
|---|---|
| Read & search repo | Reading files and searching code in the run’s worktree |
| Edit files | Writing to files in the worktree |
| Run shell commands | Running commands in the run’s terminal |
| Open pull requests | Pushing the run branch and opening a PR |
| Network egress | Commands 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
| Mode | Behaviour |
|---|---|
| Ask for everything | Every write and command becomes an ask |
| Ask for writes | Reads and allow-listed commands run freely; writes and other commands ask |
| Autonomous in sandbox | No 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
| # | Pattern | Action | Applies to |
|---|---|---|---|
| 1 | git push --force* | deny | All steps |
| 2 | rm -rf /* · sudo * | deny | All steps |
| 3 | pnpm test * | allow | All steps |
| 4 | pnpm lint * · pnpm typecheck | allow | All steps |
| 5 | git commit * · git push origin <run-branch> | allow | Implement, Deliver |
| 6 | pnpm db:migrate * | ask | Deploy |
| 7 | curl * · wget * | ask | All steps |
How some commands resolve with these rules:
| Command | Result | Why |
|---|---|---|
pnpm test ledger | Runs | Rule 3 matches first |
git push --force origin main | Blocked | Rule 1 matches before anything else |
pnpm db:migrate --env staging-eu | Ask in Inbox | Rule 6 |
git push origin duun/plt-482 in Implement | Runs | Rule 5, <run-branch> is the run’s own branch |
git push origin main in Implement | Mode decides | No rule matches, so the permission mode applies |
curl https://example.com | Ask | Rule 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:
| Setting | What it does |
|---|---|
| Auto-approve plans after a countdown | Plans you don’t answer go ahead after the countdown. Never for factories in Ask for everything mode. |
| Auto-approve action proposals | Proposed actions go ahead after the countdown. Never for actions that need a value from you, like secrets. |
| Auto-advance unanswered questions | Agents take their recommended option after a countdown. |
| Desktop approval | Ask before an agent takes control of a desktop or browser. |
| Commands with network access | Always 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:
| Ask | Primary action | Other actions |
|---|---|---|
| Approve the plan | Approve plan | Request changes, Hand off |
| Allow a command | Allow once | Request changes, Hand off |
| Answer questions | Send answers | Hand off |
| Review pull request | Approve & merge | Request 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.
Related
- Agents
- Gates and failure handling
- Allow a command and Approve a plan in the help center
- Webhook events