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
Commit 8705eca
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: en/ai-sre/environments.mdx
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,82 @@ Rule semantics:
237
237
Permission configuration loads at Runner startup. Restart the Runner after editing the YAML file.
238
238
</Tip>
239
239
240
+
## Permission Configuration
241
+
242
+
---
243
+
244
+
By default, the Runner allows any command — the same trust model as running the AI model directly in your own shell. If you need to restrict which commands the Runner may execute, point it at a YAML rules file with the `--permission-config` flag or the `FLASHDUTY_RUNNER_PERMISSION_CONFIG` environment variable:
245
+
246
+
```bash
247
+
flashduty-runner run --token <your-token> --permission-config /etc/flashduty-runner/permission.yaml
The rules file's top-level key is `permission`, mapping **glob patterns to `allow`/`deny`**:
254
+
255
+
```yaml
256
+
permission:
257
+
"*": "deny"
258
+
"kubectl get *": "allow"
259
+
"kubectl describe *": "allow"
260
+
"cat *": "allow"
261
+
```
262
+
263
+
- Rules apply everywhere a command can appear — inside pipelines (`cmd1 | cmd2`), `$(...)`/backtick command substitution, process substitution, and write-redirect targets (so `echo x > /etc/passwd` is gated the same way as running a command).
264
+
- **The most specific rule wins**: the pattern with the longest literal prefix before its first `*` is tried first; the catch-all `"*"` is always tried last, and the first matching rule applies.
265
+
- The file is loaded **once, at Runner startup** — edit the rules and restart the Runner for changes to take effect; there is no hot reload.
266
+
- If the flag/env var is set but the file is missing, malformed, or defines no rules under the `permission` key, the Runner **refuses to start** (fails closed) rather than silently allowing every command: pointing the Runner at a permission config is a deliberate request to restrict it, so a broken config should surface as an error, not a silent security gap.
267
+
- Leaving the flag/env var unset is the default and is equivalent to allowing all commands.
268
+
269
+
<AccordionGroup>
270
+
<Accordion title="Strict mode (recommended for shared environments)" icon="lock">
271
+
Deny everything by default, then explicitly allow only what you need:
Equivalent to not setting `--permission-config` at all, but lets you carve out explicit exceptions:
285
+
286
+
```yaml
287
+
permission:
288
+
"*": "allow" # Trust the AI model
289
+
"rm -rf /": "deny" # Block catastrophic commands if desired
290
+
```
291
+
292
+
Suitable when the Runner runs in an isolated VM/container with limited blast radius, or when fast incident response matters more than restricting permissions.
0 commit comments