Autonomy
Control how independently your agent operates
Set autonomy levels to control agent independence – from fully supervised to fully autonomous.
Quick Start
- Configure Autonomy
rust use praisonai::{AutonomyConfig, AutonomyLevel}; // Create autonomy configuration let config = AutonomyConfig::new() .level(AutonomyLevel::Suggest); // Default - suggests actions, waits for approval println!("Level: {:?}", config.level); println!("Requires approval: {}", config.require_approval); - Full Autonomy
rust use praisonai::{AutonomyConfig, AutonomyLevel}; let config = AutonomyConfig::new() .level(AutonomyLevel::FullAuto) // Autonomous operation .no_approval() // Skip approval prompts .max_actions(20); // Limit actions per session - Limited Autonomy with Tool Restrictions
rust use praisonai::{AutonomyConfig, AutonomyLevel}; let config = AutonomyConfig::new() .level(AutonomyLevel::AutoEdit) .allow_tool("read_file") .allow_tool("search") .block_tool("delete_file") .block_tool("execute_command");
Choosing Autonomy Level
| Level | Enum | Behavior |
|---|---|---|
| Suggest | AutonomyLevel::Suggest | Suggests actions, waits for user approval |
| Auto Edit | AutonomyLevel::AutoEdit | Auto-edits with confirmation |
| Full Auto | AutonomyLevel::FullAuto | Full autonomous operation |
AutonomyConfig
Configuration for agent autonomy behavior.
pub struct AutonomyConfig {
pub level: AutonomyLevel,
pub require_approval: bool,
pub max_actions: Option<usize>,
pub allowed_tools: Vec<String>,
pub blocked_tools: Vec<String>,
}Methods
| Method | Description |
|---|---|
new() | Create with defaults |
level(AutonomyLevel) | Set autonomy level |
no_approval() | Disable approval requirement |
max_actions(usize) | Set max actions before pause |
allow_tool(name) | Allow specific tool |
block_tool(name) | Block specific tool |
full | No restrictions |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
level | String | medium | Autonomy level |
require_approval | bool | Varies | Require human approval |
allowed_tools | `Vec |
| All | Allowed tools | | blocked_tools | Vec
` | None | Blocked tools |
Best Practices
Start with medium autonomy
Balance between productivity and safety. Upgrade when comfortable.
Use low for testing
While developing, use low autonomy to catch issues early.
Block dangerous tools explicitly
For high autonomy agents, explicitly block tools that could cause harm.