Original URL: https://getagenttools.com/blog/opencode-dangerously-skip-permissions/

# opencode --dangerously-skip-permissions: a hidden alias for --auto, and what deny rules still stop

23 Oct 2026Marek.

- opencode
- coding-agents
- agent-security

Yes, opencode accepts `--dangerously-skip-permissions`. It is a hidden alias. The visible flag is `--auto`, and `--yolo` is a second hidden alias. All three auto-approve permission requests that are not explicitly denied. Deny rules still apply. For a permanent setup, set the `permission` key in `opencode.json` instead.

 

```bash
# The documented flag
opencode --auto
opencode run --auto "Refactor this module"

# Hidden aliases, same effect per the source
opencode --dangerously-skip-permissions
opencode --yolo
```

  

- **What it is.** One switch with three names. Only `--auto` shows in the help.
- **What it keeps.** "Explicit `"deny"` rules are still enforced", per the docs.
- **What it changes less than you think.** opencode allows most tools by default. Prompts appear only where a rule says `ask`.
- **The config route.** `"permission": "allow"` in `opencode.json`, or rule by rule.
- **How I know.** I do not use opencode. This reads the docs and source of opencode 1.x (v1.19.3) on 17 October 2026.

 

The Claude Code flag with the same name, and what still stops Claude under it, is in my [--dangerously-skip-permissions](https://getagenttools.com/blog/dangerously-skip-permissions/) post.

 

## Does opencode have --dangerously-skip-permissions?

 

Yes, but you will not find it in `opencode --help`. In release v1.19.3, from 16 October 2026, both the TUI command and `opencode run` declare three options. `auto` is visible. `yolo` and `dangerously-skip-permissions` are marked hidden. The handler joins them into one value:

 

```ts
auto: args.auto || args.yolo || args["dangerously-skip-permissions"]
```

 

The history is on GitHub. Pull request [\#21266](https://github.com/anomalyco/opencode/pull/21266), merged on 7 April 2026, added `--dangerously-skip-permissions` to `opencode run`. On 30 June 2026, [\#33279](https://github.com/anomalyco/opencode/pull/33279) made `--yolo` the main flag and kept the long name as an alias. It also added the switch to the TUI. The same day [\#34641](https://github.com/anomalyco/opencode/pull/34641) hid both aliases and left `--auto` in the help.

 

This post covers opencode 1.x. opencode v2 keeps the same three flags but uses a different `permissions` format, and "always" approvals persist per project.

 

My Claude Code post said none of five other agents had a flag by that name. For opencode that was wrong. The alias existed. It was just hidden.

 

## What does opencode --auto approve?

 

Every request that would otherwise ask you. The [permissions page](https://opencode.ai/docs/permissions/) is short on this: "Explicit `"deny"` rules are still enforced. Auto mode only changes requests that would otherwise ask for approval."

 

Without the flag, `opencode run` has nobody to ask. In the v1.19.3 source it prints "auto-rejecting" and replies `reject`. That comes from reading the code, not from a run.

 

Each opencode rule resolves to `allow`, `ask` or `deny`. Under `--auto`, every `ask` behaves like `allow`. `deny` stays `deny`. In the TUI you can switch the mode from the command palette. An "auto" marker then shows next to the agent name.

 

## Why opencode asks less than Claude Code by default

 

The defaults run the other way. The [config page](https://opencode.ai/docs/config/) says "By default, opencode allows all operations without requiring explicit approval." The permissions page lists the exceptions. `doom_loop` and `external_directory` default to `ask`. Reads of `.env` files are denied.

 

So on a fresh install `--auto` changes little. It answers the loop guard and the outside-the-project check. It also answers every `ask` you wrote yourself. The built-in `plan` agent sets edits and bash to `ask`. Read literally, the docs mean `--auto` answers those too. I have not tested it.

 

The docs do not say whether the built-in `.env` deny counts as "explicit" under `--auto`. I have not tested it. If that file matters, write the deny rule into your own config.

 

## How do I set opencode permissions in opencode.json?

 

Use the `permission` key. One string applies to every tool:

 

```json
{
  "$schema": "https://opencode.ai/config.json",
  "permission": "allow"
}
```

 

The object form lets you keep a few stops. Rules match by pattern, and the last matching rule wins. Put the catch-all first. The rule shape below follows the docs. The command list is my example:

 

```json
{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "*": "allow",
    "bash": {
      "*": "allow",
      "git push *": "deny",
      "rm *": "deny"
    }
  }
}
```

 

Two more routes appear in the docs. The [CLI page](https://opencode.ai/docs/cli/) lists `OPENCODE_PERMISSION`, an environment variable with inline JSON rules. Agents can carry their own `permission` block, and those rules win over the global ones.

 

## How does opencode compare with Claude Code and Codex?

 

I use Claude Code and Codex every day. opencode I only read. Keep that in mind for the third row.

 

| Agent | Switch | What still stops it |
| --- | --- | --- |
| Claude Code | `--dangerously-skip-permissions` | Deny rules, explicit ask rules, hook denies, the `rm` breaker on critical paths |
| Codex CLI | `--dangerously-bypass-approvals-and-sandbox`, or `-a never` with a sandbox | With `-a never`, the sandbox you chose. The full bypass drops sandbox and prompts |
| opencode | `--auto`, hidden aliases `--yolo` and `--dangerously-skip-permissions` | Explicit `deny` rules |

 

The pages I read for opencode describe permissions and policies. None of them describes an OS-level sandbox around commands. In Codex the sandbox is a separate layer, covered in my [Codex post](https://getagenttools.com/blog/codex-dangerously-skip-permissions/). In opencode your deny list is the boundary.

 

One difference I like in 1.x. There, "always" on a prompt approves matching patterns "for the rest of the current OpenCode session". In Claude Code the same click writes a rule to a settings file for good. Codex saves it to a rules file. Both lists only grow until you clean them. opencode 1.x lets it expire with the session. In v2 the [permissions page](https://opencode.ai/v2/docs/permissions/) calls saved approvals "durable, project-scoped allow rules".

 

## When would I use opencode --auto?

 

In a container or a throwaway checkout, with deny rules for pushes and deletes. That is the same verdict I gave the Claude Code flag. It holds better here, as `--auto` and the config share one rule system. You can read your config and know what still stops the agent.

 

What I would not do is rely on a hidden alias in scripts. Hidden flags can change without a line in the help. Use `--auto`.

 

## Frequently asked questions

 

### Is --dangerously-skip-permissions the same as --auto in opencode?

 

Per the source, yes. The TUI and `opencode run` treat `--auto`, `--yolo` and `--dangerously-skip-permissions` as one value. Only `--auto` is documented and shown in help.

 

### Does opencode --auto ignore deny rules?

 

No. The permissions page says explicit `deny` rules are still enforced. Auto mode only changes requests that would otherwise ask for approval.

 

### How do I make opencode stop asking for permission?

 

Start it with `opencode --auto`, or set `"permission": "allow"` in `opencode.json`. Add deny rules for commands that must never run, such as `git push *`.

 

### Did you test this?

 

No. I do not run opencode. This post reads the opencode docs and the v1.19.3 source on 17 October 2026. The Claude Code and Codex parts come from my own use.

 

Sources, read on 17 October 2026: opencode [permissions](https://opencode.ai/docs/permissions/), [CLI](https://opencode.ai/docs/cli/), [config](https://opencode.ai/docs/config/) and [agents](https://opencode.ai/docs/agents/) and [policies](https://opencode.ai/docs/policies/) pages, the v2 [permissions](https://opencode.ai/v2/docs/permissions/) page, the [anomalyco/opencode](https://github.com/anomalyco/opencode) repository at tag v1.19.3, and pull requests \#21266, \#33279 and \#34641.

Put this into practice

[See the tool list](https://getagenttools.com/tools/)[Train your team](https://getagenttools.com/#training)
