Cloud Agent Cost

Cloud Agent Cost Attribution by Source and Harness

Harness choice, not just model selection, drives most of your cloud agent bill.

· 10 min read
Cover illustration for “Cloud Agent Cost Attribution by Source and Harness”
Cloud Agent Pricing · October 15, 2026 · 10 min read · 2,193 words

The assumption most teams carry into cloud agent adoption is that the model is the bill. Pick a cheaper model, and spend falls in proportion, or so the reasoning goes. The evidence points somewhere else: the harness executing the run drives cost variance far more than model selection alone, and the mechanism is context overhead accumulating across every turn of a multi-turn session.

Why the harness layer — not the model — is the dominant cost variable in cloud agent runs

Diagram: Why Input Tokens, Not Output, Drive the Agent Bill. Visualizes: Visualize the composition of a typical cloud agent session's token spend to show that input tokens dominate output tokens, and that most input tokens are context overhead —…

Input tokens dominate agentic spend. In a typical session they account for roughly 85% of the total bill, and most of those input tokens are not the code the agent writes. They are context overhead: system prompts, repository maps, file reads, tool schemas, and the accumulated history that gets re-sent on every call. The model choice matters, but it applies a per-token price to a volume that the harness has already largely determined.

That volume is set by decisions made before the first prompt reaches the model. A harness with a large system prompt and verbose tool schemas inflates every request it makes. In a 50-turn session, input token counts grow a lot from turn one to the implementation phase as context compounds, but output stays flat. The bill, in other words, is driven by the growing underside of the conversation, not by what the agent produces.

The practical consequence is measurable enough to matter operationally. Two engineers on the same team, using the same model, but different harnesses, can produce costs that differ by multiples before any difference in task complexity enters the picture. The harness is not infrastructure in the background. It is the dominant cost variable.

How harness context overhead translates into measurable cost differences across real tasks

The cost gap between harnesses running identical tasks on identical models is large enough that harness choice must be treated as a first-class cost dimension, not a default decision made once at setup. One model, run through nine agent harnesses on the same coding tasks, produced a wide spread in cost per successful pass. The mechanism is context volume. In 2026 benchmarking data, one harness sends 2,008 tokens on turn one while another sends many times more. That gap is small on a single call, but it compounds on every later turn of a multi-turn session because the whole conversation history travels with each request. By turn 40, the difference between a lean harness and a verbose one is not a percentage point. It is a large multiple applied to 85% of the bill.

The same model can outperform its native harness when run through a leaner one. Lower context overhead reduces cost, and in at least one documented case it also improved success rate. The assumption that a model ships with its best harness does not hold. The best harness for a model is whichever one sends the least redundant context while still preserving what the agent needs to do its work.

Retry loops compound the effect. Each failed test-and-fix cycle is a full round-trip at the current, inflated context size. Three retries at turn 40 cost far more than three retries at turn 5, because the context being re-sent on every retry has grown with each turn. A harness that tends toward long sessions with late failures is, by construction, a more expensive harness per shipped pull request.

The implication for attribution follows directly. If harness is not recorded as a dimension alongside model, observed cost differences between teams or tasks cannot be explained. The data looks like noise. One team appears to spend more for no reason, and the organization lacks the one variable that would make the pattern legible.

Why billing model changes have made cost attribution urgent rather than optional

Major agent tools have moved from seat-based to token-based billing, so AI coding spend has gone from a predictable software line to a metered utility. It now behaves like cloud infrastructure, where consumption drives cost in near-real time. Most engineering organizations have no framework for governing that kind of spend.

The transition dates are specific and clustered. Cursor moved from request-based to credit-based billing in June 2025. OpenAI moved Codex from per-message to token-based pricing in April 2026. GitHub Copilot completed its shift to token-based AI Credits on 1 June 2026. The seat price that once made spend predictable now tells you almost nothing. The same license, same seat, and same model can cost wildly different amounts if an engineer is accepting autocomplete suggestions or running a multi-file agentic refactor.

Parallel agents multiply the problem linearly. Running agents in parallel consumes token quota proportionally faster, and there is no separate billing tier for agents, though an auto-mode model-selection discount can apply. Teams that scale agent adoption horizontally, as most do, see their token consumption scale with the number of concurrent runs.

The overruns are documented and public. Uber had spent its entire 2026 AI coding budget by April, four months into the year, as Claude Code spread across roughly 5,000 engineers faster than the company's finance models had expected. Microsoft reportedly cancelled most of its direct Claude Code licenses and moved engineers to its own GitHub Copilot CLI, a decision that required knowing which tool was driving what spend. Neither case is about incompetent financial planning. Both are about a structural gap: the billing model changed faster than the governance model could follow.

Without attribution, shared LLM bills hide which teams, agents, and workflows drive spend. A content agent and a code review agent drawing from the same pool look identical on an invoice. The organization knows how much it spent, but not on what, by whom, or toward which outcome.

The attribution dimensions every engineering team needs to capture

Diagram: The Four Attribution Dimensions Every Agent Run Must Capture. Visualizes: Show four required attribution dimensions as a ranked or sequential set, each paired with the question it answers: Source (which team or workflow owns this spend?)…

Meaningful cost attribution for cloud agent runs requires capturing at minimum four dimensions: the source that triggered the run, the harness that executed it, the model invoked, and the credential or plan under which tokens were consumed. Each dimension answers a question the team will eventually be asked. Source answers the question of ownership. The originating surface, whether a Slack message, a Linear issue, a GitHub PR, a GitLab pipeline, or a direct dashboard trigger, determines which team or workflow owns the spend. Without it, all agent runs are anonymous, and no one can be held accountable for a bill they cannot see.

