Nested Permissions in Agent Markdown #7021

Closed
opened 2026-02-16 18:05:55 -05:00 by yindo · 6 comments
Owner

Originally created by @sanchez on GitHub (Jan 20, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I have the following front matter for a markdown subagent:

description: Develop a detailed plan to implement based on the user's requirements.
mode: subagent
model: github-copilot/gpt-5.2-codex
temperature: 0.3
tools:
    write:
        "*": false
        plans/*.md: true
        specs/*.md: true
    edit:
        "*": false
        specs/*.md: ask
    bash: ask
    question: allow

When I try to launch opencode I get the following errors:

↳ Invalid input: expected boolean, received object tools.write
↳ Invalid input: expected boolean, received object tools.edit
↳ Invalid input: expected boolean, received string tools.bash
↳ Invalid input: expected boolean, received string tools.question

Plugins

none

OpenCode version

1.1.28

Steps to reproduce

  1. Create a custom subagent with the frontmatter above
  2. Launch OpenCode

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @sanchez on GitHub (Jan 20, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I have the following front matter for a markdown subagent: ``` description: Develop a detailed plan to implement based on the user's requirements. mode: subagent model: github-copilot/gpt-5.2-codex temperature: 0.3 tools: write: "*": false plans/*.md: true specs/*.md: true edit: "*": false specs/*.md: ask bash: ask question: allow ``` When I try to launch opencode I get the following errors: ``` ↳ Invalid input: expected boolean, received object tools.write ↳ Invalid input: expected boolean, received object tools.edit ↳ Invalid input: expected boolean, received string tools.bash ↳ Invalid input: expected boolean, received string tools.question ``` ### Plugins none ### OpenCode version 1.1.28 ### Steps to reproduce 1. Create a custom subagent with the frontmatter above 2. Launch OpenCode ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 18:05:55 -05:00
yindo closed this issue 2026-02-16 18:05:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 20, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #8114: Task tool permission override no longer works for nested sub-agents
  • #6892: MCP tool permissions not working after migration from tools to permissions
  • #6856: Should we actually implement the new granular permissions in .md agent files?
  • #5701: AGENT.md is invalid without debug information
  • #7810: Opencode will not launch if you set Agent permissions as True/False instead of Allow/Deny

These issues all stem from the same root cause - incomplete support for nested permission objects in agent markdown frontmatter after the permission system migration in PR #6319.

Feel free to ignore if your specific case isn't addressed by these issues.

@github-actions[bot] commented on GitHub (Jan 20, 2026): This issue might be a duplicate of existing issues. Please check: - #8114: Task tool permission override no longer works for nested sub-agents - #6892: MCP tool permissions not working after migration from tools to permissions - #6856: Should we actually implement the new granular permissions in .md agent files? - #5701: AGENT.md is invalid without debug information - #7810: Opencode will not launch if you set Agent permissions as True/False instead of Allow/Deny These issues all stem from the same root cause - incomplete support for nested permission objects in agent markdown frontmatter after the permission system migration in PR #6319. Feel free to ignore if your specific case isn't addressed by these issues.
Author
Owner

@sanchez commented on GitHub (Jan 20, 2026):

I realized I need to use permission not tools however after changing to:

description: Develop a detailed plan to implement based on the user's requirements.
mode: subagent
model: github-copilot/gpt-5.2-codex
temperature: 0.3
permission:
    write:
        "*": false
        plans/*.md: true
        specs/*.md: true
    edit:
        "*": false
        specs/*.md: ask
    bash: ask
    question: allow

I now get the error:

↳ Invalid input permission
@sanchez commented on GitHub (Jan 20, 2026): I realized I need to use permission not tools however after changing to: ``` description: Develop a detailed plan to implement based on the user's requirements. mode: subagent model: github-copilot/gpt-5.2-codex temperature: 0.3 permission: write: "*": false plans/*.md: true specs/*.md: true edit: "*": false specs/*.md: ask bash: ask question: allow ``` I now get the error: ``` ↳ Invalid input permission ```
Author
Owner

@sanchez commented on GitHub (Jan 20, 2026):

Realized I need an s on the permission bit, I think the documentation might need an update: https://opencode.ai/docs/permissions#agents

Apologies, and thanks for making an awesome tool

@sanchez commented on GitHub (Jan 20, 2026): Realized I need an `s` on the permission bit, I think the documentation might need an update: https://opencode.ai/docs/permissions#agents Apologies, and thanks for making an awesome tool
Author
Owner

@beatwade commented on GitHub (Jan 21, 2026):

Realized I need an s on the permission bit, I think the documentation might need an update: https://opencode.ai/docs/permissions#agents

Apologies, and thanks for making an awesome tool

why use s? the source code point out the agent md format should be permission
https://github.com/anomalyco/opencode/blob/6d574549bcd6f0b210ba4e7a0c08d3f03f30795c/packages/opencode/src/tool/skill.ts#L15C1-L16C1

@beatwade commented on GitHub (Jan 21, 2026): > Realized I need an `s` on the permission bit, I think the documentation might need an update: https://opencode.ai/docs/permissions#agents > > Apologies, and thanks for making an awesome tool why use s? the source code point out the agent md format should be permission https://github.com/anomalyco/opencode/blob/6d574549bcd6f0b210ba4e7a0c08d3f03f30795c/packages/opencode/src/tool/skill.ts#L15C1-L16C1
Author
Owner

@sanchez commented on GitHub (Jan 21, 2026):

When I had permission OpenCode wouldn't open, but when I had permissions then OpenCode would open

@sanchez commented on GitHub (Jan 21, 2026): When I had `permission` OpenCode wouldn't open, but when I had `permissions` then OpenCode would open
Author
Owner

@MirkoRischke commented on GitHub (Feb 3, 2026):

The reason is that permission is a property of opencode. When you specify this attribute, its syntax is verified. When you specified permissions, you used an attribute that is not known to opencode. In this case, it'll just pass this property to the model provider as described in the docs here.

@MirkoRischke commented on GitHub (Feb 3, 2026): The reason is that `permission` is a property of opencode. When you specify this attribute, its syntax is verified. When you specified `permissions`, you used an attribute that is not known to opencode. In this case, it'll just pass this property to the model provider as [described in the docs here](https://opencode.ai/docs/agents/#additional).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7021