Starts Nov 23Live Cohort 3 of Vibe Coding & AI Agents (Nov 23, 18:30 MSK): 3 weeks, 9 live hands-on sessionsCohort 3 (Nov 23) →
ReleaseCode / SDK · ActionableHabr AI→ original

Open-Source OpenCode v2 Splits Work Across Six AI Agents and Limits Their Permissions

OpenCode is an open-source (MIT-licensed) alternative to Claude Code that runs AI agents in the terminal; version 2 was released on October 12, 2026. The author of the Habr breakdown does not give a single agent all the rights, because otherwise it would write the code, review it itself, and edit the README. Work is divided among six roles, and only the coder writes core code. That is why you should first define the permissions of each role, and only then choose the models.

AI-processed from Habr AI; edited by Hamidun News
Open-Source OpenCode v2 Splits Work Across Six AI Agents and Limits Their Permissions
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Service tasks (context compression, titles) go to a cheap small_model
In v2 the fields were renamedagent → agents, skill → skills, task → subagent
Key metric #375+ providers are supported out of the box, from Anthropic to Ollama

Imagine giving an intern full access to a repository: they write the code, check it themselves, and with great enthusiasm rewrite the README too. That is roughly how a "universal" AI agent behaves when it is allowed to do everything. The author of a recent Habr breakdown proposes a different approach: split the work among several agents and strictly limit the rights of each one. He demonstrates this with OpenCode, an open tool that runs AI agents in the terminal. Version 2 was released on October 12, 2026, and the breakdown is about that version.

What a harness is and where OpenCode fits

The author calls "harness" everything configured around the model itself: context compression, skills (prepared instructions for the agent), MCP, A2A, and tools. In his formulation, an AI agent is a gateway to a model plus this wrapper. He claims that a less powerful model with a good harness can outperform a top-tier LLM without one. The text contains no benchmarks, so this is the author's observation, not a proven fact.

Claude Code is often named as the best harness, but it is closed and tied to Anthropic, which, according to the author, blocks some clients. OpenCode is an alternative with an MIT license and no vendor lock-in. Out of the box it works with 75+ providers, from Anthropic and OpenAI to local models via Ollama. Do you want a cheap model handling routine work and a flagship handling architecture? You only need to change one line in the config.

Your own gateway connects through an OpenAI-compatible interface: the config specifies a name, the environment variable holding the key, a baseURL, and a list of models. In CI the key is passed through environment variables; locally you can run opencode auth login. The author also promotes his own service, BotHub, with payment in rubles, so these fragments should be read as an advertising integration. The same config will work with any other gateway.

The separate small_model setting hands routine work to a cheap model: context compression, session titles, summaries, and minor internal requests. A flagship is not needed for those.

Six roles instead of one agent

The main idea of the breakdown is division of labor. The author lists six roles:

  • the orchestrator breaks the task down and distributes it to other agents; in the author's table, it is forbidden to edit files;
  • the architect reads the code and plans, and is not allowed to edit files;
  • the coder is the only one who writes core code;
  • the reviewer gets a shell only for read commands;
  • the security agent checks the code using grep and security scanners;
  • docs and tests run on a cheap model and edit files only in narrow paths such as docs/ and tests/.

There are savings too. Each agent has its own context, so context compression mid-task happens later. Subagents work in the background: the main agent keeps doing its work and picks up the result when it is ready. The number of roles is not a dogma: a colleague of the author uses about eight agents, while others get by with two or three.

An agent has three modes: primary (the main conversational partner of the session), subagent (launched in a child session), and all. The built-in build and plan agents are switched with the Tab key. The author advises reading someone else's repository in plan mode or under a read-only agent, so that no unwanted edits happen.

How permissions are set

In the config, permissions are described by a triple: action (subagent, edit, shell, webfetch), resource, and effect with the values allow, ask, or deny. For example, the reviewer is forbidden to edit files and use webfetch, while shell is allowed. The coder is allowed to edit, and shell goes through an ask confirmation. Each agent also gets its own temperature: 0.0 for the coder, 0.2 for the reviewer.

If you are upgrading from the first version, run opencode upgrade --major. Then check your old config: the terminology has changed (agent became agents, skill became skills, task became subagent), and by default everything is now enabled, so anything unneeded has to be disabled explicitly.

What to do in practice

Start with two or three roles, not a dozen. Define the permissions first, then choose the models: let one coder write, while the reviewer and the security agent only read. Hand service tasks to the cheap small_model. The model names in the config examples are the author's personal choice; pick ones that fit your tasks and budget. In the available version of the source article, the text cuts off at the description of the security agent, so for the remaining settings you should consult the original.

Story

Key Questions Answered

What a harness is and where OpenCode fits?

The author calls "harness" everything configured around the model itself: context compression, skills (prepared instructions for the agent), MCP, A2A, and tools. In his formulation, an AI agent is a gateway to a model plus this wrapper. He claims that a less powerful model with a good harness can outperform a top-tier LLM without one. The text contains no benchmarks, so this is the author's observation, not a proven fact.

What are the key details on Six roles instead of one agent?

The main idea of the breakdown is division of labor. The author lists six roles: the orchestrator breaks the task down and distributes it to other agents; in the author's table, it is forbidden to edit files; the architect reads the code and plans, and is not allowed to edit files; the coder is the only one who writes core code; the reviewer gets a shell only for read commands; the security agent checks the code using grep and security scanners; docs and tests run on a cheap model and edit files…

How permissions are set?

In the config, permissions are described by a triple: action (subagent, edit, shell, webfetch), resource, and effect with the values allow, ask, or deny. For example, the reviewer is forbidden to edit files and use webfetch, while shell is allowed. The coder is allowed to edit, and shell goes through an ask confirmation. Each agent also gets its own temperature: 0.0 for the coder, 0.2 for the reviewer. If you are upgrading from the first version, run opencode upgrade --major.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…