Custom Agent Writes/Edits Files Despite Configuration Restrictions #2613

Closed
opened 2026-02-16 17:36:28 -05:00 by yindo · 3 comments
Owner

Originally created by @Regboy744 on GitHub (Nov 5, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

Description:

I have set up a custom agent in OpenCode and configured it not to allow writing or editing files. However, I’ve noticed that the agent is still able to perform write and edit operations on files, which goes against my configuration settings.

Steps to Reproduce:

  1. Create a custom agent in OpenCode.
  2. In the agent’s configuration, explicitly disable file writing and editing permissions.
  3. Interact with the agent and request an operation that would normally require writing or editing a file.
  4. Observe that the agent still writes/edits files.

Expected Behavior:

The agent should not be able to write or edit any files when these permissions are disabled in the
configuration.

Actual Behavior:

The agent is able to write and edit files even though the configuration restricts these actions.

Environment:

  • Platform: Linux
  • OpenCode version: 1.0.26
  • Agent type: Custom config below

config file ask.md

description: Answers general questions on any topic
mode: primary
temperature: 0.5
tools:
write: false
edit: false
bash: false
read: true
grep: true
web_search:true
web_fetch: true


You are in ASK mode. Focus on:

  • Use a easy vocabulary to explain.

  • Use examples.

  • How do I implement this.

  • When possible use 5W to explain.

  • If the question has multiples answers give the best one.

  • Explain in detail.

  • Give me a good answer, not too short either not too long.

  • If possible use comparison.

  • You can give the around 10k tokes response.

  • When the subject has more than one way to use, help me with a mental model.

  • DO NOT REPEAT THE SAME EXPLANATION ABOUT THE SAME THING THAT WAS ALREADY EXPLAINED.

  • If you find the word short at the beginner or at the end, give a short answer.

Provide constructive feedback without making direct changes.

Originally created by @Regboy744 on GitHub (Nov 5, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question Description: I have set up a custom agent in OpenCode and configured it not to allow writing or editing files. However, I’ve noticed that the agent is still able to perform write and edit operations on files, which goes against my configuration settings. Steps to Reproduce: 1. Create a custom agent in OpenCode. 2. In the agent’s configuration, explicitly disable file writing and editing permissions. 3. Interact with the agent and request an operation that would normally require writing or editing a file. 4. Observe that the agent still writes/edits files. Expected Behavior: The agent should not be able to write or edit any files when these permissions are disabled in the configuration. Actual Behavior: The agent is able to write and edit files even though the configuration restricts these actions. Environment: - Platform: Linux - OpenCode version: 1.0.26 - Agent type: Custom config below config file ask.md description: Answers general questions on any topic mode: primary temperature: 0.5 tools: write: false edit: false bash: false read: true grep: true web_search:true web_fetch: true --- You are in ASK mode. Focus on: - Use a easy vocabulary to explain. - Use examples. - How do I implement this. - When possible use 5W to explain. - If the question has multiples answers give the best one. - Explain in detail. - Give me a good answer, not too short either not too long. - If possible use comparison. - You can give the around 10k tokes response. - When the subject has more than one way to use, help me with a mental model. - DO NOT REPEAT THE SAME EXPLANATION ABOUT THE SAME THING THAT WAS ALREADY EXPLAINED. - If you find the word short at the beginner or at the end, give a short answer. Provide constructive feedback without making direct changes.
yindo closed this issue 2026-02-16 17:36:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2025):

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

  • #3575: BUG: Overriding built-in agents, doesn't allow overriding permissions - Reports similar issue where custom agent permissions are not being respected
  • #3895: Built-in agent overrides don't fully apply - Similar problem with custom agent configurations not being properly applied
  • #3808: Task should inherit current agent permissions/tools for MCP - Related issue about agents circumventing tool restrictions
  • #2709: Plan Agent does modifications to files - Reports agents ignoring read-only restrictions and modifying files

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

@github-actions[bot] commented on GitHub (Nov 5, 2025): This issue might be a duplicate of existing issues. Please check: - #3575: BUG: Overriding built-in agents, doesn't allow overriding permissions - Reports similar issue where custom agent permissions are not being respected - #3895: Built-in agent overrides don't fully apply - Similar problem with custom agent configurations not being properly applied - #3808: Task should inherit current agent permissions/tools for MCP - Related issue about agents circumventing tool restrictions - #2709: Plan Agent does modifications to files - Reports agents ignoring read-only restrictions and modifying files Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 5, 2025):

So the ask agent is making file edits?

Can u run: opencode debug config and show me the output

@rekram1-node commented on GitHub (Nov 5, 2025): So the ask agent is making file edits? Can u run: `opencode debug config` and show me the output
Author
Owner

@Regboy744 commented on GitHub (Nov 5, 2025):

i found the answer . it was missing the the --- on the top.


description: Answers general questions on any topic
mode: primary
temperature: 0.5
permission:
edit: deny
bash: ask
webfetch: true
websearch: true
webfetch: true

done

thanks

@Regboy744 commented on GitHub (Nov 5, 2025): i found the answer . it was missing the the --- on the top. --- description: Answers general questions on any topic mode: primary temperature: 0.5 permission: edit: deny bash: ask webfetch: true websearch: true webfetch: true --- done thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2613