Reasonix Permission Modes Explained: How Allow, Ask, and Deny Control Tool Access
Reasonix uses three permission modes—allow, ask, and deny—to govern whether AI tools can automatically execute write operations, prompt for confirmation, or block state-changing actions entirely.
DeepSeek-Reasonix implements a hierarchical permission system that balances automation with safety. Each mode serves as a global setting that determines how the system handles writers—operations that modify files, create resources, or otherwise alter system state.
The Three Permission Modes
Allow Mode
Allow mode automatically executes ordinary write operations without user intervention. This mode eliminates friction for trusted workflows.
Use this when running vetted scripts or internal tools where constant confirmation would impede productivity. The UI string settings.modeAllow in desktop/frontend/src/locales/en.ts (line 2056) defines this behavior for the interface.
Ask Mode
Ask mode prompts for confirmation before any writer executes. This creates an interactive safety checkpoint for every state-changing action.
This is the default conservative choice when you want visibility into what the AI is doing without outright blocking capabilities. The description lives at settings.modeAsk in the same locales file (line 2055).
Deny Mode
Deny mode blocks all writer operations at the system level. No file modifications, resource creation, or Bash commands that alter state can proceed.
Activate this for read-only sessions, untrusted environments, or compliance scenarios where zero mutation risk is required. The UI label is settings.modeDeny (line 2057).
How Permission Rules Override Global Modes
Reasonix supports granular rules that target specific tools, file globs, or Bash commands. These rules evaluate after the global mode with strict precedence:
deny > ask > allow
This hierarchy means:
- Deny rules always prevail. A matching deny rule blocks the action even when the global mode is
alloworask. - Ask rules force confirmation even when the global mode is
allow. - Allow rules permit automatic execution only if no higher-priority rule matches.
The rule syntax is documented in settings.ruleForm (line 2058): "Rules: ToolName, ToolName(glob), or Bash(command:*). … Precedence: deny > ask > allow."
Core Implementation Files
| File | Purpose |
|---|---|
desktop/frontend/src/lib/toolApprovalMode.ts |
Permission-evaluation engine; reads modes, matches rules, renders final decisions |
desktop/frontend/src/locales/en.ts |
Human-readable UI strings defining mode descriptions and rule syntax |
The evaluatePermission function exported from toolApprovalMode.ts serves as the runtime entry point for all permission decisions.
Practical Configuration Examples
Setting Global Mode in Settings
{
"settings": {
"mode": "ask",
"ruleForm": [
"GitPush",
"WriteFile(*.md)",
"Bash(command:rm -rf *)"
]
}
}
This configuration uses ask as the baseline, explicitly allows Git pushes and Markdown writes, and denies dangerous recursive deletions.
Adding an Override Rule
// Forces confirmation for npm installs regardless of global mode
{
"type": "ask",
"pattern": "Bash(command:npm install*)"
}
Because ask outranks allow, users see a confirmation dialog even when running in fully automatic mode.
Programmatic Permission Query
import { evaluatePermission } from "./toolApprovalMode";
const decision = evaluatePermission({
tool: "WriteFile",
target: "README.md",
command: null
});
if (decision === "allow") {
// execute immediately
} else if (decision === "ask") {
// render confirmation dialog
} else {
// block operation
}
The evaluatePermission implementation in toolApprovalMode.ts handles mode resolution, rule matching, and precedence logic in a single call.
Summary
- Three global modes control writer behavior:
allow(automatic),ask(confirm),deny(block) - Rule precedence is absolute: deny beats ask beats allow
- Granular rules target specific tools, globs, or Bash patterns for fine-grained control
- Implementation resides in
toolApprovalMode.tswith UI labels inen.ts
Frequently Asked Questions
What happens when a deny rule conflicts with an allow rule?
The deny rule wins unconditionally. Regardless of global mode or other allow rules, any matching deny rule blocks the operation. This design guarantees that explicit prohibitions cannot be accidentally overridden.
Can I mix permission modes for different tool types?
Yes. Set a permissive global mode like allow, then layer specific ask or deny rules for sensitive tools. For example, auto-approve file reads but require confirmation for Bash commands or DatabaseWrite operations.
Where does Reasonix store permission decisions?
The permission engine in desktop/frontend/src/lib/toolApprovalMode.ts evaluates decisions at runtime. Persistent configuration resides in user settings, with mode labels and rule syntax defined in desktop/frontend/src/locales/en.ts for internationalization support.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →