promptengineering

The agent drifts from your requirement while the context fills up

You asked for one behavior; twelve tool calls later it optimized the last output instead of the acceptance criteria. Context fills with intermediate logs, recent tokens dominate, and the original brief gets buried. Here is how drift happens and the cheap anchors that keep a task on rail.

3 min read