Skip to main content

Agent Decorator — Policy Per Agent

The @cascadeflow.agent() decorator attaches policy metadata directly to agent functions. Each agent gets its own budget, compliance rules, and KPI weights — enforced automatically at runtime.

Basic Usage

Add Compliance

Add KPI Weights

Encode business priorities into how the agent makes model decisions:

Different Agents, Different Policies

The real power shows with multiple agents — each governed independently:

Combine with run()

The decorator works alongside cascadeflow.run() — the run’s constraints apply in addition to the decorator’s:

All Decorator Parameters

Next Step

Understand how the Harness works under the hood. Learn the Agent Harness →