# Reasonix Permission Modes Explained: How Allow, Ask, and Deny Control Tool Access

> Understand Reasonix permission modes allow ask and deny to control AI tool access. Learn how these modes govern write operations and prompt confirmations in esengine/DeepSeek-Reasonix.

- Repository: [YHH/DeepSeek-Reasonix](https://github.com/esengine/DeepSeek-Reasonix)
- Tags: how-to-guide
- Published: 2026-08-05

---

**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`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/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 `allow` or `ask`.
- **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`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/frontend/src/lib/toolApprovalMode.ts) | Permission-evaluation engine; reads modes, matches rules, renders final decisions |
| [`desktop/frontend/src/locales/en.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/frontend/src/locales/en.ts) | Human-readable UI strings defining mode descriptions and rule syntax |

The `evaluatePermission` function exported from [`toolApprovalMode.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/toolApprovalMode.ts) serves as the runtime entry point for all permission decisions.

## Practical Configuration Examples

### Setting Global Mode in Settings

```json
{
  "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

```ts
// 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

```ts
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`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/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.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/toolApprovalMode.ts) with UI labels in [`en.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/en.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`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/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`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/frontend/src/locales/en.ts) for internationalization support.