The invoice says the fleet spent $2,300. Finance asks which agent, product asks which feature, and the on-call asks which run. With a shared key, all three questions have the same answer: a shrug.
The short answer
Attribute spend at three levels: by agent identity, by run, and by the delegation chain that connects them. Every call carries the agent's own credential and a run id, the gateway sums estimated and actual cost against both, and orchestrators pass a parent-run reference so a sub-agent's spend rolls up to the work that commissioned it. Attribution is not reporting garnish — it is what makes caps fair, forecasts per-agent, and the sentence 'the research crew costs us $410 a month' provable instead of vibes.
Check your own setup as you read: run the free Spend Guard self-check or test a policy in the playground — five minutes, no signup, and the gaps it names map to the controls below.
Worked example: $2,300, six agents, one shrug
Beacon Legal Search, a fictional legal-tech startup, saw its monthly model bill jump from $890 to $2,300 in one month. Six agents shared one key. The team spent a week guessing: the new summariser was blamed and nearly rolled back. When per-agent identities were switched on, the first full week of attributed data showed the summariser cost $96 a month — and a citation-checking agent, quietly re-verifying entire case files on every small edit, cost $1,150. One behaviour change cut it to $210, and the monthly bill settled at $1,240.
The near-miss mattered as much as the saving: without attribution the team would have removed a feature users liked and kept the actual cost. Beacon now reviews a weekly attribution table — agent, runs, spend, spend per successful task — and any agent whose spend grows more than 40 percent week on week without a matching rise in completed tasks gets a named owner review before the next invoice arrives.
Attribution starts with identity, again
There is no attribution without per-agent credentials — a pooled key produces a pooled total, and no amount of dashboarding splits it honestly afterwards. The gateway model makes attribution a by-product: because every call is authorised under an agent identity with an estimated cost, the sums exist the moment the system runs. Teams that bolt attribution on later, from provider exports and timestamps, get approximations that fall apart exactly on the messy multi-agent days they most need to explain.
Runs and chains: the two rollups that matter
Agent totals hide run-shaped problems — one pathological run inside a healthy agent's month. Run totals hide fleet-shaped problems — forty small runs commissioned by one orchestrator's bad plan. Keep both rollups, linked by parent-run references through every delegation and handoff. Then every dollar can be walked in both directions: from an invoice line down to the run that spent it, and from a run up to the workflow that commissioned it.
Spend per successful task is the number that changes decisions
Raw spend ranks your busiest agent first, which is usually your most valuable one. Spend per successful task — total spend divided by tasks that completed and were accepted — ranks your wasteful agent first. Beacon's citation checker looked modest in raw logs from some angles and terrible per completed check; the summariser was the reverse. Review both numbers together, weekly, with owners named per agent, and attribution becomes a management tool rather than an accounting exercise.
Chargeback and showback without the theatre
Once attribution is trustworthy, internal chargeback becomes arithmetic: each team's agents, each customer's runs, each product surface's cost. Start with showback — publishing the numbers without billing anyone — for a quarter. Teams fix their own worst agent remarkably quickly when its cost is printed next to its name, and by the time real chargeback starts, the arguments about accuracy have already happened while the stakes were low.
Attribution traps in real fleets
Three traps recur. Shared service agents — the one summariser every team calls — need a caller tag, or their cost lands on nobody and their value is invisible. Test and evaluation traffic quietly inflates an agent's attributed spend unless runs are tagged by environment from the start. And orchestrators that spawn sub-agents can double-count if both the parent's estimate and the child's actuals are summed naively; the gateway rule is to attribute actuals to the child and roll them up to the parent, never to add both. Audit for these three in your first month of attribution data, before the numbers harden into budgets and arguments.
Five actions to attribute fleet spend
- Switch every agent to its own credential so calls arrive under a real identity.
- Tag every call with a run id and a parent-run reference across delegations and handoffs.
- Sum estimated and actual spend per agent and per run in the authorisation log, reconciled monthly against the provider invoice.
- Publish a weekly attribution table with spend per successful task and a named owner per agent.
- Flag any agent growing over 40 percent week on week without matching completed-task growth for owner review.
Source note and related guides
Figures in the worked example are illustrative, drawn from a fictional company created for this guide; the controls, failure patterns and procedures described are the gateway's documented behaviour — see the Agent Auth Gateway documentation and the policy patterns in allowlists vs denylists, spend caps and the agent kill switch. Reviewed by the Ingenious AI team, 2026-11-14.
Sources
- NIST AI Risk Management Framework (AI RMF 1.0), the voluntary framework for managing AI risk across design, development and use: nist.gov, 2023
- OWASP Top 10 for Large Language Model Applications, the OWASP GenAI Security Project's risk list for LLM and agent systems: owasp.org, 2025
- RFC 6749, The OAuth 2.0 Authorization Framework, the IETF standard behind scoped, expiring access tokens: rfc-editor.org, 2012