Signature
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
budget | float | None | None | Max USD for this run |
max_tool_calls | int | None | None | Max tool/function calls |
max_latency_ms | float | None | None | Max wall-clock ms per call |
max_energy | float | None | None | Max energy units |
compliance | str | None | None | "gdpr", "hipaa", "pci", or "strict" |
kpi_weights | dict | None | None | KPI dimension weights |
kpi_targets | dict | None | None | KPI dimension targets |
Returns
Context manager yieldingHarnessRunContext. See HarnessRunContext.
Usage
Basic budget
Full configuration
Nested runs
Runs can be nested. Inner runs inherit the parent’s remaining budget:Notes
run()requiresinit()to have been called first- Parameters override the global config for the duration of the block
- Use
session.summary()for aggregate metrics - Use
session.trace()for per-step decision records