The Task-Level P&L: Shipping AI Agents Without Donating Your Margin
Photo: Scorecard AI / Darius Emrani, CC BY-SA 4.0, via Wikimedia Commons
In 2026, AI agents are moving from demo to default. They triage support tickets, enrich leads, reconcile invoices, and draft follow-ups. The model quality conversation is getting better. The margin conversation is getting worse.
The reason is simple: most founders price agents by token cost and measure them by demo quality. Finance sees a different picture. An agent that costs pennies per call can still lose money on every successful task once you add retries, tool calls, human review, and failed escalations. The fix is not a better model. It is a task-level P&L.
Token pricing is not unit economics
A token price is an input, not an outcome. Agents are multi-step systems. They retrieve context, plan, call tools, verify results, and sometimes retry. Each step adds cost. Each failure adds cost. Each human fallback adds cost.
If your agent resolves 40% of tickets and escalates 60%, you pay for both paths. The escalated ticket still needs a human. The failed attempt still burned tokens and tool calls. That is why a low cost per API call can coexist with a terrible cost per resolved issue.
Define the unit before you build
Pick one workflow and one unit of value. Not 'an agent.' A unit. For support triage, it might be 'a ticket resolved without human edit.' For sales ops, 'a lead enriched with verified firmographics.' For finance, 'an invoice matched to a purchase order without manual review.' Write the definition down. If the unit is fuzzy, the economics will be fuzzy.
Then build a simple model:
Cost per successful task = (model input + model output + tool calls + retries + human review + infrastructure overhead) ÷ successful tasks.
Use your own rates. The point is not precision on day one. The point is to see which line item is eating the margin.
Here is an illustrative example. A support agent handles 1,000 tasks. Average input is 8,000 tokens at $2 per million. Average output is 1,200 tokens at $8 per million. It makes three tool calls at $0.02 each. It retries 30% of the time, which adds 30% to model cost. Ten percent of tasks go to human review at $3 per review. Ignore infrastructure for a moment.
Input: 8,000 × $2 ÷ 1,000,000 = $0.016. Output: 1,200 × $8 ÷ 1,000,000 = $0.0096. Tool calls: 3 × $0.02 = $0.06. Retry overhead: 30% × $0.0256 = $0.0077. Human review: 10% × $3 = $0.30. Total cost per task: about $0.393. If only 60% of tasks succeed, cost per successful task is about $0.655.
That number is the one finance cares about. It is also the number that should sit next to your price.
Route models by task, not by vibe
The most common margin leak is sending every task to the biggest model. That is like hiring a senior engineer to rename a file. Route work by complexity.
Use a small model for classification, extraction, and formatting. Use a larger model for planning, ambiguous reasoning, and customer-facing copy. Add a router that checks confidence, task type, customer tier, and whether the task has a known template. Cache common answers. Batch non-urgent work. Evaluate quality by route, not just overall.
Routing adds complexity, so keep it visible. Log which route handled each task, the cost, the latency, and the outcome. If a cheap route fails more often, it may not be cheap. The goal is lowest cost per successful task, not lowest cost per call.
Guardrails are financial controls
Every agent needs limits. Maximum steps. Maximum tool calls. Maximum tokens. Maximum spend per task. Maximum spend per customer per day. A timeout that stops runaway loops. A human-in-the-loop rule for high-value or high-risk actions.
Guardrails are not just safety features. They are budget enforcement. An agent without a step limit is a variable expense with a growth mindset. Add structured outputs so you are not paying for prose when you need a JSON object. Add deduplication so the same request does not trigger three tool calls. Add a fallback to a template or a human instead of another agent loop.
Kill switches and the weekly review
Every agent should have a kill switch. Not a metaphorical one. A feature flag, a per-agent budget cap, a circuit breaker, and a named owner. If cost per successful task crosses a threshold, the agent pauses or downgrades automatically. If the human escalation rate spikes, the agent pauses. If a model provider changes pricing or latency, you should know before the invoice arrives.
Run a weekly review. Monday: look at the ten most expensive tasks. Wednesday: adjust routing or prompts. Friday: decide keep, fix, or kill. Track cost per successful task, human escalation rate, p95 latency, and gross margin by agent. If the cost per successful task is higher than the value of the outcome, stop shipping more volume.
Price the agent like a product
If the agent is bundled into a subscription, cap usage or define fair use. If it is usage-based, set a gross margin target and monitor it. Do not sell unlimited agent tasks unless you have modeled the tail. Enterprise contracts need clear overage terms, because one power user can erase the margin on an entire account.
AI agents can improve margins by absorbing repetitive work. They can also erode margins quietly because the cost is spread across many small calls. The task-level P&L makes the trade-off visible. Ship the agent. But price the task before it prices you.