You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add "soft deny" permission action for self-correcting AI behavior #9651
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Currently, the permission system has three actions: allow, ask, and deny. When a command is denied, execution halts with an error. This is problematic when the AI could simply try an alternative approach.
Generic use case: Configure find * with "soft deny" so that when the AI tries bash command find, it receives a message like "That bash command is not allowed. Try using another tool, instead of bash" and hopefully will naturally self-correct.
My use case: The AI tries constantly to run tests using bash commands python tests/..., which fails because it does not have permission to run python. I'd like opencode to tell the AI to use my custom mcp server that can run tests, if it tries to run bash python test*. Some models just wont listen to instructions on this...
While not exact duplicates, these issues complement your feature request. In particular, #9552, #9548, and #9461 would help make 'soft deny' more effective by making alternative MCP tools discoverable to the AI when bash is denied.
Hmm... When I was testing this before, the model just stopped, without output. So I assumed opencode stopped it. But on further digging, it seems like it only stopped because of the deny message caused it to to stop:
packages/opencode/src/permission/next.ts
`The user has specified a rule which prevents you from using this specific tool call. Here are some of the relevant rules ${JSON.stringify(ruleset)}`,
Some models just give up because of that response from using the tool.
So what I really need is it to be more soft with the response, and suggesting to the AI to do something else. Having a custom message for specific permission would be optimal.
Something like:
"permission": {
"bash": {
"python test/*": {"deny": "This tool call is not allowed. use test_tool_run_test instead"}
For now, I think I'll try to convince the model not to give up on that response in AGENTS.md
Activity
github-actions commentedon Jan 20, 2026
This issue has several related feature requests that share similar goals of improving the permission system and tool guidance:
readwith permissionaskrequires confirm for each file separately - proposingreadallbuilt-in tool #9614: Permission UX friction with 'ask' action (related permission system improvements)While not exact duplicates, these issues complement your feature request. In particular, #9552, #9548, and #9461 would help make 'soft deny' more effective by making alternative MCP tools discoverable to the AI when bash is denied.
rekram1-node commentedon Jan 20, 2026
You can use
continue_loop_on_denyin the experimental section of ur cfg btwawikman commentedon Jan 20, 2026
Hmm... When I was testing this before, the model just stopped, without output. So I assumed opencode stopped it. But on further digging, it seems like it only stopped because of the deny message caused it to to stop:
packages/opencode/src/permission/next.tsSome models just give up because of that response from using the tool.
So what I really need is it to be more soft with the response, and suggesting to the AI to do something else. Having a custom message for specific permission would be optimal.
Something like:
For now, I think I'll try to convince the model not to give up on that response in AGENTS.md
awikman commentedon Jan 30, 2026
Going to close this, because better instruction in AGENTS.md was good enough.
disbolog commentedon Feb 13, 2026
I'd like to see this reopened, because AGENTS.md in such a case is a snake oil non-solution.
mathe00 commentedon Feb 13, 2026
up. I agree.