Evaluate AI Agent Performance for Infinite Loops and Goal Drift

This rubric provides a deterministic framework to audit your AI agent logs for silent infinite loops, semantic drift from core objectives, and inefficient token usage.

Agent prompt for Claude and ChatGPT

Prompt

Prompt
You are a senior AI systems reliability engineer. Your job is to audit agent interaction logs to identify signs of infinite loops, task stagnation, and goal drift. Before beginning, ask the user these three questions: 1. What is the primary goal of the agent you are evaluating? 2. Please provide the JSON or text log of the agent interaction. 3. What is the maximum number of tool calls allowed in a successful execution cycle? Once the user provides this, create an evaluation report using the following rules: 1. Flag any repetitive tool call sequences where parameters change by less than 5 percent. 2. Calculate the token burn rate per task step and flag spikes exceeding 20 percent over the rolling average. 3. Define a semantic drift score from 1-10 based on how far the agent output deviates from the stated goal. 4. Provide a clear Pass or Fail status for the interaction. Output format: Section 1: Executive Summary. Section 2: Technical Audit Table with columns for Metric, Value, and Status. Section 3: Remediation Plan with 3 actionable steps to fix detected issues. Note: This analysis is for technical debugging and does not replace human oversight of agent logic.

Example output

Agent audit: loop, token and drift findingsAll three audit metrics failed
Identical tool calls detected
3 calls
Loop Detection: Fail
Token burn spike at step 5
42%
Token Burn Rate: Fail
Semantic drift score (High)
8/10
Drift began after step 4: Fail

Example for: an autonomous research agent designed to summarize financial reports. ### Executive Summary The agent exhibited signs of goal drift after step 4, shifting from summarizing specific quarterly earnings to performing broad, irrelevant market sentiment analysis. A repeating loop was detected in the data fetching module where the agent requested the same API endpoint with near-identical query parameters. ### Technical Audit Table | Metric | Value | Status |
| :--- | :--- | :--- |
| Loop Detection | 3 identical tool calls | Fail |
| Token Burn Rate | 42 percent spike at step 5 | Fail |
| Semantic Drift Score | 8/10 (High) | Fail | ### Remediation Plan 1. Implement a state-based cache check to prevent the agent from re-calling the same API endpoint with identical parameters within the same session. 2. Add a hard stop condition or prompt constraint that forces the agent to re-verify its output against the initial task description every 3 steps. 3. Lower the temperature setting for the final summarization step to reduce creative hallucination and focus strictly on the provided financial dataset.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Forces a deterministic assessment of parameter change percentages to catch subtle loops.
  • Uses token burn rate as a proxy for efficiency to detect runaway processes.
  • Requires a semantic drift score to quantify how far the agent strayed from the objective.

Use this prompt to audit logs from autonomous agents built on frameworks like LangChain, CrewAI, or AutoGPT. Paste your raw interaction logs directly into ChatGPT, Claude, or Gemini after answering the initial questions.

Common edits

  • Adjust the drift score threshold if your agent requires more creative latitude.
  • Modify the remediation steps to match your specific agent framework or API architecture.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Agent Orchestration

Create Error Handling Contracts for AI Agents

This prompt transforms raw stack traces into structured error envelopes that provide agents with specific remediation steps and valid parameter constraints for self-correction.

Agent OrchestrationClaude

Design Human-in-the-Loop Escalation Gates for AI Agents

This prompt creates a structured risk-assessment framework for AI agents, forcing human approval for high-stakes tool invocations based on a four-tier risk rubric.

Agent OrchestrationClaude

Design Mock Tool Fixtures for Agent Trajectory Testing

Generate deterministic mock tool responses to test agent decision trees, edge-case failures, and schema-breaking payloads without live API usage or costs.

Agent OrchestrationClaude

Triage Dead-Letter Queue Logs for Failed AI Agents

Sort unhandled agent run failures into an actionable classification table separating tool downtime, invalid schema calls, and missing user context.

Agent OrchestrationClaude

Create Role-Based Tool Gating Matrix for AI Agents

Generate a security-focused tool access matrix that restricts AI agent capabilities based on user permissions and execution phases.

Agent OrchestrationClaude

Define Context Compression Rules for Long-Running AI Agents

Create a formal policy for compressing conversation history and managing agent memory to ensure long-running threads remain efficient without losing critical task data.