Markdown agents don't respect tool rules (very well) #1662

Closed
opened 2026-02-16 17:32:01 -05:00 by yindo · 7 comments
Owner

Originally created by @teamcoltra on GitHub (Sep 9, 2025).

Originally assigned to: @rekram1-node on GitHub.

I have the following header for my agent:

---
name: golang-pro
description: Write idiomatic Go code with goroutines, channels, and interfaces. Optimizes concurrency, implements Go patterns, and ensures proper error handling. Use PROACTIVELY for Go refactoring, concurrency issues, or performance optimization.
model: github-copilot/gpt-5-mini
mode: primary
temperature: 0.5
tools:
  bash: true
  edit: true
  write: true
  read: true
  grep: true
  glob: true
  list: true
  patch: true
  todowrite: true
  todoread: true
  webfetch: true
---

I tried setting no tools because the docs say that will allow everything but it didn't allow anything, so when I changed all the tools to true that worked.

However, it still asks for permission every time to do most tasks. Even when I say "a" for always it wants permission to do the same task again.

I thought maybe I would change "true" to "always" but that breaks it and you can't start the program with that config.

Is there a bug or am I messing something up?

Originally created by @teamcoltra on GitHub (Sep 9, 2025). Originally assigned to: @rekram1-node on GitHub. I have the following header for my agent: ``` --- name: golang-pro description: Write idiomatic Go code with goroutines, channels, and interfaces. Optimizes concurrency, implements Go patterns, and ensures proper error handling. Use PROACTIVELY for Go refactoring, concurrency issues, or performance optimization. model: github-copilot/gpt-5-mini mode: primary temperature: 0.5 tools: bash: true edit: true write: true read: true grep: true glob: true list: true patch: true todowrite: true todoread: true webfetch: true --- ``` I tried setting no tools because the docs say that will allow everything but it didn't allow anything, so when I changed all the tools to true that worked. However, it still asks for permission every time to do most tasks. Even when I say "a" for always it wants permission to do the same task again. I thought maybe I would change "true" to "always" but that breaks it and you can't start the program with that config. Is there a bug or am I messing something up?
yindo closed this issue 2026-02-16 17:32:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 9, 2025):

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

  • #1961: Discussion about unifying tools and permissions blocks in agent configuration
  • #2264: Feature request for persisting permission requests - mentions similar behavior where permissions aren't properly remembered
  • #1813: Feature request for yolo/auto-accept mode - addresses the same core issue of wanting to avoid repeated permission prompts
  • #1885: Reports behavior weirdness with permissions where 'always' doesn't work as expected

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 9, 2025): This issue might be a duplicate of existing issues. Please check: - #1961: Discussion about unifying tools and permissions blocks in agent configuration - #2264: Feature request for persisting permission requests - mentions similar behavior where permissions aren't properly remembered - #1813: Feature request for yolo/auto-accept mode - addresses the same core issue of wanting to avoid repeated permission prompts - #1885: Reports behavior weirdness with permissions where 'always' doesn't work as expected Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 9, 2025):

this is where things are a bit confusing rn, tools and permissions are unfortunately different things right now, what you are looking for is permissions: https://opencode.ai/docs/permissions/#edit

@rekram1-node commented on GitHub (Sep 9, 2025): this is where things are a bit confusing rn, tools and permissions are unfortunately different things right now, what you are looking for is permissions: https://opencode.ai/docs/permissions/#edit
Author
Owner

@arsham commented on GitHub (Sep 10, 2025):

@teamcoltra this is what I've found out so far:

---
description: What you need to do
mode: subagent

permission:
  "*": "ask"
  bash:
    "*": "ask"
    "fd *": "allow"
    "opencode": "deny"

tools:
  "*": false
  read: true
  bash: true
---

In this fictional setup, I have said this agent doesn't have access to any tools other than read and bash. It is important to use * form to disable everything because there are default tools available. The same process goes to the permission section. It says I want you to ask me for anything you want to do, but I will allow you to do Bash(fd *) without needing to ask anything, but you can't do Bash(opencode) at all.

Here is another scenario:

---
description: What you need to do
mode: subagent

