Launch offer: use code LAUNCH20 for 20% off any single pack. See all kits

OpenCode 2 Agents and Permissions: V1 Fields It Silently Ignores

Published 2026-11-24 · 6 min read · by AgentKit Co

OpenCode 2 (released October 12, 2026) still reads your V1 opencode.json and .opencode/agents/*.md files, and the official migration guide says converting them is optional. That's true. But a few V1 settings now do nothing, and one of them can switch off the restrictions on a read-only agent without an error on screen.

We checked this on 2026-11-24 against OpenCode's Migrate from V1, Agents, Permissions and Instructions docs.

Download free-opencode-v2-check.zip (MIT: opencode-v2-check.py is read-only and stdlib-only. It flags V1 settings that V2 ignores and prints V2 permissions for your old blocks. Also included: a native-V2 opencode.jsonc, a read-only reviewer subagent, an AGENTS.md and a 50-test test.sh.)

python3 opencode-v2-check.py . --suggest

Trap 1: one V2 field turns off your V1 restrictions

From the migration guide: "A file that uses any of permissions, request, system, or disabled is read as V2, and V1 fields in it, such as name, tools, permission, or temperature, are ignored with a warning in the log."

Two popular OpenCode agent collections on GitHub that we looked at still use V1 frontmatter (tools:, permission:, temperature:). Say you take a read-only reviewer like this and add disabled: false because the V2 docs mention it:

---
description: Reviews code without changing it
mode: subagent
disabled: false        # <- this one line makes the file V2
tools:
  write: false         # ignored
  bash: false          # ignored
permission:
  edit: deny           # ignored
---

The file is now read as V2, so tools and permission are dropped. The "read-only" reviewer falls back to your global rules, and anything they don't cover is ask, not deny. The only sign is a line in the log. The fix is to convert the whole file at once:

---
description: Reviews code without changing it
mode: subagent
permissions:
  - action: edit
    resource: "*"
    effect: deny
  - action: shell
    resource: "*"
    effect: deny
  - action: shell
    resource: "git diff *"
    effect: allow
---

The same rule holds in JSON: OpenCode doesn't infer formats inside a single agent, command or provider entry, so keep each entry entirely V1 or entirely V2.

Trap 2: rule order now matters (last match wins)

V2 replaces the per-tool permission object with one ordered permissions list. "The last matching rule wins, so put broad rules before exceptions." This list blocks nothing, because the broad allow comes last:

"permissions": [
  { "action": "shell", "resource": "git push *", "effect": "deny" },
  { "action": "shell", "resource": "*", "effect": "allow" }   // overrides the deny
]

Flip the order. Also, global rules load first and agent rules are appended after them, so an agent's broad rule can override a global exception.

Trap 3: the action names changed

bash is now shell, task is now subagent, and write and patch fold into edit. A V2 rule written with "action": "bash" uses the old name. The checker flags it so you don't have to work out whether it matches anything.

Trap 4: paths outside the project are allowed by default

"V1 asks before accessing paths outside the project. V2 does not: external_directory is allowed by default." To keep the V1 behavior:

{ "action": "external_directory", "resource": "*", "effect": "ask" }

Trap 5: temperature on an agent does nothing

Both collections we looked at put temperature: 0.1 in their agent templates. In V2, agent temperature, top_p and options end up in request.body, which "the V2 session runner preserves but does not yet send with model requests." If you need a lower temperature, set it on a model variant and point the agent at provider/model#variant.

Everything else that moved

V1 V2 What happens if you keep V1
agent, mode maps agents translated
prompt, disable, maxSteps system, disabled, steps translated (but see Trap 1)
model + variant provider/model#variant translated
permission object, tools: {x: false} ordered permissions, deny rule translated
command, subtask commands, subagent translated
.opencode/mode/, modes/ .opencode/agents/ + mode: primary still discovered
plugin, .opencode/plugin/ plugins, new plugin API V1 plugin code does not run
mcp.<name>, enabled mcp.servers.<name>, disabled translated
logLevel, server, top-level subagent_depth env var, service options, experimental.subagent_depth ignored with a warning
compaction.tail_turns, compaction.prune compaction.keep.tokens ignored with a warning
per-project tui.json global ~/.config/opencode/cli.json global file auto-migrated

What OpenCode reads for instructions

  • ~/.config/opencode/AGENTS.md, then every AGENTS.md from the current folder up to the project root. They are combined, not overridden, and OpenCode doesn't resolve conflicts between them.
  • A folder without AGENTS.md falls back to its CLAUDE.md. If both exist in one folder, AGENTS.md wins. V2 picks per folder, so (unlike V1) a root AGENTS.md no longer hides a nested CLAUDE.md.
  • Nested AGENTS.md files below the workspace load when the agent reads files in that area.
  • Extra files go in "instructions": ["CONTRIBUTING.md", "docs/*.md"].

Note: one community V2 guide says the CLAUDE.md fallback is gone in V2. The official docs (checked 2026-11-24) say V2 keeps it. Trust the official docs, or run opencode-v2-check.py to see which files are present.

What the checker prints

$ python3 opencode-v2-check.py . --quiet
OpenCode V2 check: /home/me/demo
  config files: opencode.json
  instruction files: AGENTS.md
ERROR  .opencode/agents/reviewer.md: read as V2 (it has disabled), so its V1 fields tools, permission
       are ignored. Its tools / permission restrictions do NOTHING. Convert the whole entry to V2.
WARN   .opencode/agents/release.md: read as V2 (it has permissions), so its V1 fields temperature
       are ignored. Convert the whole entry to one format.
WARN   .opencode/agents/release.md: rule 2 (shell * allow) comes after rule 1 (shell 'git push *'),
       so it overrides it: last match wins. Put broad rules first.
WARN   permissions: no external_directory rule. V2 allows access to paths outside the project by
       default (V1 asked first). To keep the V1 behavior add {"action": "external_directory", ...}
1 error(s), 3 warning(s), 1 note(s)

It never edits files. Exit code 0 means clean, 2 means warnings, 1 means errors, so you can run it in CI. OpenCode's own suggestion also works: ask OpenCode to "Migrate my OpenCode configuration, including file-based definitions, from the V1 format to the native V2 format", then run the checker on the result.

FAQ

Do I have to migrate my OpenCode config for V2? No. V2 reads V1 config from the same locations. You do have to port plugins and anything that calls the server API.

Where do OpenCode agents go? .opencode/agents/<name>.md in the project or ~/.config/opencode/agents/<name>.md globally. A nested path becomes part of the id: .opencode/agents/team/reviewer.md is team/reviewer.

Does OpenCode read AGENTS.md? Yes. It's the main instruction file, with CLAUDE.md as a per-folder fallback.

What's the default if no permission rule matches? ask.

One rules file for every agent

OpenCode reads AGENTS.md, like Codex, Cursor, Copilot, Zed and Junie. The free AGENTS.md generator builds one. The AI Coding Agent Config Kit adds templates for 12 stacks. More: AGENTS.md examples, Claude Code subagents and AGENTS.md not working?.

AgentKit Co is not affiliated with Anomaly or OpenCode.

AI Coding Agent Config Kit · $14 · 30-day refund

One AGENTS.md for OpenCode and every other agent

AGENTS.md templates for 12 stacks, a CLAUDE.md with .claude/rules, 8 Cursor .mdc rules, Copilot instructions and 12 prompts that draft, audit and trim them. No OpenCode agent or permission files; the free checker kit above covers those.

Not ready to buy? Get our free Agent Skills pack on Gumroad (pay what you want, $0 is fine; Gumroad asks for your email to deliver it). Get the free skills

Keep reading

Agent Skills (SKILL.md) Explained: Formats, Folders and SafetyWhat an Agent Skill is, how SKILL.md works, which folders Claude Code, Codex, Cursor and Copilot read, and how to write and vet one. Checked on 2026-10-17.5 min readAGENTS.md Examples: 7 Copy-Paste Files for Real Projects (2026)Seven AGENTS.md examples to copy: Next.js, Python API, Go, a monorepo with nested files, a global ~/.codex file, an override and review rules.8 min readWhat Is an AI Agent? Plain-English Guide for BeginnersWhat an AI agent is, how it differs from a chatbot or automation, and the four building blocks every agent has. No jargon.4 min read