Harness answers the question of why this run cost more. As established, the harness is the dominant cost variable beyond model choice. Recording it is what makes harness-level cost comparison possible and what distinguishes runs of markedly different cost on the same model. Platforms like Replicas, which are harness-agnostic by design and run each agent task in its own isolated Linux VM, log the harness as a first-class dimension in every run's cost data, making the input-token overhead of one harness versus another immediately visible rather than buried in aggregate spend.

Model answers the question of what the token price actually was. You need it to compute token cost, because input prices vary across models, and to separate model-driven variance from harness-driven variance. It is also required for model-mix optimization decisions. Within a single harness, model mix is the biggest individual cost lever: an agent team using one expensive orchestrator and cheaper worker models can cost substantially less than running all agents on the same high-capability model.

Credential or plan answers the question of what rate was actually applied. The same model invoked under an API key, a Max subscription, or an Enterprise seat may carry different effective costs. Misattributing the plan invalidates the cost calculation outright. Secondary dimensions worth capturing where possible include task type, since a bug fix differs categorically from a refactor or a new feature, session length in turns, retry count, and whether the run produced a merged pull request or was abandoned. These are the fields that make cost-per-outcome analysis possible rather than merely cost-per-run.

How to structure attribution in practice: trace spans, tagging, and the schema that makes data usable

Trace-based attribution is the technical pattern that lets you roll up cost by harness and source without parsing logs by hand. Every agent invocation, LLM inference call, and tool execution becomes a span within a trace. Each span records tokens consumed, API fees incurred, and compute time used. Rolling up all spans under a single trace ID gives the full cost of one agent job.

Tags applied at span creation are what allow trace data to be sliced by business dimension later. The tags are source, harness, model, credential, and task ID. Tags added post-hoc are unreliable, because untagged spans cannot be retroactively attributed. The moment of span creation is the only moment when the metadata is reliably available. A minimum viable per-agent-job schema should include time from intent to merged PR, which captures lead time, cycle time per phase across spec, implement, verify, and review, retry count, failed gates, model and harness identifiers, token counts split by input and output, and whether the run produced a merged artifact. These fields connect the accounting view of spend to the engineering view of output.

Prompt caching is an attribution-adjacent lever worth recording. Anthropic's cache control can cut repeat-context costs substantially on cached tokens in agentic loops. Only teams that track per-turn input token counts will see if caching is actually firing and cutting spend. The data point exists at the span level or it does not exist at all.

Teams running agents from multiple surfaces need the triggering surface recorded at the trace level, not inferred from the agent's output. Codex's native Slack and Linear integrations share one execution substrate across Slack, Linear, and Codex cloud, so you must pass the source field explicitly rather than derive it from the endpoint. Inferring source from output is unreliable by construction when the substrate is shared. Replicas takes the same position in its own attribution model, tracking source and harness natively so that teams drawing from a shared LLM billing pool can see which surface initiated each run and which harness executed it, turning invoices from opaque line items into cost breakdowns by source and tool.

What to do with attribution data: the decisions it enables and the metrics that matter

Attribution data is only as valuable as the decisions it informs. The metrics that matter connect agent spend to shipped outcomes, not to raw token counts. Once the four dimensions are recorded, choices that were guesses become calculations.

Harness comparison becomes possible the moment harness is a recorded dimension. Teams can compute cost per merged PR by harness, not just total spend, and decide whether a cheaper harness at lower success rate beats an expensive one at higher success rate for a given task type. The framing that matters is cost per solved task. A harness that costs less per attempt but fails more often can be more expensive per shipped PR once retries are counted. The comparison is not about list prices. It is about full cycle cost including every failed round-trip.

Source-level accountability follows from tracking the triggering surface. When spend is attributable to Slack, Linear, or GitHub, teams can see which workflows generate the highest agent cost and whether those workflows produce proportionate output. That is the foundation for per-team or per-project budgets, and it replaces the shared-pool opacity that currently governs most agent spend.

Model-mix optimization is enabled by attribution by model. The orchestrator-versus-worker tiering decision, using a capable model only for final code generation and a cheaper model for planning, repository scanning, and tool loops, can reduce spend by roughly 40% without degrading output quality, per 2026 analysis. The saving is only available to teams that can see which model handled which phase of which run.

Anomaly detection depends on retry counts. Retry loops and stale-context sessions are the biggest sources of unexpected cost spikes. If a team tracks retry counts per run, it can set thresholds that trigger alerts or stop a session before a runaway agent drains quota. The data does not prevent the overrun. It makes the overrun visible while there is still something left to recover.

Productivity validation is the final and most consequential use. Cost per merged PR, PR size, bug rate post-merge, and review time are the metrics that connect agent spend to engineering output. Without attribution, productivity claims rest on vendor benchmarks, not on your team's own data. The evidence in the market is genuinely mixed: some studies show gains, others show experienced developers working more slowly while believing they are faster. Teams need their own attributed data to know which outcome they are getting.

The through-line is not attribution for its own sake. The goal is the ability to steer. Teams that can see spend by source and harness can make deliberate choices about which agents to run where, which models to assign to which phases, and which workflows justify their token consumption. Teams that cannot see these dimensions are governing a metered utility by guesswork, watching a bill arrive that they cannot decompose. The difference between those two positions is four fields recorded at span creation. Everything else follows from the decision to record them.

More in Cloud Agent Pricing