Agent loop & drift detector
Spot an agent that's stuck in a loop, drifting off-goal, or blocked, and stop wasting tokens.
Feed it the goal and the agent's last few steps. It flags repeated failing approaches, work that has nothing to do with the goal, and blockers the agent can't fix alone, so you can nudge it or hand off to a person before the bill grows.
Try it live
Real calls to Jev. Pick an example or paste your own.
Pick an example or paste your own input, then run it.
Under the hood
Every question and rule, in the open. Fork it to change any of them.
What it asks
Reads goal and recent_steps, then asks 4 questions in one call.
- Q1Repeating itselfYes / no
Do the
recent_stepsrepeat the same action, or the same failing approach, at least twice without a meaningful change? - Q2ProgressScore
How much progress toward the
goaldo therecent_stepsshow?- 0None, or going backwards
- 1A little
- 2Steady
- 3Nearly there
- Q3DriftingYes / no
Are the
recent_stepsworking on something other than thegoal? - Q4BlockedYes / no
Do the
recent_stepsshow the agent is blocked by something it can't fix alone (missing access, missing information, or an error outside its control)?
How it decides
Rules run in code, top to bottom. The first one that matches gives the verdict.
- 1If Blocked ≥ 0.7Stop and escalatereview
- 2If Repeating itself ≥ 0.7 and Progress < 1 of 3Stop and escalatereview
- 3If Drifting ≥ 0.6Nudge: change approach
- 4If Repeating itself ≥ 0.6Nudge: change approach
- 5If Progress < 0.8 of 3Nudge: change approach
- ·DefaultContinue
Call it from your code
Every template runs as-is with an API key, no setup: POST /api/v1/judges/agent-drift-detector/run.
curl -X POST https://tryevally.com/api/v1/judges/agent-drift-detector/run \ -H "Authorization: Bearer $EVALLY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": { "goal": "Get the Docker build passing in CI", "recent_steps": "Step 14: ran docker build, failed with '\''npm ERR! ERESOLVE unable to resolve dependency tree'\''.\nStep 15: deleted package-lock.json and ran docker build, same ERESOLVE error.\nStep 16: ran docker build again, same ERESOLVE error.\nStep 17: deleted package-lock.json and ran docker build, same ERESOLVE error." }}'Seen in the wild
Community builds on Jev that use this pattern. Not affiliated with Evally.
More in Agents
- Agents
Tool-call firewall
Judge every agent tool call before it touches your machine: allow, ask a human, or deny.
AllowAsk a humanDeny10 questions - Agents
Is the task done?
Don't trust an agent's "done". Check the transcript for proof, open errors and skipped work.
DoneDone, but unprovenNot done5 questions - Agents
Model router
Send each prompt to the cheapest model that can handle it.
Small modelMid-size modelFrontier model+14 questions - Agents
Tool router
Pick the right tool for a request without an LLM tool-calling round trip.
Ask to clarifyConfirm firstWeb search+62 questions - Agents
Context relevance filter
Decide what an agent keeps in context: keep, compress or drop each chunk.
KeepCompressDrop3 questions - Agents
Memory gate
Decide which messages in an agent's chat are worth remembering next session, and which change what it already knows.
Save itReplace a lineSkip4 questions