backends • AI Agent SDK
Built-in approval backends for PraisonAI Agents.
backends
AI Agent
Built-in approval backends for PraisonAI Agents.
Provides lightweight backends that ship with the core SDK:
- AutoApproveBackend — always approves (bots, trusted envs).
- ConsoleBackend — interactive Rich terminal prompt (CLI default).
- AgentApproval — delegates approval decision to another AI agent.
Import
from praisonaiagents.approval import backendsClasses
AutoApproveBackend
Always approves. Use for bots or trusted unattended environments.
ConsoleBackendInteractive Rich terminal prompt. Default for CLI usage.
AgentApprovalDelegates approval decisions to another AI agent.
CallbackBackendWraps a legacy `(function_name, arguments, risk_level) - ApprovalDecision` callback
Constants
| Name | Value | |
|---|---|---|
_COMMAND_ARG_KEYS | frozenset({'command', 'cmd', 'commands', 'script', 'shell', 'code', 'source', 'program'}) | |
_SHELL_OPERATORS | `frozenset({‘;’, ‘&’, ‘\ | ‘, ‘(‘, ‘)’, ‘{‘, ‘}’, ‘<’, ‘>’, ‘'}) |
_VERDICT_TOKEN_RE | re.compile('[A-Z]+') | |
_NEGATIONS | frozenset({'NOT', 'NO', 'NEVER', 'DONT', 'DON', 'CANT', 'CAN'}) | |
_ARGUMENTS_TAG_RE | re.compile('<\\s/?\\sarguments\\s*>', re.IGNORECASE) |