Autonomy Config • AI Agent SDK
AutonomyConfig: Configuration for Agent autonomy features.
AutonomyConfig
Defined in the autonomy module.
AI Agent
Configuration for Agent autonomy features.
Autonomy is the safety center: doom loops, escalation, sandbox, filesystem tracking, and verification hooks all live here.
Attributes: enabled: Whether autonomy is enabled level: Autonomy level (suggest, auto_edit, full_auto) mode: Execution mode — “caller” (single chat call, wrapper-equivalent) or “iterative” (internal loop with completion detection). Defaults based on level: suggest/auto_edit → “caller”, full_auto → “iterative”. max_iterations: Maximum iterations before stopping doom_loop_threshold: Number of repeated actions to trigger doom loop auto_escalate: Whether to automatically escalate complexity observe: Whether to emit observability events completion_promise: Optional string that signals completion when wrapped in <promise>TEXT</promise> clear_context: Whether to clear chat history between iterations verification_hooks: List of VerificationHook instances for output verification track_changes: Whether to track filesystem changes via shadow git. Defaults to True when level=”full_auto”, False otherwise. When enabled, agent.undo()/redo()/diff() become available. snapshot: Take a pre-run workspace snapshot in run_autonomous() so agent.undo() can restore it. Requires track_changes. Off by default because snapshotting walks the whole project. sandbox: Optional SandboxConfig, carried for forward compatibility. NOT IMPLEMENTED: nothing currently reads this field, and no sandbox is auto-enabled at any autonomy level. To isolate execution, set it on the agent itself — Agent(sandbox=…) — or run the whole workflow remotely with AgentFlow(run_on=”docker”). snapshot_dir: Directory for snapshot storage. Defaults to ~/.praisonai/snapshots.
Usage::
# Simple — default caller mode (wrapper-equivalent, no wasteful loop)
Agent(autonomy=True) # level=suggest, mode=caller
# Full auto — iterative loop with completion detection
Agent(autonomy="full_auto")
# Ralph Loop — explicit iterative mode with completion promise
Agent(autonomy=AutonomyConfig(
mode="iterative",
completion_promise="COMPLETE",
))Properties
boolNo description available.
strNo description available.
Optional[str]No description available.
intNo description available.
intNo description available.
boolNo description available.
boolNo description available.
Optional[str]No description available.
boolNo description available.
OptionalNo description available.
Optional[bool]No description available.
OptionalNo description available.
Optional[str]No description available.
boolNo description available.
OptionalNo description available.
Optional[float]No description available.
Optional[int]No description available.
strNo description available.
Methods
Internal & Generic Methods
- from_dict: Create config from dictionary.
Source
View on GitHubpraisonaiagents/agent/autonomy.py at line 86