All courses

Approvals and permission modes

Explain the common mechanism of approvals. The agent asks before edits or commands, you can allow specific safe commands permanently, and 'auto-approve' modes trade oversight for speed. Choose a cautious default.

Builds on: The agent loop: act, observe, repeat, What you stay responsible for

Read it card by card Start the whole course

The agent stops and asks you

You ask the agent to add a `--verbose` option to `report.py`. Before anything changes, it pauses: ⚙ Edit: report.py [Approve? yes / no / always] A moment later it asks again: ⚙ Run: python report.py --verbose [Approve? yes / no / always] Tired of interruptions, you click `always`. Ten minutes later the agent runs `python scripts/clean.py`, a script that deletes your `output/` folder, and nobody asks you. Did your `always` cover that? Find out in 2 minutes.

A human gate between decision and effect

In the agent loop, every action the agent takes is a tool call. Reading a file changes nothing. Editing a file, or running a command, can change things. So most agents pause before those actions, and you sit between what the model decided and what actually happens. `no` is not a crash. The agent sees the refusal as a result and picks another step. `always` turns a one-off decision into a standing rule.

Answers, modes, and a cautious default

**Answers:** `yes` allows this one action. `no` blocks it. `always` allows matching actions from now on, with no further prompt. Depending on the tool, that lasts for this session or is saved for the project. **Modes** (names vary by tool) form a ladder: 1. Ask before every edit and command. 2. Auto-accept edits, but still ask for commands. 3. Auto-approve everything. Each step up trades oversight for speed. **Cautious default:** ask for everything. Use `always` only for narrow, read-only commands, like `ls`, which just lists the files in a folder. Auto-approving everything is not for your real project.

What did your 'always' cover?

Back to the opener. You clicked `always` on `python report.py --verbose`. Many tools save a rule that matches a command *prefix*, which is the start of the command. The rule might cover only this exact command, or every command that begins with `python`. If it is the second, `python scripts/clean.py` runs without asking, and a Python script can delete files or send data anywhere. Read what the tool says the rule covers. If it is broad, click `yes` instead. Give `always` only to commands that just look at things.

A session with approvals

The word after each approval prompt is what you chose. You approve the edit and the trial run. Then the agent asks to run `rm -rf output/`, which permanently deletes the `output/` folder and everything in it. You refuse and say why, so the agent can adapt its next step.
▸ You: add a --verbose flag to report.py
⚙ Read: report.py
⚙ Edit: report.py
[Approve? yes / no / always]  yes
⚙ Run: python report.py --verbose
[Approve? yes / no / always]  yes
⚙ Run: rm -rf output/
[Approve? yes / no / always]  no
▸ You: don't delete output/, it holds
  last month's reports
◂ Agent: Understood. I'll leave output/
  untouched; the --verbose flag works
  without clearing it.

Remember

Every approval is a decision you own. That includes approvals made in advance through `always` or an auto-approve mode. Start by asking before every edit and command, and allow `always` only for narrow, read-only commands. Reduce oversight only once you can easily get your project back to how it was.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.