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

# Human in the Loop

> Supervise and approve agent decisions before final execution through Devic’s human validation system.

# Human Validation in the Execution Cycle

Devic incorporates a **Human in the Loop (HITL)** system that allows users to be included in the agent’s execution flow when **manual validation, correction, or approval** is required before continuing an automated process.

This functionality ensures that critical tasks can be reviewed and approved by a human responsible, maintaining traceability and control over the agent’s decision-making.

***

## Execution States

When an agent requires human intervention, the execution automatically enters the **“Waiting for Approval”** state.\
From the executions panel, you can view and filter tasks awaiting approval, along with their progress and evaluation.

<img src="https://mintcdn.com/devic/1wjyJ0A6EVBHYJ50/human-in-the-loop-view.png?fit=max&auto=format&n=1wjyJ0A6EVBHYJ50&q=85&s=ee2422204b79266ea7900f78fdd8a110" alt="View of executions with tasks waiting for approval" width="1915" height="983" data-path="human-in-the-loop-view.png" />

The available states include:

| State                    | Description                                                        |
| ------------------------ | ------------------------------------------------------------------ |
| **Queued**               | The execution has been created and is queued to begin.             |
| **Processing**           | The agent is currently processing the task.                        |
| **Completed**            | Execution finished successfully.                                   |
| **Failed**               | The execution failed due to an error or unexpected condition.      |
| **Terminated**           | The execution was manually stopped or halted by system conditions. |
| **Paused**               | Execution temporarily paused until user action is received.        |
| **Waiting for Approval** | Requires human review or approval before continuing.               |

***

## Approval Process

Clicking on an execution in the **“Waiting for Approval”** state opens the validation window.\
There, the agent presents the **approval request** along with extracted data or the actions it intends to execute.

<img src="https://mintcdn.com/devic/WkHQ1OWqHJHs8waF/waiting-for-approval.png?fit=max&auto=format&n=WkHQ1OWqHJHs8waF&q=85&s=c4e5ebf890a81faa7eb52b5a62cdd33e" alt="Agent approval window" width="1915" height="983" data-path="waiting-for-approval.png" />

The user can:

* **Approve** the action so the agent can automatically continue the workflow.
* **Reject and finalize** the execution, stopping the process.
* **Continue with feedback**, adding comments or corrections that the agent must incorporate before proceeding.

The approval panel displays all relevant information the agent has gathered up to that point:\
for example, customer data, analyzed documents, or cross-referenced information.\
This allows the user to review results **within their operational context**, without leaving the agent interface.

***

## Benefits of the Human in the Loop Approach

Integrated human validation allows balancing **automation and control**, offering:

* **Safety and accuracy** in sensitive or high-impact tasks.
* **Complete traceability** of human decisions within the automated workflow.
* **Iterative learning**, enabling the agent to incorporate human feedback in future executions.
* **Regulatory compliance**, in processes where human intervention is mandatory.

***

<Note>
  The HITL system turns each approval or rejection into part of the agent’s operational learning, contributing to continuous improvement of its performance and reliability.
</Note>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Tasks" icon="list-check" href="/devic/agents/continuous-optimization/tasks">
    Manage tasks generated by agents, monitor their status, and control their progress within each execution.
  </Card>

  <Card title="Automatic Evaluations" icon="check-circle" href="/devic/agents/continuous-optimization/evaluations">
    Configure metrics and automatic evaluations to measure the performance, accuracy, and consistency of your agents.
  </Card>

  <Card title="Costs" icon="coins" href="/devic/agents/continuous-optimization/costs">
    Monitor token consumption, analyze execution costs, and optimize model and resource usage.
  </Card>
</CardGroup>
