anomalyco / anomalyco/opencode

permission.skill / tools.skill in standalone agent .md frontmatter is parsed but silently ignored at config resolution

Open
#41,712 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Create ~/.config/opencode/agents/my-agent.md with frontmatter:
***
description: test agent
mode: primary
model: <any provider/model>
permission:
  edit: deny
  bash: ask
  skill:
    "*": deny
***
  1. Run opencode debug agent my-agent
  2. Observe: the prompt field shows the frontmatter exactly as written
    (including the skill: "*": deny block), but the resolved tools object
    at the bottom of the same output still shows "skill": true
  3. 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
    skill tool 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.