> ## 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.

# Legacy Agent Parameters

> Move from the 7 deprecated Agent() params to the config-object API

The `Agent()` constructor still accepts seven older parameters; each has a `Config` replacement that groups related settings.

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

# Old (still works, emits DeprecationWarning)
agent = Agent(name="coder", allow_code_execution=True, code_execution_mode="safe")

# New (preferred)
agent = Agent(
    name="coder",
    execution=ExecutionConfig(code_execution=True, code_mode="safe"),
)
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Legacy → Config"
        A[allow_delegation=True] --> B[handoffs=...]
        C[allow_code_execution=True] --> D[execution=ExecutionConfig]
        E[auto_save=name] --> F[memory=MemoryConfig]
        G[verification_hooks=...] --> H[autonomy=AutonomyConfig]
        I[cli_backend=...] --> J[runtime=...]
    end

    classDef old fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef new fill:#10B981,stroke:#7C90A0,color:#fff

    class A,C,E,G,I old
    class B,D,F,H,J new
```

## Quick Start

<Steps>
  <Step title="Find the old params">
    Scan your code for any of the seven deprecated names:

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    grep -E 'allow_delegation|allow_code_execution|code_execution_mode|auto_save|rate_limiter|verification_hooks|cli_backend'
    ```
  </Step>

  <Step title="Look up the replacement">
    Match each name to its config object in the migration table below.
  </Step>

  <Step title="Swap the kwarg for the config object">
    The behaviour is identical — the config form just groups related settings.
  </Step>
</Steps>

***

## Migration Table

Each deprecated param maps to one config-object replacement.

| Deprecated param       | Old default | Replacement (public API)                                      |
| ---------------------- | ----------- | ------------------------------------------------------------- |
| `allow_delegation`     | `False`     | `handoffs=[...]`                                              |
| `allow_code_execution` | `False`     | `execution=ExecutionConfig(code_execution=True)`              |
| `code_execution_mode`  | `"safe"`    | `execution=ExecutionConfig(code_mode="safe")` (or `"unsafe"`) |
| `auto_save`            | `None`      | `memory=MemoryConfig(auto_save="name")`                       |
| `rate_limiter`         | `None`      | `execution=ExecutionConfig(rate_limiter=obj)`                 |
| `verification_hooks`   | `None`      | `autonomy=AutonomyConfig(verification_hooks=[...])`           |
| `cli_backend`          | `None`      | `runtime=...` (see [Runtime](/docs/features/runtime))              |

### allow\_delegation → handoffs

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    other = Agent(name="specialist")
    agent = Agent(name="router", allow_delegation=True)
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    other = Agent(name="specialist")
    agent = Agent(name="router", handoffs=[other])
    ```
  </Tab>
</Tabs>

### allow\_code\_execution + code\_execution\_mode → execution

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(
        name="coder",
        allow_code_execution=True,
        code_execution_mode="safe",
    )
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent, ExecutionConfig

    agent = Agent(
        name="coder",
        execution=ExecutionConfig(code_execution=True, code_mode="safe"),
    )
    ```
  </Tab>
</Tabs>

### auto\_save → memory

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(name="assistant", auto_save="session")
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent, MemoryConfig

    agent = Agent(name="assistant", memory=MemoryConfig(auto_save="session"))
    ```
  </Tab>
</Tabs>

### rate\_limiter → execution

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(name="worker", rate_limiter=my_limiter)
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent, ExecutionConfig

    agent = Agent(name="worker", execution=ExecutionConfig(rate_limiter=my_limiter))
    ```
  </Tab>
</Tabs>

