Agent Configuration
This page documents all supported agent configuration options in OpenCode.
Agent configuration controls:
- Tool availability
- Skill access
- Permission boundaries
- Agent-specific overrides
This is a reference page. For conceptual guidance, see:
Configuration locations
Agent configuration can appear in two places:
1. Built-in agents
Configured in
opencode.json:{
"agent": {
"<agent-name>": {
// agent configuration
}
}
}
2. Custom agents
Defined using YAML frontmatter in agent files:
---
# agent configuration
---
permission
Controls what an agent is allowed to access.
Schema
permission:
<resource-type>:
<pattern>: allow | deny | ask
Supported resource types
| Resource | Description |
|---|---|
| skill | Agent skills |
| tool | Tools (including MCP tools) |
Unknown resource types are ignored.
Patterns
Patterns are matched by name and support wildcards.
| Pattern | Matches |
|---|---|
| * | All resources |
| internal-* | internal-docs, internal-tools |
| review-* | review-code, review-security |
Values
| Value | Behavior |
|---|---|
| allow | Resource is immediately available |
| deny | Resource is hidden and inaccessible |
| ask | User approval required before access |
Example
permission:
skill:
"*": allow
"internal-*": deny
tool:
"browser": ask
tools
Enables or disables tools for the agent.
Schema
tools:
<tool-name>: true | false
If a tool is set to
false, it is completely disabled and hidden.Example
tools:
skill: true
browser: false
Overrides and precedence
Configuration is merged in the following order (lowest → highest priority):
- Global configuration
- Built-in agent configuration
- Custom agent configuration
Higher-priority settings override lower ones.
Built-in agent override example
{
"agent": {
"plan": {
"permission": {
"skill": {
"internal-*": "allow"
}
},
"tools": {
"skill": true
}
}
}
}
Custom agent example
---
permission:
skill:
"documents-*": allow
"experimental-*": ask
tools:
skill: true
---
Disable all skills for an agent
To prevent an agent from using skills entirely:
tools:
skill: false
When disabled, skills are omitted from the agent’s tool list.
Notes and constraints
- Permission patterns are evaluated per resource type
denyalways hides a resource- Tool disablement overrides permission rules
- Unknown fields are ignored
- Invalid patterns are skipped silently