OpenCode full-access mode

Run OpenCode without permission prompts with opencode --auto. What it changes, what it still blocks, and the machines where it is safe.

Updated November 23, 2026 · Checked against OpenCode 1.18.32 in EnvHaven v1.9.0

In EnvHaven: The image sets OPENCODE_PERMISSION={"*":"allow"}, so OpenCode never asks. Each workspace is its own Linux machine, so full access stays contained there. On any other machine, here is the switch, what it changes and where it is safe.

The switch

For one session:

opencode --auto

For every session, as an environment variable:

export OPENCODE_PERMISSION='{"*":"allow"}'

Or in opencode.json:

{
  "permission": "allow"
}

What it does

--auto auto-approves every permission that is not explicitly denied; its help marks it “dangerous!”. Deny rules still apply, and in 1.18 the default rules deny reading .env files.

Where full access is safe

  • On your everyday computer: rarely. An agent with full access can delete files, read credentials and run anything a mistyped instruction or a malicious README suggests.
  • In a container or VM that holds nothing you would miss: yes. A mistake costs a rebuild.
  • In an EnvHaven workspace: by default. The image sets OPENCODE_PERMISSION={"*":"allow"}, so OpenCode never asks. The workspace is a separate Linux machine, so the worst case stays there.

Turning prompts back on

Leave out the flag, or reset the setting you changed. In a workspace, the setting EnvHaven applies is described above, and editing or removing it brings OpenCode’s own defaults back.

How this was checked

From the help text of OpenCode 1.18.32, as shipped in EnvHaven v1.9.0:

--auto auto-approve permissions that are not explicitly denied (dangerous!)
--auto auto-approve permissions that are not explicitly denied (dangerous!)