permission:
  brave-search*: "allow"

tools:
  brave-search*: true
---

In short: you provide tools to the agent or restrict access to them, and you give permission to things you care about.

@rekram1-node I wish we had the conversation section or wiki open in this project. There are too many things people could share to teach each other.

@arsham commented on GitHub (Sep 10, 2025): @teamcoltra this is what I've found out so far: ```yaml --- description: What you need to do mode: subagent permission: "*": "ask" bash: "*": "ask" "fd *": "allow" "opencode": "deny" tools: "*": false read: true bash: true --- ``` In this fictional setup, I have said this `agent` doesn't have access to any tools other than `read` and `bash`. It is important to use `*` form to disable everything because there are default tools available. The same process goes to the `permission` section. It says I want you to `ask` me for anything you want to do, but I will allow you to do `Bash(fd *)` without needing to ask anything, but you can't do `Bash(opencode)` at all. Here is another scenario: ```yaml --- description: What you need to do mode: subagent permission: brave-search*: "allow" tools: brave-search*: true --- ``` In short: you provide tools to the agent or restrict access to them, and you give permission to things you care about. @rekram1-node I wish we had the conversation section or wiki open in this project. There are too many things people could share to teach each other.
Author
Owner

@teamcoltra commented on GitHub (Sep 10, 2025):

this is where things are a bit confusing rn, tools and permissions are unfortunately different things right now, what you are looking for is permissions: https://opencode.ai/docs/permissions/#edit

Yeah, I think I have a two part problem then and not sure if it should be split off or how you want that. Because even still in the actual execution when I type "a" for always it should at least set that permission to be always at least for this session for that rule but I think it asks per file it interacts with? To me "always" should mean at least everything in the session.

But also those docs don't list the permissions being used in a markdown file. Probably because that's not the preferred way of doing it. The second reply here seems to have the right answer but that's not in the docs.

:) if there's any bluntness in my reply it's 3AM and I'm really happy I've got such helpful responses to my problem and my tone is not intended to be anything but sharing my perspective and issues.

@teamcoltra commented on GitHub (Sep 10, 2025): > this is where things are a bit confusing rn, tools and permissions are unfortunately different things right now, what you are looking for is permissions: https://opencode.ai/docs/permissions/#edit Yeah, I think I have a two part problem then and not sure if it should be split off or how you want that. Because even still in the actual execution when I type "a" for always it should at least set that permission to be always at least for this session for that rule but I think it asks per file it interacts with? To me "always" should mean at least everything in the session. But also those docs don't list the permissions being used in a markdown file. Probably because that's not the preferred way of doing it. The second reply here seems to have the right answer but that's not in the docs. :) if there's any bluntness in my reply it's 3AM and I'm really happy I've got such helpful responses to my problem and my tone is not intended to be anything but sharing my perspective and issues.
Author
Owner

@rekram1-node commented on GitHub (Sep 15, 2025):

The permissions are documented for agents in markdown in this section:
https://opencode.ai/docs/agents/#permissions

Also @teamcoltra I totally agree with your take on permissions that should be fixed on latest! Let me know if it is not to your liking and I can take another look

@rekram1-node commented on GitHub (Sep 15, 2025): The permissions are documented for agents in markdown in this section: https://opencode.ai/docs/agents/#permissions Also @teamcoltra I totally agree with your take on permissions that should be fixed on latest! Let me know if it is not to your liking and I can take another look
Author
Owner

@rekram1-node commented on GitHub (Sep 15, 2025):

btw @arsham in your example:

permission:
  brave-search*: "allow"

Permissions only work for 3 things right now: "bash", "webfetch", and "edit"

soon permissions + tools will be combined to allow for your example

@rekram1-node commented on GitHub (Sep 15, 2025): btw @arsham in your example: ``` permission: brave-search*: "allow" ``` Permissions only work for 3 things right now: "bash", "webfetch", and "edit" soon permissions + tools will be combined to allow for your example
Author
Owner

@arsham commented on GitHub (Sep 15, 2025):

@rekram1-node thanks mate!

@arsham commented on GitHub (Sep 15, 2025): @rekram1-node thanks mate!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1662