anomalyco / anomalyco/opencode
permission.skill / tools.skill in standalone agent .md frontmatter is parsed but silently ignored at config resolution
@kitlangton is already working on this.
Since Aug 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Title: permission.skill / tools.skill in standalone agent .md frontmatter is parsed but silently ignored at config resolution
Summary
Setting permission.skill or tools.skill in a standalone agent definition
file (e.g. ~/.config/opencode/agents/<name>.md) is accepted without error —
the value appears verbatim in the raw prompt field returned by
opencode debug agent <name> — but does NOT propagate to the resolved
tools/permission object used at request time. The only way to actually
restrict skill access for an agent is to define the override inside
opencode.json's top-level agent.<name>.permission.skill block instead.
This is confusing because both locations use identical YAML/JSON syntax and
neither documentation nor CLI output indicates that one is authoritative and
the other is not.
Steps to reproduce
- Create
~/.config/opencode/agents/my-agent.mdwith frontmatter:
***
description: test agent
mode: primary
model: <any provider/model>
permission:
edit: deny
bash: ask
skill:
"*": deny
***
- Run
opencode debug agent my-agent - Observe: the
promptfield shows the frontmatter exactly as written
(including theskill: "*": denyblock), but the resolvedtoolsobject
at the bottom of the same output still shows"skill": true - Confirm the tool is still callable: run
opencode run "<any prompt that might invoke a skill>" --agent my-agent— the model can still invoke the
skilltool and load skill content
Expected behavior
Either:
(a) permission.skill / tools.skill in standalone agent .md frontmatter
should be honored at resolution time, matching the behavior documented
for opencode.json's agent.* block, OR
(b) if standalone agent files intentionally support a reduced frontmatter
schema that excludes tool/permission overrides, this should be stated
explicitly in the docs and ideally surfaced as a warning/error when an
unsupported key is present, rather than silently accepted and ignored
Actual behavior
Silent no-op. The only working fix is duplicating the agent's tool
restriction inside opencode.json:
{
"agent": {
"my-agent": {
"permission": {
"skill": { "*": "deny" }
}
}
}
}
Impact
For agents with a large local + global skill catalog (105 skills in one tested
case, ~1.29MB of serialized skill metadata), this caused every request to
carry an unnecessarily large tool-calling prompt, costing significant prompt
evaluation time and obscuring the real working configuration path.
Environment
- OpenCode version: 1.18.15
- OS: macOS (Apple Silicon)
- Model provider: Ollama (local), qwen2.5-coder:14b-16k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.