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

# Fail-Loud Defaults

> PraisonAI raises clear errors instead of silently picking a default when configuration is ambiguous

PraisonAI raises clear errors instead of silently picking a default when configuration is ambiguous.

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

# Explicit provider/model — no silent OpenAI fallback
agent = Agent(name="assistant", llm="ollama/llama3")
agent.start("Hello!")
```

The user passes ambiguous configuration; PraisonAI raises an explicit error with a fix hint instead of silently falling back.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph Before
        A1[Ambiguous config] --> B1[Silent fallback]
    end
    subgraph After
        A2[Ambiguous config] --> B2[ValueError with fix hint]
    end

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef warn fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef ok fill:#10B981,stroke:#7C90A0,color:#fff

    class A1,A2 agent
    class B1 warn
    class B2 ok

    classDef tool fill:#189AB4,color:#fff

    classDef agent fill:#8B0000,color:#fff
```

## How It Works

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Agent
    participant Feature as Fail-Loud Defaults

    User->>Agent: Request
    Agent->>Feature: Process request
    Feature-->>Agent: Result    Agent-->>User: Response
```

<Warning>
  **Behaviour change (PR #2122):** Several subsystems that previously fell back silently now raise explicit errors. Review the table below when upgrading.
</Warning>

## What Changed

| Area                       | Old behaviour                                              | New behaviour                          | Deep dive                                                         |
| -------------------------- | ---------------------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------- |
| Database URL               | Unknown scheme → SQLite fallback                           | `ValueError`                           | [Cloud Databases](/docs/features/cloud-databases)                 |
| Model string               | Unrecognised name → OpenAI                                 | `ValueError`                           | [Multi-Provider Advanced](/docs/features/multi-provider-advanced) |
| Daytona sandbox            | Appeared available with client                             | `NotImplementedError`                  | [Sandbox](/docs/features/sandbox)                                 |
| LazyCache                  | Cached `None` on `ImportError`                             | Re-raises `ImportError`                | Optional deps docs                                                |
| Approval                   | `enabled: false` by default                                | `enabled: true` by default             | [Approval](/docs/features/approval)                               |
| Claude CLI backend         | `bypassPermissions` default                                | `default` mode; bypass requires opt-in | [CLI Backend Protocol](/docs/features/cli-backend-protocol)       |
| SandlockSandbox (PR #1367) | Landlock ABI too low → silent `SubprocessSandbox` fallback | `RuntimeError` at init time            | [Sandbox](/docs/features/sandbox)                                 |

## Quick Start

<Steps>
  <Step title="Grep your logs for new errors">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    grep -r "Unable to infer DB backend\|Cannot infer provider\|Daytona backend not yet implemented" logs/
    ```
  </Step>

  <Step title="Fix database URLs explicitly">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    # Was silently SQLite — now raises ValueError
    db_url = "sqlite:///mydata.db"  # explicit scheme required
    ```
  </Step>

  <Step title="Use provider/model form">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonaiagents import Agent

    # Was OpenAI fallback — now raises ValueError
    agent = Agent(name="assistant", llm="ollama/llama3")
    ```
  </Step>
</Steps>

## Migrating

| Exception text                                                                                                                      | Fix                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `Unable to infer DB backend from URL '...'; supported schemes: postgres://, mysql://, sqlite://, redis://, libsql://, http(s)://`   | Prefix URL with a supported scheme, e.g. `sqlite:///path.db`               |
| `Cannot infer provider from model '...'. Use the 'provider/model' form, e.g. 'ollama/llama3', 'bedrock/anthropic.claude-3-sonnet'.` | Use `provider/model` or a recognised prefix (`gpt-`, `claude-`, `gemini-`) |
| `Daytona backend not yet implemented. Use 'subprocess', 'docker', or 'e2b' sandbox instead.`                                        | Switch `sandbox_type` to a supported backend                               |
| Approval prompts where none expected                                                                                                | Set `approval=False` or `approval: {enabled: false}` in YAML               |

## Best Practices

<AccordionGroup>
  <Accordion title="Prefer explicit configuration">
    When in doubt, spell out schemes, provider prefixes, and backend names — silent fallbacks are gone.
  </Accordion>

  <Accordion title="Disable approval only when intended">
    Approval is on by default (PR #2122). Use `approval=False` for fully autonomous runs.
  </Accordion>

  <Accordion title="Never use BYPASS without env gate">
    Claude Code bypass requires `unsafe=True` **and** `PRAISONAI_CLAUDE_BYPASS_PERMISSIONS=1`.
  </Accordion>

  <Accordion title="Pin sandbox backends explicitly">
    Do not rely on implicit fallbacks — set `sandbox_type` to a supported backend (`subprocess`, `docker`, or `e2b`).
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Approval" icon="shield-check" href="/docs/features/approval">
    Safe-by-default approval gates
  </Card>

  <Card title="Cloud Databases" icon="cloud" href="/docs/features/cloud-databases">
    Supported DB URL schemes
  </Card>
</CardGroup>
