Skip to main content
The cascadeflow harness is an in-process intelligence layer that wraps AI agent execution. It tracks, scores, and optionally enforces constraints across six dimensions for every LLM call and tool execution inside agent loops.

Six Dimensions

HarnessConfig

All harness behavior is configured through a single dataclass:

Activation

Decision Flow

For each LLM call or tool execution:
  1. Record model, step number, cumulative cost, latency, energy
  2. Check compliance — is the model in the allowlist for the configured regulation?
  3. Check hard caps — budget, tool calls, latency, energy
  4. Score KPI dimensions — quality, cost, latency, energy weighted by kpi_weights
  5. Decide actionallow, switch_model, deny_tool, or stop
  6. Enforce or log — enforce in enforce mode, log only in observe mode
  7. Append trace — full decision record for auditability

Supported Models

The harness includes a built-in pricing table for 18 models across OpenAI, Anthropic, and Google. Unknown models are resolved via fuzzy matching (e.g. gpt-5-mini matches even before official pricing is announced). See Energy Tracking for the full pricing and energy coefficients table.
Getting started: Agent Harness | Agent Loop | API reference: HarnessConfig