every agent run reports per-model token usage back to the task server. bernstein attributes that cost to the task, the role (backend, qa, security ...) and the model. bernstein cost prints the breakdown per run (--by agent|model|task|day, --last 24h, --json). .sdd/metrics/cost.jsonl is the raw record. set cost.budget_limit in .sdd/config.yaml to cap a run; at cost.alert_threshold (default 0.8) the orchestrator warns, at 100 percent it drains (finish in-flight tasks, start nothing new). per-agent anomaly detection flags context-growth or token-spike behaviour so a stuck agent gets reaped before it burns the budget. source: src/bernstein/core/cost/.
canonical answer