Evally
Agents

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.

Examples
34
303
No verdict yet

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.

  1. Q1Repeating itselfYes / no

    Do the recent_steps repeat the same action, or the same failing approach, at least twice without a meaningful change?

  2. Q2ProgressScore

    How much progress toward the goal do the recent_steps show?

    1. 0None, or going backwards
    2. 1A little
    3. 2Steady
    4. 3Nearly there
  3. Q3DriftingYes / no

    Are the recent_steps working on something other than the goal?

  4. Q4BlockedYes / no

    Do the recent_steps show 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.

  1. 1
    If Blocked ≥ 0.7Stop and escalatereview
  2. 2
    If Repeating itself ≥ 0.7 and Progress < 1 of 3Stop and escalatereview
  3. 3
    If Drifting ≥ 0.6Nudge: change approach
  4. 4
    If Repeating itself ≥ 0.6Nudge: change approach
  5. 5
    If Progress < 0.8 of 3Nudge: change approach
  6. ·
    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