approval=True on any agent to auto-approve, or pass a custom backend for console, webhook, Slack, or any approval channel.
Quick Start
How It Works
| Step | What Happens |
|---|---|
| Agent backend | approval=True or custom backend on the Agent is checked first |
| Required? | Only tools in the dangerous-tools set need approval |
| Env check | PRAISONAI_AUTO_APPROVE=true skips all prompts |
| YAML check | Tools listed in YAML approve field are auto-approved |
| Already approved | Once approved in a session, no re-prompt |
| Backend | ConsoleBackend (default), AutoApproveBackend, or your custom |
Configuration Options
Agent Parameter (Recommended)
| Value | Behavior |
|---|---|
approval=True | Auto-approve all dangerous tools for this agent |
approval=False / None | Use registry fallback (default: console prompt) |
approval=MyBackend() | Use a custom approval backend for this agent |
Other Methods
| Method | Scope | Use Case |
|---|---|---|
PRAISONAI_AUTO_APPROVE=true | All agents | CI/CD, testing |
get_approval_registry().set_backend(backend) | All agents | Global policy |
get_approval_registry().set_backend(backend, agent_name="x") | Single agent | Registry-level per-agent control |
YAML approve: [tool1, tool2] | Per-task | Declarative configs |
Built-in Backends
| Backend | Import | Behavior |
|---|---|---|
AutoApproveBackend | from praisonaiagents import AutoApproveBackend | Always approves |
ConsoleBackend | from praisonaiagents.approval import ConsoleBackend | Rich terminal prompt (default) |
AgentApproval | from praisonaiagents.approval import AgentApproval | Delegates to another AI agent |
SlackApproval | from praisonai.bots import SlackApproval | Slack Block Kit + polling |
TelegramApproval | from praisonai.bots import TelegramApproval | Telegram inline keyboard + polling |
DiscordApproval | from praisonai.bots import DiscordApproval | Discord embed + text reply polling |
WebhookApproval | from praisonai.bots import WebhookApproval | POST to webhook + poll status |
HTTPApproval | from praisonai.bots import HTTPApproval | Local web dashboard |
CallbackBackend | from praisonaiagents.approval import CallbackBackend | Wraps a legacy callback function |
Custom Backend
Implementrequest_approval (async) and optionally request_approval_sync to create any approval channel:
Slack Approval
Route tool approvals to Slack — get a rich message with tool details and reply yes or no to approve or deny.Configuration
| Parameter | Default | Description |
|---|---|---|
token | SLACK_BOT_TOKEN env | Slack bot token (xoxb-...) |
channel | Bot’s own DM | Channel ID, name, or user ID |
timeout | 300 (5 min) | Seconds to wait for response |
poll_interval | 3.0 | Seconds between polls |
Approval Keywords
| Action | Keywords |
|---|---|
| Approve | yes, y, approve, approved, ok, allow, go, proceed, confirm |
| Deny | no, n, deny, denied, reject, block, stop, cancel, refuse |
Cross-Platform: Telegram Bot → Slack Approval
Cross-Platform: Telegram Bot → Slack Approval
You can use any bot platform for user interaction while routing approvals to Slack:
Telegram Approval
Route tool approvals to Telegram — get a message with inline keyboard buttons.| Parameter | Default | Description |
|---|---|---|
token | TELEGRAM_BOT_TOKEN env | Telegram bot token |
chat_id | (required) | Chat ID to send approvals to |
timeout | 300 (5 min) | Seconds to wait for response |
poll_interval | 2.0 | Seconds between polls |
Discord Approval
Route tool approvals to Discord — get a rich embed and reply yes or no.| Parameter | Default | Description |
|---|---|---|
token | DISCORD_BOT_TOKEN env | Discord bot token |
channel_id | (required) | Channel ID to send approvals to |
timeout | 300 (5 min) | Seconds to wait for response |
poll_interval | 3.0 | Seconds between polls |
Webhook Approval
POST approval requests to any HTTP endpoint and poll for decisions. Ideal for enterprise dashboards, CI/CD, and custom integrations.| Parameter | Default | Description |
|---|---|---|
webhook_url | APPROVAL_WEBHOOK_URL env | URL to POST requests to |
status_url | webhook_url/{request_id} | URL template for polling |
headers | {} | Extra HTTP headers (e.g. auth) |
timeout | 300 (5 min) | Seconds to wait |
poll_interval | 5.0 | Seconds between polls |
Agent Approval
Delegate approval decisions to another AI agent. The approver agent evaluates the tool call and responds with APPROVE or DENY.| Parameter | Default | Description |
|---|---|---|
approver_agent | Auto-created | Agent instance to evaluate requests |
llm | gpt-4o-mini | LLM for default approver agent |
AgentApproval lives in the core SDK (praisonaiagents.approval) — no extra dependencies needed.HTTP Approval
Serve a local web dashboard for approvals. Open the URL in your browser and click Approve or Deny.| Parameter | Default | Description |
|---|---|---|
host | 127.0.0.1 | Bind address |
port | 8899 | Port to listen on |
timeout | 300 (5 min) | Seconds to wait for response |
Multi-Agent Example
Different agents can have different approval policies:Registry (Advanced)
For global or centralized approval control, use the registry directly:The
approval= parameter on Agent takes priority over the global registry.
If an agent has approval=True, it will auto-approve regardless of registry settings.Dangerous Tools (Default)
These tools require approval by default:| Tool | Risk Level |
|---|---|
execute_command | critical |
kill_process | critical |
execute_code | critical |
write_file | high |
delete_file | high |
move_file | high |
execute_query | high |
crawl | medium |
scrape_page | medium |
Best Practices
Use approval=True for bot agents
Use approval=True for bot agents
Set
approval=True directly on agent constructors for unattended bots. This is the simplest, most agent-centric approach.Use environment variable for CI/CD
Use environment variable for CI/CD
Set
PRAISONAI_AUTO_APPROVE=true in your CI environment to avoid blocking on prompts during automated testing.Create custom backends for production
Create custom backends for production
Build webhook or messaging backends that route approvals to the right team. The async protocol supports long-running approval flows.
Use per-agent backends for multi-agent systems
Use per-agent backends for multi-agent systems
Different agents may need different approval policies. Pass different backends to each agent’s
approval= parameter.
