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

# approval • AI Agent SDK

> Human Approval Framework for PraisonAI Agents

# approval

<Badge color="blue">AI Agent</Badge>

Human Approval Framework for PraisonAI Agents

This module provides a minimal human-in-the-loop approval system for dangerous tool operations.
It extends the existing callback system to require human approval before executing high-risk tools.

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import approval
```

## Classes

<CardGroup cols={2}>
  <Card title="ToolPermission" icon="brackets-curly" href="../classes/ToolPermission">
    Permission entry for a tool.
  </Card>

  <Card title="PermissionAllowlist" icon="brackets-curly" href="../classes/PermissionAllowlist">
    Persistent permission allowlist for tools.
  </Card>

  <Card title="ApprovalDecision" icon="brackets-curly" href="../classes/ApprovalDecision">
    Result of an approval request
  </Card>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="get_permission_allowlist()" icon="function" href="../functions/get_permission_allowlist">
    Get the global permission allowlist.
  </Card>

  <Card title="set_permission_allowlist()" icon="function" href="../functions/set_permission_allowlist">
    Set the global permission allowlist.
  </Card>

  <Card title="set_approval_callback()" icon="function" href="../functions/set_approval_callback">
    Set a custom approval callback function.
  </Card>

  <Card title="get_approval_callback()" icon="function" href="../functions/get_approval_callback">
    Get the current approval callback function.
  </Card>

  <Card title="mark_approved()" icon="function" href="../functions/mark_approved">
    Mark a tool as approved in the current context.
  </Card>

  <Card title="is_already_approved()" icon="function" href="../functions/is_already_approved">
    Check if a tool is already approved in the current context.
  </Card>

  <Card title="is_yaml_approved()" icon="function" href="../functions/is_yaml_approved">
    Check if a tool is auto-approved via YAML approve field.
  </Card>

  <Card title="is_env_auto_approve()" icon="function" href="../functions/is_env_auto_approve">
    Check if PRAISONAI\_AUTO\_APPROVE environment variable is set.
  </Card>

  <Card title="set_yaml_approved_tools()" icon="function" href="../functions/set_yaml_approved_tools">
    Set the list of YAML-approved tools for the current context.
  </Card>

  <Card title="reset_yaml_approved_tools()" icon="function" href="../functions/reset_yaml_approved_tools">
    Reset YAML-approved tools to previous state.
  </Card>

  <Card title="clear_approval_context()" icon="function" href="../functions/clear_approval_context">
    Clear the approval context.
  </Card>

  <Card title="require_approval()" icon="function" href="../functions/require_approval">
    Decorator to mark a tool as requiring human approval.
  </Card>

  <Card title="console_approval_callback()" icon="function" href="../functions/console_approval_callback">
    Default console-based approval callback.
  </Card>

  <Card title="request_approval()" icon="function" href="../functions/request_approval">
    Request approval for a tool execution.
  </Card>

  <Card title="configure_default_approvals()" icon="function" href="../functions/configure_default_approvals">
    Configure default dangerous tools to require approval.
  </Card>

  <Card title="add_approval_requirement()" icon="function" href="../functions/add_approval_requirement">
    Dynamically add approval requirement for a tool.
  </Card>

  <Card title="remove_approval_requirement()" icon="function" href="../functions/remove_approval_requirement">
    Remove approval requirement for a tool.
  </Card>

  <Card title="is_approval_required()" icon="function" href="../functions/is_approval_required">
    Check if a tool requires approval.
  </Card>

  <Card title="get_risk_level()" icon="function" href="../functions/get_risk_level">
    Get the risk level of a tool.
  </Card>
</CardGroup>

### Constants

| Name                      | Value                                                                                                                                                                                                         |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DEFAULT_DANGEROUS_TOOLS` | `{'execute_command': 'critical', 'kill_process': 'critical', 'execute_code': 'critical', 'write_file': 'high', 'delete_file': 'high', 'move_file': 'high', 'copy_file': 'high', 'execute_query': 'high', ...` |
