Python API Reference
cascadeflow exposes a three-tier API for Python. Each tier adds more control.Quick Start
API Surface
| Function | Purpose | Docs |
|---|---|---|
cascadeflow.init() | Activate the harness globally | Reference |
cascadeflow.run() | Create a scoped run context with constraints | Reference |
@cascadeflow.agent() | Attach per-agent policy | Reference |
HarnessConfig | Full configuration dataclass | Reference |
HarnessRunContext | Session object with summary() and trace() | Reference |
Install
Modes
| Mode | Behavior |
|---|---|
off | Disabled — no tracking, no enforcement |
observe | Track all calls, log what would happen, enforce nothing |
enforce | Active control — budget caps, model switching, stop actions |
Actions
In enforce mode, the harness can take four actions at each decision boundary:| Action | Effect |
|---|---|
allow | Proceed with the original model |
switch_model | Route to a different model |
deny_tool | Block a tool call |
stop | Halt the run (budget exceeded, policy violation) |