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

# cascadeflow.init()

> Activate the cascadeflow harness globally with a mode and optional configuration.

Activate the harness globally. All subsequent LLM calls (OpenAI, Anthropic) are automatically tracked.

## Signature

```python theme={null}
def init(
    mode: HarnessMode = "off",
    *,
    config: Optional[HarnessConfig] = None,
    verbose: bool = False,
) -> HarnessInitReport
```

## Parameters

| Parameter | Type                              | Default | Description                         |
| --------- | --------------------------------- | ------- | ----------------------------------- |
| `mode`    | `"off" \| "observe" \| "enforce"` | `"off"` | Harness mode                        |
| `config`  | `HarnessConfig \| None`           | `None`  | Full configuration (overrides mode) |
| `verbose` | `bool`                            | `False` | Print decisions to stderr           |

## Returns

`HarnessInitReport` — confirmation of harness activation with mode and configuration summary.

## Usage

### Minimal

```python theme={null}
import cascadeflow
cascadeflow.init(mode="observe")
```

### With config

```python theme={null}
from cascadeflow import HarnessConfig

config = HarnessConfig(
    mode="enforce",
    budget=1.00,
    compliance="gdpr",
    verbose=True,
)
cascadeflow.init(config=config)
```

### Environment-driven

```python theme={null}
import os
cascadeflow.init(mode=os.getenv("CASCADEFLOW_MODE", "observe"))
```

## Notes

* Call `init()` once at application startup, before any LLM calls
* Calling `init()` again replaces the previous configuration
* Use `cascadeflow.reset()` to deactivate the harness
* `init(mode="off")` is equivalent to not calling `init()` at all
