Skip to main content
Set autonomy levels to control agent independence - from fully supervised to fully autonomous.

Quick Start

1

Configure Autonomy

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

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

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

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.
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_toolsVec<String>AllAllowed tools
blocked_toolsVec<String>NoneBlocked tools

Best Practices

Balance between productivity and safety. Upgrade when comfortable.
While developing, use low autonomy to catch issues early.
For high autonomy agents, explicitly block tools that could cause harm.