Cost and latency spiked after a prompt change. Traces show agents repeatedly calling the same tool and re-planning in long loops until max tokens. Which optimization strategy should you implement?
Select an answer to reveal the explanation.
Short Explanation
C addresses the spike. Token optimization includes token limits, loop controls, and tool-call discipline. Cap iterations, detect repeated identical tool calls, stop on recurring failures, and right-size models per subtask. Unlimited loops burn money. Biggest model everywhere is costly and unnecessary. Hiding metrics guarantees surprise bills. Foundry tracing of tokens, prompts, and execution makes these controls observable—wire them into the orchestration middleware.
Full Explanation
Correct Answer — C
Optimizing token usage covers token limits, loop controls, and tool calls. Runaway re-planning loops need hard iteration caps, duplicate tool-call detection, early termination on repeated failures, and model tiering by task difficulty under quality gates.
Why A is wrong: Unlimited loops maximize token spend and latency.
Why B is wrong: Largest models for every subtask inflate cost without proportional benefit.
Why D is wrong: Without token visibility, teams cannot detect or fix waste.
Exam tip: Loop controls + tool-call dedupe + token budgets after prompt-driven cost spikes.