> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeus.agentspro.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Human-in-the-Loop

> Zeus Human-in-the-Loop — Auto-Run Modes & Tool Approval Mechanism

## Overview

HITL (Human in the Loop) ensures the AI Agent obtains human confirmation before executing sensitive operations. Zeus provides Auto-Run modes and tool approval workflows, allowing users to flexibly control the Agent's level of automation.

***

## Auto-Run Mode

Auto-Run mode controls the level of automation when the AI Agent executes tools.

### Three Modes

| Mode           | Description                         | Use Case                 |
| -------------- | ----------------------------------- | ------------------------ |
| Run Everything | Automatically execute all tools     | High trust, simple tasks |
| Use Allowlist  | Only auto-execute allowlisted tools | Partial trust            |
| Ask Everytime  | Ask the user every time             | Sensitive operations     |

### Tool Approval UI

When a tool requires approval, the frontend displays an approval card containing the tool name, parameters, current status (pending / approved / rejected / running / completed), and approve/reject buttons.

### Approval Decision Logic

Approval decisions are based on the current Auto-Run mode:

* **Run Everything**: All tools execute automatically, no approval needed
* **Use Allowlist**: Only allowlisted tools execute automatically; other tools require approval
* **Ask Everytime**: All tools require user approval

### Data Persistence

User Auto-Run mode settings and tool allowlists are persisted via the database. Each user has independent configuration. The allowlist has a unique constraint on user and tool name to prevent duplicates.

***

## Trigger Conditions

HITL approval is triggered under the following conditions:

1. The tool is not in the allowlist
2. Auto-Run mode is "Ask Everytime"
3. The tool is marked as requiring confirmation

***

## Interaction Flow

```mermaid theme={null}
flowchart TD
    A["Agent decides to call tool"] --> B["Check if approval needed"]
    B --> C{"Approval needed?"}
    C -->|"No"| D["Execute directly"]
    C -->|"Yes"| E["Display approval UI"]
    E --> F["User decides"]
    F --> G{"Approval result"}
    G -->|"Approved"| H["Execute tool"]
    G -->|"Rejected"| I["Return rejection"]
```

***

## Interruption & Recovery

When a tool requires approval, the Agent's execution is suspended and the state is persisted via the Checkpointer. After user approval, the Agent resumes execution from the breakpoint.

User approval decision types:

| Decision   | Behavior                                                           |
| ---------- | ------------------------------------------------------------------ |
| `approved` | Execute tool (optionally with modified parameters)                 |
| `rejected` | Skip execution; Agent receives rejection reason and will not retry |
| `modified` | Execute with modified parameters (legacy compatibility)            |
| `timeout`  | Automatic skip on timeout                                          |

Rejected tools have a system message appended, explicitly telling the Agent not to retry that tool.

For more technical details on interrupt recovery, see the [Agent Loop](/en/documentation/fundamentals/agent-loop) and [Runtime](/en/documentation/fundamentals/agent-runtime) documentation.
