Skip to content

Conversation

@himayday
Copy link

@himayday himayday commented Aug 29, 2025

CRE-2025-0165: AutoGPT Infinite Loop Memory Exhaustion Detection

🎯 Overview

This PR introduces a comprehensive detection rule for AutoGPT infinite loop memory exhaustion - addressing critical production failures where AutoGPT agents become stuck in recursive task execution patterns. The rule identifies when autonomous agents lose memory context and repeatedly attempt the same actions, leading to exponential resource consumption and system crashes.

CRE Playground Links

CRE-2025-0165 Playground: Test Rule

📊 AutoGPT Issues Covered

# Issue Type Example Error Pattern
1 Infinite Action Loops THOUGHTS:.*(?:attempting|trying|executing).*action
2 Memory Buffer Overflow Memory usage:.*(?:[8-9][0-9]|100)%
3 Repeated Command Execution COMMAND.*execute_.* (sequential pattern)
4 API Cost Overruns Exponential API call costs during loops
5 Task Execution Failures (?:Failed|Error|Unable to).*(?:execute|complete|perform)
6 Resource Exhaustion CPU 98%, Memory 91% patterns
7 Agent State Corruption Loss of context between iterations
8 System Crash Risk OOM conditions from unbounded memory growth

🧪 Testing & Validation

image
# Test the rule with provided log data
cat rules/cre-2025-0165/test.log | preq -r rules/cre-2025-0165/autogpt-infinite-loop-memory-exhaustion.yaml -d

Rule Logic

The detection rule identifies the following sequence within a 60-second window:

  1. Initial thought process about attempting an action
  2. Command execution attempt
  3. Failure response (error/timeout/rate limit)Re
  4. Repeated thought process (same action)
  5. Repeated command execution (identical command)
  6. High memory usage (80%+ threshold)

🎬 Demo Environment

Repo link Repo Link invitation send

Screencast.from.2025-08-29.15-05-34.mp4

🚨 Production Impact Examples

Real-world scenarios covered:

  • AutoGPT agent stuck in web search loops
  • Memory consumption escalation (45MB → 456MB)
  • API cost explosion ($14.50 in 15 seconds)
  • System resource exhaustion (CPU 98%, Memory 91%)
  • Complete task failure with no recovery mechanism

🛡️ Mitigation Strategies

The rule enables detection of:

  • Immediate: Resource consumption spikes
  • Short-term: Repeated action patterns
  • Long-term: Memory leak identification
  • Cost Control: API usage monitoring
  • System Health: Resource exhaustion alerts

References

closes #129
/claim #129

…0165)

This CRE rule detects when AutoGPT enters an infinite loop during task execution,
repeatedly attempting the same actions without memory of previous attempts. The rule
identifies the pattern of repeated command execution, failures, and memory exhaustion
that characterizes this high-severity production issue.

Key detection patterns:
- Repeated thought-command-failure sequences within 60s window
- Memory usage approaching critical levels (80%+)
- Absence of successful task completion markers
- Command retry loops without progression

Addresses GitHub issue prequel-dev#129 for AutoGPT high-severity failure reproduction.
@amanycodes
Copy link
Contributor

Hi @himayday thanks for submitting the CRE! this LGTM, please solve the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutoGPT: Reproduce A High-Severity Failure & Write a CRE Rule [Multiple Winners] [Submit by August 31 11:59 pm ET]

2 participants