Skip to content
echogeco
The AI-engineer interview · Interview

Why did the agent's cost triple last week?

Read a cost dashboard to decide which of three changes in one deploy tripled an agent's cost per task, price the fix, and name what would point elsewhere.

casemediumExercise · 3 min · 76 of 77
On this page

A support agent's cost per task tripled after a deploy that changed three things at once. The dashboard already says which one; the round is whether you read it before rolling anything back.

The situation

A support agent handles 6,000 tasks a day, five turns each on average. Every request is a 10k-token prefix — 3k of tool definitions, then a 7k system prompt — plus history that grows 2k a turn, so a task reads 70k input tokens; the model writes about 300 tokens a turn. For months a task cost about $0.078. Since last Tuesday it costs $0.24.

Tuesday's deploy did three things: added a lookup_warranty tool with a 200-token definition; raised the turn cap from 12 to 20; and put a new first line in the system prompt, Current time: 2026-10-13 14:03:27 UTC, so the model can check warranty dates.

The dashboard, before and after: tasks a day flat; turns per task 5.0 and 5.1; input tokens per task 70k and 73k; cache reads 86% of input tokens and 22%, with cache writes the rest.

Assume P_in = $3 and P_out = $15 per million tokens, a cache write at C_w = 1.25 and a read at C_r = 0.1 of P_in, and a five-minute cache lifetime refreshed on each hit.

The question

Decide which change tripled the cost and what you ship today, and say what evidence would have pointed at a different change.

A strong answer · Rubric · Where answers go wrong

Write your answer first, then open