> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# autonomy • AI Agent SDK

> Agent Autonomy Module.

# autonomy

<Badge color="blue">AI Agent</Badge>

Agent Autonomy Module.

Provides agent-centric autonomy configuration and helpers.
This module integrates escalation, doom loop detection, and observability
directly into the Agent class as first-class capabilities.

Unified Architecture:

* AutonomyStage is an alias for EscalationStage (single source of truth)
* AutonomyTrigger delegates to EscalationTrigger (DRY)
* DoomLoopTracker adds recovery actions on top of basic detection

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

# Enable autonomy with defaults
agent = Agent(instructions="...", autonomy=True)

# Enable with custom config
agent = Agent(
    instructions="...",
    autonomy={
        "max_iterations": 30,
        "doom_loop_threshold": 5,
        "auto_escalate": True
    }
)

# Run autonomous task
result = agent.run_autonomous("Refactor the auth module")
print(result.success, result.output)
```

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.agent import autonomy
```

## Classes

<CardGroup cols={2}>
  <Card title="AutonomyConfig" icon="brackets-curly" href="../classes/AutonomyConfig">
    Configuration for Agent autonomy features.
  </Card>

  <Card title="AutonomySignal" icon="brackets-curly" href="../classes/AutonomySignal">
    Signals detected from prompts for autonomy decisions.
  </Card>

  <Card title="AutonomyTrigger" icon="brackets-curly" href="../classes/AutonomyTrigger">
    Detects signals from prompts for autonomy decisions.
  </Card>

  <Card title="AutonomyResult" icon="brackets-curly" href="../classes/AutonomyResult">
    Result of an autonomous execution.
  </Card>

  <Card title="DoomLoopTracker" icon="brackets-curly" href="../classes/DoomLoopTracker">
    Tracks actions to detect doom loops with graduated recovery.
  </Card>

  <Card title="AutonomyMixin" icon="brackets-curly" href="../classes/AutonomyMixin">
    Helper-only trait for autonomy utilities.
  </Card>
</CardGroup>

### Constants

| Name                             | Value                                                                                                                                                                                                         |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `VALID_AUTONOMY_LEVELS`          | `{'suggest', 'auto_edit', 'full_auto'}`                                                                                                                                                                       |
| `_ESCALATION_TO_AUTONOMY_SIGNAL` | `{'simple_question': 'simple_question', 'file_references': 'file_references', 'code_blocks': 'code_blocks', 'edit_intent': 'edit_intent', 'test_intent': 'test_intent', 'refactor_intent': 'refactor_inte...` |
| `_AUTONOMY_TO_ESCALATION_SIGNAL` | `{v: k for k, v in _ESCALATION_TO_AUTONOMY_SIGNAL.items()}`                                                                                                                                                   |
| `VALID_AUTONOMY_MODES`           | `{'caller', 'iterative'}`                                                                                                                                                                                     |
| `_LEVEL_TO_DEFAULT_MODE`         | `{'suggest': 'caller', 'auto_edit': 'caller', 'full_auto': 'iterative'}`                                                                                                                                      |
