# 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:

```bash
opencode --auto
```

For every session, as an environment variable:

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

Or in opencode.json:

```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:

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

## Keep reading

- [OpenCode](https://envhaven.com/agents/opencode)
- [Full access for every agent](https://envhaven.com/yolo)
- [Run OpenCode 24/7](https://envhaven.com/agents/opencode/24-7)
- [YOLO mode](https://envhaven.com/glossary/yolo-mode)

Source: https://envhaven.com/yolo/opencode
