Skip to content

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

  1. Create opencode.json with the content above and check it yourself.
  2. Restart OpenCode in first-project.
  3. Approve the "I approved this." line, then open hello.txt to confirm.
  4. 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.