Permissions
Two layers work together:
- Permission mode — session posture (how often to ask, whether to bypass)
- Declarative rules —
settings.permissions.{deny,ask,allow}
Permission mode
bash
forgeax --permission-mode default
forgeax --permission-mode acceptEdits
forgeax --permission-mode plan
forgeax --permission-mode bypassPermissionsOr in settings:
json
{
"permissions": {
"defaultMode": "acceptEdits"
}
}Resolution order: --permission-mode flag > settings.permissions.defaultMode > default.
| Mode | Meaning (summary) |
|---|---|
default | Standard ask policy |
acceptEdits | More permissive toward edit-like ops |
plan | Planning-oriented posture |
bypassPermissions | Bypass normal prompts (dangerous; may refuse under root / killswitch) |
Dangerous equivalent:
bash
forgeax --yes # auto-approve all permission prompts (= dangerously-skip); refused as rootDeclarative rules
Syntax matches common coding-agent conventions: Tool or Tool(content).
json
{
"permissions": {
"deny": ["Bash(rm *)", "Write(/etc/*)"],
"ask": ["Bash(git push*)"],
"allow": ["Read", "Bash(git *)"]
}
}Engine order (strong → weak): deny → ask → … → allow.
Structure-aware shell matching
For Bash/Sh tools, content rules match subcommand structure, not the raw whole line:
deny Bash(rm *)also catchesecho x && rm -rf /allow Bash(git *)does not covergit status && rm -rf /(falls to ask / default)$()/ backticks / subshells force ask
Invalid rule strings are dropped silently (fail-closed: never treated as allow).
OS sandbox
Permission rules constrain what the agent may request; --sandbox constrains where Bash children may write at the OS layer:
bash
forgeax --sandboxWrites are confined to cwd + temp; paths outside cwd are rejected by the OS; protected segments like .git / .forgeax stay read-oriented. Missing platform tools → loud degrade.
Practical guidance
- Team-shared: put
deny/ baselineallowin.forgeax/settings.json - Local secrets and looser rules:
settings.local.json - Headless CI: narrow
allow+ explicit--permission-mode; avoid--yesunless the runner is isolated - Treat
denyas the non-bypassable last line of defense