Extension gating
// agent.json
{
"tools": {"mode": "automatic", "disabled": ["bash", "*_dangerous"]},
"skills": {"disabled": ["devops/*"], "allowed": [], "categories": ["research", "writing"]},
"mcp": {"disabled": ["slack"], "allowed": [], "required": ["drawio*"]}
}
Fields
| Field | tools | skills | mcp | Effect |
|---|---|---|---|---|
disabled | Yes | Yes | Yes | Matching names are rejected |
allowed | Yes | Yes | Yes | When non-empty, only matches pass |
categories | No | Yes | No | When non-empty, a skill that declares a category must match |
required | No | No | Yes | Any pattern matching no remaining server stops the turn |
mode | Yes | No | No | automatic (default), selected, none |
Patterns use fnmatch.fnmatchcase: *, ?, [abc]; an exact name is the trivial case. mcp patterns match the server name, the part of <server>__<tool> before __. With mode: selected, tools.allowed holds exact names. Plugins are not gated: a plugin is a host-level contributor, and gating applies to the skills, tools and MCP it contributes.
Resolution order
disabled: a match rejects.allowed, if non-empty: no match rejects.categories: a non-empty list rejects a categorized skill outside it.required, MCP only, checked after filtering: an unmatched pattern fails the whole turn.
Why this shape
Claude Code's per-type fields with opencode's wildcard expressiveness. Each field says what it gates; one pattern replaces five names; a new extension type is a new block of the same shape. Comparison: Reference comparison.
Examples
| Agent | Profile | Model sees |
|---|---|---|
| Customer service | | No edit tools, only those skill categories, no MCP |
| DevOps | | Everything but two skills. Without GitHub and k8s MCP the turn fails before the provider runs |
| Research | | Those tools plus web search, research skills, those MCP servers |
web_search is outside the default tool list, so allowed alone does not add it.
When not to use gating
Default: install skills globally, configure no gates, let the model choose from each skill's description. Add a gate after observing specific bad behaviour, when:
- a skill needs a hard wall (
prod-deploynever in customer service); - the permitted set is shorter to list than to tune descriptions for;
- an agent makes no sense without a given MCP server.
Implementation map · Not built · Calling unification (six-layer gating for function calling) · Skills and plugins (catalogues, discovery, hot reload)