Autonomy

Control how independently your agent operates

Set autonomy levels to control agent independence – from fully supervised to fully autonomous.

Diagram

Autonomy Levels

🔒 Low

⚖️ Medium

🚀 High

⚡ Full

Quick Start

  1. 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);
  2. 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
  3. 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

Diagram

Which Level?

Interactive

Supervised

Unattended

Context?

Suggest – wait for approval

AutoEdit – auto with confirm

FullAuto – autonomous

LevelEnumBehavior
SuggestAutonomyLevel::SuggestSuggests actions, waits for user approval
Auto EditAutonomyLevel::AutoEditAuto-edits with confirmation
Full AutoAutonomyLevel::FullAutoFull autonomous operation

AutonomyConfig

Configuration for agent autonomy behavior.

rust
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

MethodDescription
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
fullNo restrictions

Configuration

OptionTypeDefaultDescription
levelStringmediumAutonomy level
require_approvalboolVariesRequire 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.


Related