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 b24950c
Browse filesBrowse the repository at this point in the historyBrowse files
flashduty-runner now supports restricting which shell commands a BYOC
Runner may execute via --permission-config / FLASHDUTY_RUNNER_PERMISSION_CONFIG
(flashduty-runner#102), but environments.mdx had zero coverage of it.
Add a Permission Configuration section covering the YAML schema, matching
semantics, fail-closed behavior, and the three example modes from the
runner's own README.
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
@@ -135,6 +135,82 @@ Go to **`Environments`** in the AI SRE left sidebar to create and connect a self
135
135
Upgrades and uninstalls are also covered in the same onboarding guide: rerunning the install command on an already-installed Runner upgrades it. Two uninstall commands are provided — `--uninstall` removes the service while preserving config, and `--purge` removes everything including config and data.
136
136
</Tip>
137
137
138
+
## Permission Configuration
139
+
140
+
---
141
+
142
+
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:
143
+
144
+
```bash
145
+
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`**:
152
+
153
+
```yaml
154
+
permission:
155
+
"*": "deny"
156
+
"kubectl get *": "allow"
157
+
"kubectl describe *": "allow"
158
+
"cat *": "allow"
159
+
```
160
+
161
+
- 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).
162
+
- **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.
163
+
- 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.
164
+
- 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.
165
+
- Leaving the flag/env var unset is the default and is equivalent to allowing all commands.
166
+
167
+
<AccordionGroup>
168
+
<Accordion title="Strict mode (recommended for shared environments)" icon="lock">
169
+
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:
183
+
184
+
```yaml
185
+
permission:
186
+
"*": "allow" # Trust the AI model
187
+
"rm -rf /": "deny" # Block catastrophic commands if desired
188
+
```
189
+
190
+
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