Expand description
The OpenCode V2 opencode.json shape, rendered by one builder.
Both the bridge (user or managed tier on a device) and the headless
agent-runs host (an isolated run home) emit this document, so the keys
cannot drift between them. Only the V2 shape (@opencode/cli >= 2.0.30)
is modelled: providers.<id>{package, settings, models}, policies,
mcp.servers.
policies are evaluated last-match-wins by OpenCode; a tool.use
resource is <tool>:<pattern> and an integration.use resource is
mcp:<name>, plugin:<id or path> or skill:<id>. lockdown_policies
relies on that ordering: each allow follows the deny it carves out of. A
plugin allowed by path is safe only where the user cannot write that path.
Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.
Modules§
- agents_
md - The bridge-owned block of
OpenCode’sAGENTS.md.
Structs§
- Lockdown
- What
lockdown_policiesconfines a client to. - McpBlock
- Model
Entry - Model
Limit - Open
Code Config - A whole V2
opencode.jsondocument. - Policy
- One
policies[]statement. - Provider
- One
providers.<id>entry. - Provider
Settings
Enums§
- ApiKey
Ref - Where
OpenCodereads a secret from at load time; never the secret. - McpO
Auth - A remote server’s
oauthsetting.OpenCoderegisters every remote server as an OAuth integration and answers a 401 with client registration unlessoauthisfalse; only that opt-out is modelled. - McpServer
- One
mcp.servers.<name>entry. - Policy
Action - Policy
Effect