Kyvvu

Policy · critical

Token budget per task

Cost control: cap cumulative token usage at 100,000 tokens per task. Requires the agent to emit usage.total_tokens in step.model properties.

The policy

A few lines of YAML in your repository.

Part of Internal AI starter. Assign the pack, or copy this policy into a manifest of your own.

Verdict
Critical: the step is blocked before it runs, and an incident is opened.
Checked
Before every step, against everything the agent did earlier in the task.
Rule
usage_budget
- name: "Token budget per task"  description: |    Cost control: cap cumulative token usage at 100,000 tokens per    task. Requires the agent to emit usage.total_tokens in step.model    properties.    Adjust the budget based on your model pricing and acceptable    per-task cost.  rule_type: usage_budget  params:    kind: step.model    property_path: usage.total_tokens    budget: 100000  severity: critical  enforcement_point: step_execution

Why it matters

Adjust the budget based on your model pricing and acceptable per-task cost.

How the rule works

usage_budget: Stops further steps of one type once their cumulative numeric property exceeds the budget. Applies only to steps of the budgeted kind. Counts what is recorded in the task plus the intended step's own declared value, so the step that would cross the budget is refused; a cost only reported after the call (e.g. a token count in the output) can overshoot the budget by one step.

  • kind: step.model. Action kind the budget applies to.
  • property_path: usage.total_tokens. Numeric property to sum, relative to step properties (e.g. usage.total_tokens).
  • budget: 100000. Maximum cumulative value per task.

In these packs

From Kyvvu's open policy library at github.com/Kyvvu/manifests, Apache 2.0.

Next

Watch it decide.

In your browser

Try it in the playground

The policy is loaded. Add the steps your agent takes and watch the engine decide, step by step.

On your machine

Five minutes, no account

kyvvu try runs a demo agent against the bundled baseline. Then assign this pack from the dashboard or the CLI.

For security teams

See it on your agents

A 30-minute demo on the agents you actually run, with the policies that fit them.