Before an LLM feature ships, confirm it has an owner, a budget per task, separate keys and limits, usage logging, caching checked in real responses, loop caps for agents, and an alert path. Most surprise bills trace to a missing item on this list, not to an unusual model price.
Ownership and budget
- One named owner for the feature's AI spend.
- A target cost per completed task, and a monthly ceiling.
- A written definition of a successful task.
Keys, workspaces, and limits
- The feature has its own workspace and its own API keys, separate from other teams and from experiments.
- A monthly spend limit below the tier cap, plus alerts at several thresholds.
- Error handling distinguishes a rate limit from a spend cap, and never retries the cap.
- A degraded mode exists for when the limit is hit.
Metering
- Every call logs input, cached input, cache writes, output, and reasoning tokens, with model, effort, feature, and task ID.
- A weekly job reconciles your logs against the provider's usage and cost report.
- Dashboards show cost per task at the median and a high percentile.
Prompt and cache hygiene
- Stable content first, volatile content last.
- Tool list frozen between requests.
- Cache read tokens verified in a real response, not assumed.
- Prompt size above the model's minimum cacheable length where you expect caching.
- A pre-flight token count with a budget gate on requests that can be large.
Model and effort
- Effort set explicitly, not left to a default that may change with the model.
- Evaluation results for each model and effort level you use.
- Max tokens set with room for reasoning and the reply.
- Non urgent work routed to a batch endpoint where the discount applies.
Agents and tools
- A hard cap on steps or tool calls per task.
- A per task token ceiling that stops the loop and returns a partial result.
- Large tool outputs trimmed or summarized before entering context.
- A review of which tools and servers the agent can reach, and under which identity.
Incident readiness
- A runbook for a cost spike, with the person who can raise or lower limits.
- A kill switch per feature.
- Key rotation steps tested.
Where Safeguard fits
Token metering and billing live with your model provider and your own logging. Safeguard does not meter tokens. It can help with the last two agent items: policies, gates and guardrails, MCP Guardrail, and agent identity apply policy to what agents can reach. You can also run a free scan at gold.safeguard.sh/scan on the code that wraps your model calls.
Quick check
What is the single most useful item?
Per call usage logging tied to a task ID. Without it, every other control is guesswork.
Do small teams need all of this?
Start with the owner, a spend limit with alerts, usage logging, and a loop cap. Add the rest as spend grows.
Last reviewed: 19 October 2026.