During a long refactoring task, an agent gradually starts changing files outside the agreed scope and ignoring the original plan. How do you detect and correct this drift?
- Exam domain
- Manage memory, state, and execution10–15% of the exam
- Difficulty
- Medium
- In this mock
- 8 questions on this domainPractise this domain
Why the exam asks this
Manage memory, state, and execution: Persist agent state and manage context drift.
Objective in the exam guide: Detect and correct drift during extended agent execution.
Long tasks wander. The exam checks detection and correction.
Why C is the answer
Compare its changes and actions against the saved plan at checkpoints, and steer or stop it when they diverge
Drift is detected by checking progress against a durable plan and scope at checkpoints; correction means re-steering, narrowing scope or stopping.
How it works
Drift is gradual divergence from the task's plan or scope.
A saved plan and scope give a reference to check against.
Checkpoints compare actual changes to that reference and allow correction.
Clues in the question
The words that point to the answer, and what each one tells you.
- Gradually
- Needs periodic checks.
- Outside the agreed scope
- A reference exists to compare with.
In detail
- Keep the plan as a file the agent re-reads at each checkpoint.
- Restrict file access to the agreed scope where possible.
Side by side with look-alikes
| Response | Detects and corrects? |
|---|---|
| Checkpoint comparison with saved plan | Yes |
| Let it continue | No |
| Hourly restart | No |
| More files | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Restart the whole task from scratch every hourWrong
Restarting loses progress and may drift again.
B. Give it more files to work onWrong
More files make drift worse.
C. Compare its changes and actions against the saved plan at checkpoints, and steer or stop it when they divergeRight
Drift is detected by checking progress against a durable plan and scope at checkpoints; correction means re-steering, narrowing scope or stopping.
D. Let it continue, since it may have found improvementsWrongMost tempting
Unplanned changes bypass review of the approach.
Why it tempts: Agents sometimes spot real improvements. But unplanned changes skip review of the approach and widen risk.
In practice
- Make the agent list changed files against the plan at each checkpoint.