# Agent cost guard: estimates, budgets and spend

Agent runs cost money, and people should see how much before they say yes. RunEstimate shows the likely cost and time as ranges, with what they're based on. Without enough history it says there's no estimate rather than guessing.

After a run, RunReceipt says what it cost, per model. A cost that wasn't measured says so; it's never shown as $0.00. UsageMeters shows what's used against each limit, and SpendBreakdown shows spend over time by model, agent or feature.

When a guardrail stops a run, GuardrailNotice says what was stopped and which rule stopped it.

Web page: https://candor.themethodic.com/patterns/agent-cost-guard

## Components

- **Run estimate** (`run-estimate`, Pro; https://candor.themethodic.com/docs/run-estimate.md): Likely cost and time, as ranges, before a run starts.
- **Run receipt** (`run-receipt`, Pro; https://candor.themethodic.com/docs/run-receipt.md): What one run cost and where it went.
- **Usage meters** (`usage-meters`, Pro; https://candor.themethodic.com/docs/usage-meters.md): What's used against each limit; no bar against a made-up cap.
- **Spend breakdown** (`spend-breakdown`, Pro; https://candor.themethodic.com/docs/spend-breakdown.md): Spend over time, by model, agent or feature.
- **Guardrail notice** (`guardrail-notice`, Pro; https://candor.themethodic.com/docs/guardrail-notice.md): What a budget stopped, and why.
- **Context meter** (`context-meter`, free; https://candor.themethodic.com/docs/context-meter.md): What fills the model's context budget, in the composer.

## Install

```bash
npx candor-ui add run-estimate run-receipt usage-meters
```

## Notes

- The cost-guard block (Premium) enforces it: the agent estimates from recorded runs or says it can't, the person approves a budget, and the run stops on the server when recorded spend reaches it.
