Skip to content

Commit 6beba2c

Browse files
authored
docs: document permissions (anomalyco#1638)
1 parent b8a0ecc commit 6beba2c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/opencode/src/tool/registry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export namespace ToolRegistry {
7575
result["patch"] = false
7676
result["write"] = false
7777
}
78+
if (cfg?.permission?.bash === "deny") {
79+
result["bash"] = false
80+
}
7881

7982
if (modelID.toLowerCase().includes("claude")) {
8083
result["patch"] = false

packages/web/src/content/docs/docs/permissions.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Use the `permission.edit` key to control whether file editing operations require
2121

2222
- `"ask"` - Prompt for approval before editing files
2323
- `"allow"` - Allow all file editing operations without approval
24+
- `"deny"` - Make all file editing tools disabled and unavailable
2425

2526
```json title="opencode.json" {4}
2627
{
@@ -41,7 +42,8 @@ Controls whether bash commands require user approval.
4142
You can specify which commands you want to have run without approval.
4243
:::
4344

44-
This can be configured globally or with specific patterns. Setting this to `"ask"` is the strictest mode, requiring approval for all bash commands.
45+
This can be configured globally or with specific patterns. Setting this to `"ask"`, requiring approval for all bash commands.
46+
Setting this to `"deny"` is the strictest option, blocking LLM from running that command or command pattern.
4547

4648
For example.
4749

@@ -56,6 +58,19 @@ For example.
5658
}
5759
```
5860

61+
- **Disable all Terraform commands**
62+
63+
```json title="opencode.json"
64+
{
65+
"$schema": "https://opencode.ai/config.json",
66+
"permission": {
67+
"bash": {
68+
"terraform *": "deny"
69+
}
70+
}
71+
}
72+
```
73+
5974
- **Approve specific commands**
6075

6176
```json title="opencode.json"

0 commit comments

Comments
 (0)