Lesson 2.5 · 4:25
Approve or deny
Goal: Make OpenCode ask before it edits or runs anything, then practise saying yes and no.
Try it
- Create
opencode.jsonwith the content above and check it yourself. - Restart OpenCode in
first-project. - Approve the "I approved this." line, then open
hello.txtto confirm. - Ask it to delete
hello.txt, deny it, and confirm the file is still there.
You're done when OpenCode has asked you twice, you approved one and denied one, and the file shows exactly what you expected.
Recap
- Permissions are a harness setting that you control with a config file.
- With ask-first on, every edit and command waits for you to approve or deny.
- Read → approve or deny → check. Never "allow all" blind.
Next lesson (2.6): save points, so even a change you approved can be undone.