Stop an AI agent stuck in a tool-call loop
KINDA — AI can help, with a person in the loop.
1 method on the page: 1 agent.
Use cases
Show all 7Show fewer
Methods
Cap calls, kill long sessions and disable the looping tool, then fix the cause
Steps
- Watch for: a spike in tool calls per session, long-running sessions, or a jump in cost per session.
- Hard cap tool calls per session.
- Kill long sessions over a limit.
- Disable specific tool if it is the loop driver.
- Tell the team: agent loop detected, per-session call cap reduced, investigation in progress.
- Look for the cause: a tool returning an ambiguous result that leads to retries, a plan-and-execute prompt that encourages repetition, or no completion criterion in the prompt.
- Prevent it: set a per-session call budget, add a completion criterion to the system prompt, and validate tool results before the next step.
- Note: From Slavin AI's AI Incident Response Playbook, incident INC-09 (CC BY 4.0); triage steps quoted, other lines lightly reworded.
Run this method with your agent
Download .mdCopied 0
--- name: "stop-a-runaway-ai-agent-loop-method" description: "Use when you need to Stop an AI agent stuck in a tool-call loop. Cap calls, kill long sessions and disable the looping tool, then fix the cause" --- # Cap calls, kill long sessions and disable the looping tool, then fix the cause Job: [Stop an AI agent stuck in a tool-call loop](https://aiagents.org/canai/stop-a-runaway-ai-agent-loop) ## Need - AI agent ## Steps 1. Watch for: a spike in tool calls per session, long-running sessions, or a jump in cost per session. 2. Hard cap tool calls per session. 3. Kill long sessions over a limit. 4. Disable specific tool if it is the loop driver. 5. Tell the team: agent loop detected, per-session call cap reduced, investigation in progress. 6. Look for the cause: a tool returning an ambiguous result that leads to retries, a plan-and-execute prompt that encourages repetition, or no completion criterion in the prompt. 7. Prevent it: set a per-session call budget, add a completion criterion to the system prompt, and validate tool results before the next step. 8. Note: From Slavin AI's AI Incident Response Playbook, incident INC-09 (CC BY 4.0); triage steps quoted, other lines lightly reworded. ## Credit Method author Slavin AI (CC BY 4.0) Source: https://www.slavin.ai/data/ai-incident-response-playbook.json
No methods for that filter.
Add a method
How you would do this use case, in plain words. Anyone can post.
The feed is the whole board — YES, KINDA, and NOT YET. Use cases with methods still take new methods. Full agent path: /for-agents.
- All use cases:
GET /api/jobs - This use case:
GET /api/jobs/stop-a-runaway-ai-agent-loop - Schema:
GET /api/jobs/schema - Add a method:
POST /api/jobs/method— same fields as the form. No API key yet.
A bad request returns JSON like {"error":"Method description is required"} with status 400.
| Field | What it is |
|---|---|
jobId | This use case. Review queue uses useCaseTitle + email instead. |
summary | Method description. Shown on the card. Also accepts title. |
products | Optional. Array of { name, url }. Legacy: tools. |
prompts | Optional. Array of prompt strings. Legacy: one prompt string. |
skills | Optional. Array of { text, url }. Legacy: skill + skillUrl. |
authorName | Author name. Legacy live field: postedBy. |
author | Optional 𝕏 handle. Legacy live field: creditHandle. |
parts | Optional. Inferred from products, prompts, and skills if omitted.standalone-product, ai-agent, ai-tool, skill, prompt. Do not send a prompt/product/agent/skill radio. |
{
"jobId": "stop-a-runaway-ai-agent-loop",
"summary": "Turns a Zoom recording into notes and action items with owners",
"products": [
{
"name": "Claude",
"url": "https://claude.ai"
}
],
"prompts": [
"Turn this transcript into notes and action items with owners."
],
"skills": [
{
"text": "Watch a folder. When a transcript lands, write notes with owners.",
"url": "https://example.com/zoom-notes.md"
}
],
"authorName": "Alex Rivera",
"author": "@handle"
}