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
Copy file name to clipboardExpand all lines: docs/configuration/permissions/index.md
+48-1Lines changed: 48 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,18 @@ Permissions provide fine-grained control over tool execution. You can configure
19
19
20
20
</div>
21
21
22
-
## Configuration
22
+
## Permission Levels
23
+
24
+
Permissions can be defined at two levels:
25
+
26
+
| Level | Location | Scope |
27
+
| ----- | -------- | ----- |
28
+
|**Agent-level**| Agent YAML config (`permissions:` section) | Applies to that specific agent config |
29
+
|**Global (user-level)**|`~/.config/cagent/config.yaml` under `settings.permissions`| Applies to every agent you run |
30
+
31
+
Both levels use the same `allow`/`ask`/`deny` pattern syntax. When both are present, they are **merged** at startup -- patterns from both sources are combined into a single checker. See [Merging Behavior](#merging-behavior) for details.
32
+
33
+
## Agent-Level Configuration
23
34
24
35
```yaml
25
36
agents:
@@ -42,6 +53,42 @@ permissions:
42
53
- "dangerous_tool"
43
54
```
44
55
56
+
## Global Permissions
57
+
58
+
Global permissions let you enforce rules across **all** agents, regardless of which agent config you run. Define them in your user config file:
59
+
60
+
```yaml
61
+
# ~/.config/cagent/config.yaml
62
+
settings:
63
+
permissions:
64
+
deny:
65
+
- "shell:cmd=sudo*"
66
+
- "shell:cmd=rm*-rf*"
67
+
allow:
68
+
- "read_*"
69
+
- "shell:cmd=ls*"
70
+
- "shell:cmd=cat*"
71
+
```
72
+
73
+
This is useful for setting personal safety guardrails that apply everywhere -- for example, always blocking `sudo` or always auto-approving read-only tools -- without relying on each agent config to include those rules.
74
+
75
+
### Merging Behavior
76
+
77
+
When both global and agent-level permissions are present, they are merged into a single set of patterns before evaluation. The merge works as follows:
78
+
79
+
- **Deny patterns from either source block the tool.** A global deny cannot be overridden by an agent-level allow, and vice versa.
80
+
- **Allow patterns from either source auto-approve the tool** (as long as no deny pattern matches).
81
+
- **Ask patterns from either source force confirmation** (as long as no deny or allow pattern matches).
82
+
83
+
The evaluation order remains the same after merging: **Deny > Allow > Ask > default Ask**.
84
+
85
+
<div class="callout callout-tip">
86
+
<div class="callout-title">Example: Global deny + agent allow
87
+
</div>
88
+
<p>If your global config denies <code>shell:cmd=sudo*</code> and an agent config allows <code>shell:cmd=sudo apt update</code>, the deny wins. Deny patterns always take priority regardless of source.</p>
89
+
90
+
</div>
91
+
45
92
## Pattern Syntax
46
93
47
94
Permissions support glob-style patterns with optional argument matching:
Copy file name to clipboardExpand all lines: docs/guides/tips/index.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,6 +232,26 @@ permissions:
232
232
docker-agent run --sandbox agent.yaml
233
233
```
234
234
235
+
### Set Global Permission Guardrails
236
+
237
+
Use [global permissions]({{ '/configuration/permissions/' | relative_url }}#global-permissions) in your user config to enforce safety rules across every agent:
238
+
239
+
```yaml
240
+
# ~/.config/cagent/config.yaml
241
+
settings:
242
+
permissions:
243
+
deny:
244
+
- "shell:cmd=sudo*"
245
+
- "shell:cmd=rm*-rf*"
246
+
- "shell:cmd=git push --force*"
247
+
allow:
248
+
- "read_*"
249
+
- "shell:cmd=ls*"
250
+
- "shell:cmd=cat*"
251
+
```
252
+
253
+
These rules merge with any agent-level permissions. Deny patterns from your global config cannot be overridden by agent configs, so you can trust that dangerous commands stay blocked regardless of which agent you run.
0 commit comments