> ## 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

> Extensible Approval Protocol for PraisonAI Agents.

# approval

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

Extensible Approval Protocol for PraisonAI Agents.

This package provides a protocol-driven, per-agent approval system for
tool executions.  It is fully backward-compatible with the old
`approval.py` module — all existing imports continue to work.

Quick start (no Agent class changes needed)::

from praisonaiagents.approval import get\_approval\_registry, AutoApproveBackend

# Global auto-approve for all agents

get\_approval\_registry().set\_backend(AutoApproveBackend())

# Per-agent backend

get\_approval\_registry().set\_backend(AutoApproveBackend(), agent\_name="bot")

Custom backend::

from praisonaiagents.approval import ApprovalProtocol, ApprovalRequest, ApprovalDecision

class WebhookBackend:
async def request\_approval(self, request: ApprovalRequest) -> ApprovalDecision:

# POST to external service, wait for response

return ApprovalDecision(approved=True)

get\_approval\_registry().set\_backend(WebhookBackend())

## 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>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="get_approval_registry()" icon="function" href="../functions/get_approval_registry">
    Return the global singleton :class:`ApprovalRegistry`.
  </Card>

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

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

  <Card title="mark_approved()" icon="function" href="../functions/mark_approved">
    Function definition.
  </Card>

  <Card title="is_already_approved()" icon="function" href="../functions/is_already_approved">
    Function definition.
  </Card>

  <Card title="is_yaml_approved()" icon="function" href="../functions/is_yaml_approved">
    Function definition.
  </Card>

  <Card title="is_env_auto_approve()" icon="function" href="../functions/is_env_auto_approve">
    Function definition.
  </Card>

  <Card title="set_yaml_approved_tools()" icon="function" href="../functions/set_yaml_approved_tools">
    Function definition.
  </Card>

  <Card title="add_yaml_approved_tools()" icon="function" href="../functions/add_yaml_approved_tools">
    Function definition.
  </Card>

  <Card title="reset_yaml_approved_tools()" icon="function" href="../functions/reset_yaml_approved_tools">
    Function definition.
  </Card>

  <Card title="clear_approval_context()" icon="function" href="../functions/clear_approval_context">
    Function definition.
  </Card>

  <Card title="configure_default_approvals()" icon="function" href="../functions/configure_default_approvals">
    Re-configure default dangerous tools (idempotent).
  </Card>

  <Card title="add_approval_requirement()" icon="function" href="../functions/add_approval_requirement">
    Function definition.
  </Card>

  <Card title="remove_approval_requirement()" icon="function" href="../functions/remove_approval_requirement">
    Function definition.
  </Card>

  <Card title="is_approval_required()" icon="function" href="../functions/is_approval_required">
    Function definition.
  </Card>

  <Card title="get_risk_level()" icon="function" href="../functions/get_risk_level">
    Function definition.
  </Card>

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

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

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

  <Card title="get_permission_allowlist()" icon="function" href="../functions/get_permission_allowlist">
    Function definition.
  </Card>

  <Card title="set_permission_allowlist()" icon="function" href="../functions/set_permission_allowlist">
    Function definition.
  </Card>
</CardGroup>