### verification\_hooks → autonomy

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(name="auditor", verification_hooks=[check_output])
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent, AutonomyConfig

    agent = Agent(name="auditor", autonomy=AutonomyConfig(verification_hooks=[check_output]))
    ```
  </Tab>
</Tabs>

### cli\_backend → runtime

<Tabs>
  <Tab title="Old">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(name="cli-agent", cli_backend="claude-code")
    ```
  </Tab>

  <Tab title="New">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    agent = Agent(name="cli-agent", runtime="claude-code")
    ```
  </Tab>
</Tabs>

***

## What Else Changed

Two related rules make constructor mistakes fail fast instead of silently.

**Keyword-only after `toolsets=`.** `handoffs=` and every `Config` param must be passed by name. A stray positional past `toolsets` no longer binds to `handoffs=` by accident.

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

# TypeError — stray positional past toolsets cannot misbind to handoffs=
Agent("n", "r", "g", "b", "i", None, None, None, None, None, None, None, True)
```

**Unknown kwargs now raise `TypeError`.** Typos fail loudly.

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

# TypeError: Agent.__init__() got unexpected keyword argument(s): totally_unknown
Agent(name="x", totally_unknown=1)
```

The visible signature shrank from 48 to 41 params. No public param was removed — only their documentation surface.

***

## Should I Migrate?

Use this flow to decide when to switch.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Q{Is the code new?} -->|Yes| N[Use the Config form only]
    Q -->|No, I have old code| M{Does it still work?}
    M -->|Yes, with warning| P[Migrate at your convenience]
    M -->|TypeError| K[Check the migration table]

    classDef question fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef action fill:#10B981,stroke:#7C90A0,color:#fff

    class Q,M question
    class N,P,K action
```

***

## Common Patterns

The three migrations you will hit most often.

**Coder agent** — `allow_code_execution` + `code_execution_mode` → `ExecutionConfig`:

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

agent = Agent(
    name="coder",
    execution=ExecutionConfig(code_execution=True, code_mode="safe"),
)
```

**Long-running agent** — `auto_save` + `rate_limiter` → `MemoryConfig` + `ExecutionConfig`:

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

agent = Agent(
    name="worker",
    memory=MemoryConfig(auto_save="session"),
    execution=ExecutionConfig(rate_limiter=my_limiter),
)
```

**Autonomous agent** — `verification_hooks` → `AutonomyConfig`:

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

agent = Agent(
    name="auditor",
    autonomy=AutonomyConfig(verification_hooks=[check_output]),
)
```

***

## Best Practices

<AccordionGroup>
  <Accordion title="Prefer the Config form in new code">
    The deprecated names will be removed in a future release. Write new agents with the config objects from the start.
  </Accordion>

  <Accordion title="Fix DeprecationWarnings as they surface">
    Migrate the warnings that appear in your test suite as you touch each agent, not all at once.
  </Accordion>

  <Accordion title="Always pass Config params by name">
    Never pass `Agent(..., value)` positionally past `toolsets=`. Keyword form prevents accidental misbinding.
  </Accordion>

  <Accordion title="Do not use fallback_models= on Agent()">
    `fallback_models=` is an internal forwarding path for `clone_for_channel()`, not a public param. Use `llm=LLMConfig(fallback_models=[...])` instead.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Handoffs" icon="arrow-right-arrow-left" href="/docs/features/handoffs">
    Replaces `allow_delegation=True`.
  </Card>

  <Card title="Execution" icon="play" href="/docs/features/execution">
    Replaces `allow_code_execution`, `code_execution_mode`, and `rate_limiter`.
  </Card>

  <Card title="Autonomy" icon="robot" href="/docs/features/autonomy">
    Replaces `verification_hooks=[...]`.
  </Card>

  <Card title="Memory" icon="brain" href="/docs/features/memory">
    Replaces `auto_save="name"`.
  </Card>

  <Card title="Runtime" icon="play" href="/docs/features/runtime">
    Replaces `cli_backend=`.
  </Card>

  <Card title="Rate Limiter" icon="gauge" href="/docs/features/rate-limiter">
    Replaces `rate_limiter=` on `Agent()`.
  </Card>
</CardGroup>
