<!-- https://zerolog.ch/docs/approval · Docs / Compute -->
# Command approval

Every command the AI wants to run appears in full and waits. Three buttons end that wait, and the middle one changes more than this one call.

## What you see when it stops

waits here

the command, in full

When the command can be edited, that box is a text field. Change the text, press Approve, and what runs is what you typed.

Approve Always in this chat Deny

A line here says what **Always in this chat** does: it ends the questions for the whole chat. A chat has four settings: Ask every time, Allowlisted commands only, Auto-accept edits and Never ask.

- **Approve**: Runs it once.
- **does more than this callAlways in this chat**: Switches the whole chat to Auto-accept edits, so every later tool runs without asking. Change it back under the chat's settings.
- **Deny**: Refuses and returns `[denied by user]` to the model.

*Deny is not next to Approve, so a destructive command is never one mis-tap away.*

fewer questions

## The command allowlist

Set a chat to **Allowlisted commands only** and commands on your list run without asking. Everything else still waits for you. When a command asks, **Always allow** approves it and adds a pattern to the list. Edit the list under Settings, Command allowlist; it applies to all your chats.

how a pattern matches

- `npm test` allows exactly that command
- `npm run:*` allows that start with any arguments
- in a chained command (`;` `&&` `||` `|`), every part must be on the list
- `$(…)`, backticks, redirection and `\` always ask

if you do not respond

## The request expires

After five minutes, the pending request expires. The assistant stops and reports what remains undone.

after it runs

## In the chat

A command that runs keeps its exit code and output in the chat.

a command card holds

- the command
- its exit code
- its output

## What happens to one command

Mermaid source of the diagram on this page:

```mermaid
%% Command approval: what happens to one command the AI wants to run. Facts from server/routes/chats.js (gateFor, approval wait, 5 min), server/befehlsliste.js, web/apps/web/components/chat/tool-card.tsx.
flowchart TB
  ask["1. The AI asks to run a command"]
  mode["2. The chat's setting decides"]
  wait["3. Shown in full,<br/>waits for you"]:::hot
  run["4. The command runs<br/>exit code and output<br/>stay in the chat"]
  deny["Denied<br/>the model gets<br/>[denied by user]"]
  late["Request expires<br/>the assistant stops<br/>and sums up"]

  ask --> mode
  mode -->|"Never ask, Auto-accept edits"| run
  mode -->|"Allowlisted: every part is on your list"| run
  mode -->|"Ask every time, or not on the list"| wait
  wait -->|"Approve, Always in this chat, Always allow"| run
  wait -->|Deny| deny
  wait -->|"no answer in 5 min"| late

  classDef hot stroke:#8f7ac9
```
