> ## 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))                                       |
| `llm`                  | —           | `model=...` (canonical); `llm=` is a deprecated alias, passing both raises `TypeError` |

### llm → model

`model=` is the canonical name on every agent class (`Agent`, `AgentTeam`, `AgentFlow`, `VisionAgent`, `AudioAgent`, `OCRAgent`, `VideoAgent`, `EmbeddingAgent`, `ImageAgent`, `ContextAgent`, `CodeAgent`, `RealtimeAgent`). `llm=` is a deprecated alias for it. Passing both raises `TypeError`.

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

    agent = Agent(name="Assistant", llm="gpt-4o")
    ```
  </Tab>

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

    agent = Agent(name="Assistant", model="gpt-4o")
    ```
  </Tab>

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

    # TypeError: Agent() received both llm= and model=. They are the same
    #   parameter, so passing both is ambiguous. Pass only one; model= is
    #   the canonical name (llm= is a deprecated alias).
    agent = Agent(name="Assistant", llm="gpt-4o", model="gpt-3.5-turbo")
    ```
  </Tab>
</Tabs>

<Note>
  See [Model Parameter](/docs/features/model-parameter) for the full rule and the list of classes it applies to.
</Note>

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

***

## Rejected `Agent(...)` kwargs → what to use instead

`Agent(...)` rejects these kwargs — pass them on the sub-config instead.

Land here after seeing this error:

```text theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
TypeError: Agent.__init__() got unexpected keyword argument(s): session_id
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Agent[🤖 Agent] -->|session_id| M[💾 memory=MemoryConfig]
    Agent -->|user_id| M
    Agent -->|db| M
    Agent -->|prompt_caching| C[⚙️ caching=CachingConfig]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef mem fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef cache fill:#6366F1,stroke:#7C90A0,color:#fff

    class Agent agent
    class M mem
    class C cache
```

The dict shorthand `memory={"session_id": "…"}` is accepted as shorthand for `MemoryConfig` — use it in the Quick Start of any new example.

| Rejected on `Agent(...)`         | Error                           | Correct spelling                                                                                                                                  |
| -------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Agent(session_id="my-session")` | `TypeError: ... session_id`     | `Agent(memory={"session_id": "my-session"})` or `Agent(memory=MemoryConfig(session_id="my-session"))`                                             |
| `Agent(user_id="alice")`         | `TypeError: ... user_id`        | `Agent(memory=MemoryConfig(user_id="alice"))`                                                                                                     |
| `Agent(db="postgresql://…")`     | `TypeError: ... db`             | `Agent(memory=MemoryConfig(session_id="…", db="postgresql://…"))` — or `MemoryConfig(db=db.PostgresDB(...))` for the optional `praisonai` wrapper |
| `Agent(prompt_caching=True)`     | `TypeError: ... prompt_caching` | `Agent(caching=CachingConfig(prompt_caching=True))`                                                                                               |

### session\_id → memory

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

    # TypeError: Agent.__init__() got unexpected keyword argument(s): session_id
    agent = Agent(name="Assistant", session_id="my-session")
    ```
  </Tab>

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

    agent = Agent(name="Assistant", memory={"session_id": "my-session"})
    ```
  </Tab>
</Tabs>

### user\_id → memory

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

    # TypeError: Agent.__init__() got unexpected keyword argument(s): user_id
    agent = Agent(name="Assistant", user_id="alice")
    ```
  </Tab>

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

    agent = Agent(name="Assistant", memory=MemoryConfig(user_id="alice"))
    ```
  </Tab>
</Tabs>

### db → memory

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

    # TypeError: Agent.__init__() got unexpected keyword argument(s): db
    agent = Agent(name="Assistant", db="postgresql://user:pass@localhost/mydb")
    ```
  </Tab>

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

    agent = Agent(
        name="Assistant",
        memory=MemoryConfig(
            session_id="user-123-main",
            db="postgresql://user:pass@localhost/mydb",
        ),
    )
    ```
  </Tab>

  <Tab title="Correct (wrapper)">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent, MemoryConfig, db

    agent = Agent(
        name="Assistant",
        memory=MemoryConfig(
            session_id="user-123-main",
            db=db.PostgresDB(host="localhost", user="user", password="pass", database="mydb"),
        ),
    )
    ```
  </Tab>
</Tabs>

### prompt\_caching → caching

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

    # TypeError: Agent.__init__() got unexpected keyword argument(s): prompt_caching
    agent = Agent(name="Assistant", prompt_caching=True)
    ```
  </Tab>

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

    agent = Agent(name="Assistant", caching=CachingConfig(prompt_caching=True))
    ```
  </Tab>
</Tabs>

<Note>
  See [Session Resume](/docs/docs/memory/session-resume) for the full session lifecycle and [Prompt Caching](/docs/features/prompt-caching) for `CachingConfig`.
</Note>

***

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

  <Card title="Session Resume" icon="rotate" href="/docs/docs/memory/session-resume">
    Full session lifecycle for `memory={"session_id": ...}`.
  </Card>

  <Card title="Prompt Caching" icon="database" href="/docs/features/prompt-caching">
    `CachingConfig(prompt_caching=True)` replaces `prompt_caching=`.
  </Card>
</CardGroup>
