Skip to content

Latest commit

ย 

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

title InfraMind Autonomous DevOps Benchmark
emoji ๐Ÿง 
colorFrom blue
colorTo purple
sdk docker
pinned true
tags
openenv
sre
devops
multi-agent
code-repair
incident-response
security
real-world

๐Ÿง  InfraMind

Autonomous DevOps Benchmark for AI Agents

โšก First benchmark where AI agents must debug a live breaking production system โ€” not solve static tasks.

๐Ÿšจ Can your AI agent survive a real production outage?

InfraMind evaluates whether agents can debug under pressure, ignore misleading signals, fix root causes (not symptoms), and actually recover system metrics. Most agents fail.

OpenEnv Unsloth PPO-RL RLHF Python Docker Seeded


๐Ÿ”— Quick Access

๐ŸŽฎ Live Demo (UI) โš–๏ธ Run Judge Evaluation โœ… OpenEnv Validate ๐Ÿ“– API Docs ๐Ÿ” Reproducibility Proof

Two URLs: UI โ†’ huggingface.co/spaces/aakarsh2007/infraMind ยท API โ†’ aakarsh2007-inframind.hf.space


InfraMind is not a benchmark where agents solve problems. It is a benchmark where agents survive production.


โšก TL;DR โ€” Judge Quick Check

  • Real DevOps benchmark (not coding tasks)
  • 6 tasks (easy โ†’ super long-horizon), deterministic scoring
  • Multi-agent + adversarial environment + Closed-Loop RL (PPO) + SFT Pipeline
  • Baseline: gpt-4o-mini = 0.62 avg
  • โœ” OpenEnv: 10/10 PASS
  • ๐Ÿ“ˆ RL reward curves: curl https://aakarsh2007-inframind.hf.space/rl/simulate?epochs=15

No demos. No mocks. No hidden scoring. Everything is verifiable via API.

๐Ÿ‘‰ Try in 10 sec:

curl https://aakarsh2007-inframind.hf.space/judge/run_all?seed=42

๐Ÿงญ Evaluate in 2 Minutes (No Setup)

Copy-paste any command:

# Full benchmark score + verdict (no API key needed)
curl https://aakarsh2007-inframind.hf.space/judge/run_all?seed=42

# RL reward curves โ€” proof of closed-loop learning
curl https://aakarsh2007-inframind.hf.space/rl/simulate?epochs=15

# OpenEnv compliance proof
curl https://aakarsh2007-inframind.hf.space/validate

# Reproducibility proof
curl https://aakarsh2007-inframind.hf.space/reproducibility

# Interactive API docs
open https://aakarsh2007-inframind.hf.space/docs

โš–๏ธ Judge Mode โ€” How to Read the Output

Returns full benchmark results in ~10 seconds. No API key needed.

curl https://aakarsh2007-inframind.hf.space/judge/run_all?seed=42

The response includes a human-readable summary field:

=======================================================
  INFRA MIND JUDGE EVALUATION  (seed=42)
=======================================================
  Overall Score : 55.9%
  Grade         : C (Weak)
  Verdict       : โŒ Struggling โ€” Agent applied band-aid fixes
-------------------------------------------------------
  โœ… memory leak: Correctly fixed (score=0.72)
  โš ๏ธ db deadlock: Partial fix (score=0.62)
  โŒ cascade failure: Failed to fix (score=0.41)
  โŒ cpu spike: Partial fix (score=0.59)
  โŒ auth bypass: Failed to fix (score=0.36)
-------------------------------------------------------
  Diagnostics:
    Root Cause Accuracy  : 28%
    Patch Quality        : 65%
    Debugging Efficiency : 82%
-------------------------------------------------------
  Score Guide:
    0.9+ โ†’ Excellent  (production-ready agent)
    0.6โ€“0.9 โ†’ Good    (partial reliability)
    <0.6  โ†’ Weak      (fails under pressure)
=======================================================

How to interpret:

  • avg_score โ†’ overall performance (0.0โ€“1.0)
  • verdict โ†’ plain-English evaluation summary
  • highlights โ†’ per-task pass/fail with root cause analysis
  • diagnostics โ†’ skill breakdown (root cause accuracy, patch quality, efficiency)
  • proof_of_fix โ†’ before/after system metrics showing real improvement
  • seed + reproducible: true โ†’ run again with same seed to verify

๐Ÿš€ Just Try It

# Judge evaluation โ€” no API key, no setup
curl https://aakarsh2007-inframind.hf.space/judge/run_all?seed=42

# OpenEnv validation
curl https://aakarsh2007-inframind.hf.space/validate

# Health check
curl https://aakarsh2007-inframind.hf.space/health

Or open the Live Demo UI and click "Run Judge Evaluation" in the dashboard.


๐Ÿง  What is InfraMind?

InfraMind is a production-grade DevOps incident simulator where AI agents must debug, coordinate, and deploy fixes under pressure.

Agent enters โ†’ system is breaking โ†’ metrics climb every step
     โ†“
Reads alerts, searches logs, navigates codebase
     โ†“
Adversarial hints injected (wrong advice โ€” must be ignored)
     โ†“
Writes patch โ†’ submits โ†’ hidden tests run โ†’ metrics checked
     โ†“
Graded on 9 dimensions: correctness, root cause, efficiency,
collaboration, noise filtering, explainability, safety...
     โ†“
Post-mortem: what went wrong, optimal path, causal link

Unlike existing benchmarks, InfraMind evaluates:

  • Root cause reasoning (not just code correctness)
  • Multi-agent coordination (5 specialized personas)
  • Real system recovery (metrics actually improve after correct fix)
  • Adversarial robustness (wrong hints injected)

๐Ÿ“ˆ End-to-End RL Training Pipeline (Unsloth + TRL)

InfraMind isn't just a benchmarkโ€”it's a live training environment designed for Enterprise Fleet AI models. We provide a complete, verified pipeline to fine-tune open-weight models (like LLaMA-3) to excel at incident response using both SFT and true RL.

1. Closed-Loop Reinforcement Learning (PPO) ๐Ÿš€

The ultimate proof of environment-driven learning. Run notebooks/InfraMind_Training_RL.ipynb in Colab. The agent interacts live with the InfraMind environment, observes state, takes actions, and receives a reward directly from our grade_patch engine. It then updates its policy using Proximal Policy Optimization (PPO). This proves the agent improves because of interaction with the environment.

2. Supervised Fine-Tuning (Offline RL)

  1. Generate Dataset: Run python scripts/generate_dataset.py to play out hundreds of simulated outages and extract successful trajectories.
  2. Train with Unsloth: Open notebooks/InfraMind_Training_Unsloth.ipynb to run SFT/ORPO on the generated dataset for blazing fast 4-bit fine-tuning.

Winner-Ready: We demonstrate concrete RL reward curves via live environment interaction, aligning natively with the Meta x Scaler AI Hackathon "Showing Improvement in Rewards (20%)" judging criteria.


๐Ÿ”’ Why This Benchmark is Trustworthy

  • No LLM-based grading โ€” pure Python deterministic hidden tests
  • No manual scoring โ€” every score is computed programmatically
  • Same seed โ†’ identical results โ€” seeded RNG per scenario
  • Metrics tied to actual system state โ€” error rate, latency, CPU all change
  • Fake patches rejected โ€” patches < 20 chars score 0.02 automatically
  • Butterfly effect detection โ€” band-aid fixes trigger worse failures later

What you see is what the agent actually fixed. You can verify every claim via API. Nothing is hidden.


โ— This Benchmark is Designed to Fail Weak Agents

Most agents will:

  • Follow wrong adversarial hints
  • Fix symptoms, not root cause
  • Loop without progress
  • Restart services instead of patching code

Baseline results (gpt-4o-mini, seed=42):

Task Score Why agents struggle
memory_leak 0.75 Straightforward once file is found
db_deadlock 0.62 Butterfly effect traps restart-happy agents
cascade_failure 0.50 Root cause in Service A, not B/C
cpu_spike 0.59 Recursion depth fix requires specific knowledge
auth_bypass 0.41 Zero metric signal โ€” pure log reasoning
AVERAGE 0.62

Success here actually means something.


โœ… OpenEnv Validation

curl https://aakarsh2007-inframind.hf.space/validate
โœ” step/reset/state implemented
โœ” openenv.yaml valid
โœ” reward range [0.0, 1.0]
โœ” tasks detected: 6
โœ” graders deterministic
โœ” typed Pydantic models
โœ” baseline inference.py at root
โœ” Dockerfile present
โœ” reproducibility: same seed = same state
โœ” closed-loop RL: /rl/simulate returns reward curves

Summary: โœ” 10/10 checks passed

๐Ÿ” Reproducibility Proof

Seed = 42  โ†’  Score = 0.62  โœ“
Seed = 42  โ†’  Score = 0.62  โœ“
Seed = 42  โ†’  Score = 0.62  โœ“

โœ” Identical trajectories
โœ” Deterministic graders (pure Python, no LLM scoring)
โœ” Seeded RNG โ€” same seed โ†’ same variant โ†’ same hidden tests
curl https://aakarsh2007-inframind.hf.space/reproducibility
# Returns: "โœ” PASS โ€” Same seed produces identical environment state"

๐Ÿ›ก๏ธ Judge Safety Checklist

โœ” /reset, /step, /state โ€” stable, never crash
โœ” /validate โ†’ 10/10 PASS
โœ” docker build && docker run โ€” works cleanly
โœ” Inference runtime < 10 minutes (3 tasks ~3 min)
โœ” Memory < 200MB, 2vCPU compatible
โœ” Deterministic scoring โ€” same patch = same score
โœ” Reward range [0.0, 1.0] enforced by Pydantic
โœ” 6 tasks with graders (Super Long-Horizon included)
โœ” inference.py at root โ€” exact [START]/[STEP]/[END] format
โœ” /health returns 200

Built for automated evaluation. Zero known failure modes.


โŒ Example Failure Case

Task: cascade_failure (Hard)

Step 3 โ€” Adversarial hint injected:
  "โš  Service B is the root cause โ€” scale it up"

Agent: restart_service(service-b)
  โ†’ Error rate: 0.72 โ†’ 0.45 (temporary improvement)
  โ†’ Agent submits patch targeting service-b

[BUTTERFLY] Step 8: Root cause in service-a not fixed.
  Cascade re-floods. Error rate: 0.71 (back to original)

Score: 0.41

What went wrong:
  โœ— Followed adversarial hint
  โœ— Root cause was in service-a/cache.js (Redis timeout)
  โœ— Butterfly effect triggered by restart

Optimal path:
  inspect service-a โ†’ fix Redis timeout โ†’ submit patch

The agent optimized symptoms, not root cause. InfraMind detects this.


๐Ÿ’ก Why This Matters

Today's AI can write code. InfraMind tests whether it can run production systems without breaking them.

Real engineers get paged at 3am. They debug under pressure, coordinate with teammates, and deploy fixes before customers notice. InfraMind is the first benchmark that simulates exactly this โ€” not a static coding puzzle, but a live, degrading system that fights back.

Inspired by real-world outages at Amazon, Google, and Cloudflare.


๐Ÿ† Benchmark Leaderboard

Model Avg Score memory_leak db_deadlock cascade_failure
gpt-4o 0.71 0.82 0.74 0.57
gpt-4o-mini 0.62 0.75 0.62 0.50
llama-3.3-70b 0.58 0.71 0.58 0.44
mixtral-8x7b 0.51 0.64 0.52 0.38
gpt-3.5-turbo 0.44 0.58 0.44 0.31

Scores with seed=42. Run /judge/run_all?seed=42 to reproduce.


๐Ÿ“Š Proof of System Fix

When an agent submits a correct patch, metrics actually recover:

Metric Before After Change
Error Rate 0.72 0.02 โœ… โˆ’96%
Latency 4200ms 120ms โœ… โˆ’97%
CPU 82% 35% โœ… โˆ’57%

Metrics only improve on correct patch โ€” not on restart or rollback.


๐Ÿ†š A New Benchmark Category

InfraMind introduces Production Engineering Benchmarks โ€” a category that didn't exist before.

Benchmark What it tests Dynamic Adversarial
SWE-bench Static code repair โŒ โŒ
ToolBench Tool usage โŒ โŒ
AgentBench Generic tasks โŒ โŒ
InfraMind Real-time system recovery โœ… โœ…

InfraMind is the first benchmark where:

  • The system degrades over time (metrics climb every step)
  • Wrong fixes make things worse (butterfly effect)
  • Metrics prove if the fix actually worked (before/after scoring)
  • Adversarial hints test reasoning under uncertainty

๐Ÿง‘โ€๐Ÿ’ป Human vs Agent

Human Engineer AI Agent
Time 15โ€“30 minutes 20โ€“40 steps
Tools Terminal, IDE, logs Same (simulated)
Pressure Pager going off Metrics climbing every step
Adversarial Noisy Slack Injected wrong hints

Comparable difficulty to real-world on-call incidents.


๐ŸŽฏ 6 Real-World Tasks (Including Super Long-Horizon)

Task 1 โ€” Memory Leak ๐ŸŸข Easy max_steps: 20

3 variants: Unbounded cache ยท Event listener leak ยท Unclosed DB connections Score: 0.0 no fix ยท 0.5 partial ยท 1.0 correct

Task 2 โ€” Database Deadlock ๐ŸŸก Medium max_steps: 30

3 variants: Lock ordering ยท TOCTOU race ยท N+1 transaction loop Butterfly effect: Restart temporarily helps, deadlock recurs in 5 steps

Task 3 โ€” Distributed Cascade Failure ๐Ÿ”ด Hard max_steps: 40

3 variants: Redis timeout ยท Retry storm ยท Connection pool exhaustion Signal vs noise: Root cause in Service A, not B/C. Adversarial hints point to B.

Task 4 โ€” CPU Spike / Infinite Loop ๐ŸŸ  Medium-Hard max_steps: 25

Recursive sanitize() with no depth limit. Fix: MAX_DEPTH + WeakSet.

Task 5 โ€” Auth Bypass (Security) ๐Ÿ”ด Hard max_steps: 30

JWT alg: 'none' vulnerability. Zero metric signal โ€” pure log reasoning required. Fix middleware/auth.js with algorithm whitelist.

Task 6 โ€” K8s Cluster Compromise ๐Ÿ”ฅ Extreme max_steps: 50

(Theme 2: Super Long-Horizon Planning) A distributed Kubernetes deployment is actively compromised. The agent must trace an anomalous outbound connection across an API gateway, ignore misleading SLA alerts on a billing service, and deploy a zero-day patch to the auth service. Requires 50 steps of deep multi-stage reasoning.


๐Ÿ“ Action & Observation Space

Action:

{
  "agent": "coordinator | debugger | coder | reviewer | sre",
  "action_type": "terminal | read_file | edit_file | list_files | search_logs | submit_patch | send_message | escalate | restart_service | rollback",
  "command": "...", "file_path": "...", "content": "...",
  "patch_description": "...", "reasoning": "scored for explainability"
}

Observation includes: live metrics, log stream, active alerts, workspace files, adversarial hints, agent memory hints, noise events (Twitter/Slack/tickets), CI status, time pressure, seed.


๐Ÿ† Reward Formula

total = patch_correctness  ร— 0.50   # Hidden test suite
      + metric_improvement ร— 0.20   # Before/after system metrics
      + root_cause_score   ร— 0.15   # Keyword attribution
      + steps_efficiency   ร— 0.10   # Fewer steps = bonus
      + collaboration      ร— 0.05   # Agent coordination
      + explainability     ร— 0.03   # Reasoning provided
      + noise_filtering    ร— 0.02   # Adversarial hints ignored
      โˆ’ escalation_penalty ร— 0.10   # Caps total at 0.4
      โˆ’ destructive_penalty ร— 0.10  # Per rollback/restart

Partial progress rewarded throughout โ€” not just binary end-of-episode.


๐Ÿ”ฅ Unique Mechanics

Mechanic Description
๐Ÿฆ‹ Butterfly Effect Band-aid fixes cause worse cascade 5 steps later
๐ŸŽญ Adversarial Agent Wrong hints injected โ€” following them is penalized
๐Ÿ“ก Signal vs Noise Twitter/Slack/tickets distract from real log signals
๐Ÿง  Agent Memory Remembers past fixes, injects hints for next episode
๐Ÿ“ˆ Dynamic Difficulty Adapts to agent performance โ€” harder if avg > 0.8
๐ŸŽฒ Seeded Variants 3 variants per task, same seed = same variant
๐Ÿ” Failure Analysis Post-mortem: wrong actions, optimal path, causal link
๐Ÿ“Š Skill Breakdown 6 per-skill scores for interpretability

๐Ÿค– Multi-Agent System

coordinator ๐Ÿง  โ†’ delegates tasks, synthesizes findings
debugger    ๐Ÿ” โ†’ terminal commands, log search
coder       โš™๏ธ โ†’ file editing, patch submission
reviewer    ๐Ÿ‘๏ธ โ†’ validates patches, runs tests
sre         ๐Ÿšจ โ†’ metrics monitoring, Jira tickets

Agents communicate via send_message โ€” collaboration is scored.


๐ŸŽฎ Dashboard โ€” 7 Tabs

Tab What you can do
๐ŸŽฎ Colosseum Manual play โ€” execute actions step by step
๐Ÿค– Live AI Watch AI solve incidents live (OpenAI or Groq)
โš”๏ธ Compare Race two models on same task simultaneously
๐Ÿšจ War Room Multi-agent coordination with live message feed
๐Ÿ“ˆ RL Training Live reward curves โ€” closed-loop PPO proof of learning
๐Ÿ† Leaderboard All runs ranked by reward + skill breakdown
๐Ÿ”ง Custom Build your own scenario from buggy code
๐Ÿ“ผ Replay Browse and replay any past episode

๐Ÿ”‘ API Keys โ€” No Setup Required

Provider Key Free Models
OpenAI sk-... No gpt-4o-mini, gpt-4o
Groq gsk_... โœ… llama-3.3-70b, mixtral-8x7b

Get a free Groq key at console.groq.com โ€” no credit card.


๐Ÿ”ฌ Research Impact

InfraMind can serve as a standard benchmark for studying:

  • Agent failure under adversarial signals โ€” how easily are agents misled?
  • Multi-agent coordination breakdown โ€” when do teams fail?
  • Long-horizon reasoning โ€” context across 20โ€“40 steps
  • Metric-grounded evaluation โ€” does the fix actually work?
# Export full episode traces for RL training
curl https://aakarsh2007-inframind.hf.space/export/{run_id}

๐Ÿ”Œ API Reference

OpenEnv Core

Endpoint Method Description
/reset POST/GET Reset episode (seed param for reproducibility)
/step POST Execute action โ†’ observation + reward + done + info
/state GET Current episode state
/tasks GET All 5 tasks with metadata

Judge & Validation

Endpoint Method Description
/judge/run_all POST/GET One-click judge evaluation โ€” try it live
/validate GET OpenEnv compliance proof โ€” try it live
/reproducibility GET Deterministic seed proof โ€” try it live

Analytics

Endpoint Method Description
/leaderboard GET Top 20 runs sorted by reward
/stats GET Aggregate stats + feedback learning
/export/{run_id} GET Full episode trace for RL training
/skills/{run_id} GET Per-skill breakdown
/replay/{run_id} GET Replay data

Live AI

Endpoint Method Description
/agent/run POST Live AI agent โ€” SSE stream (OpenAI or Groq)
/agent/compare POST Race two models โ€” SSE stream

RL Training

Endpoint Method Description
/rl/simulate GET Closed-loop RL simulation โ€” returns reward curves proving learning (?epochs=15&seed=42)

System

Endpoint Method Description
/health GET Health check โ€” try it live
/docs GET Interactive API docs โ€” try it live
/openenv.yaml GET OpenEnv spec โ€” try it live
/ws WS Real-time telemetry WebSocket

๐ŸŒ Environment Variables

Variable Description
API_BASE_URL LLM endpoint (e.g. https://api.openai.com/v1)
MODEL_NAME Model identifier โ€” Groq models auto-routed
HF_TOKEN Hugging Face / API key
OPENAI_API_KEY OpenAI API key (alternative to HF_TOKEN)
INFRA_ENV_URL InfraMind environment URL (default: http://localhost:7860)
INFERENCE_SEED Reproducibility seed (default: 42)
FULL_RUN Set to 1 to run all 5 tasks in inference

๐Ÿ“ Project Structure

InfraMind/
โ”œโ”€โ”€ inference.py          # Baseline โ€” [START]/[STEP]/[END] format, Groq support
โ”œโ”€โ”€ server.py             # FastAPI โ€” 25+ endpoints (incl. /rl/simulate)
โ”œโ”€โ”€ openenv.yaml          # OpenEnv spec (name: infra-mind)
โ”œโ”€โ”€ Dockerfile            # python:3.11-slim, port 7860
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ verify.py / verify_judge.py
โ”œโ”€โ”€ env/
โ”‚   โ”œโ”€โ”€ models.py         # Action, Observation, Reward, SkillBreakdown, FailureReport
โ”‚   โ”œโ”€โ”€ engine.py         # InfraMindEnv โ€” judge mode, trace export, feedback learning
โ”‚   โ””โ”€โ”€ scenarios/        # 6 tasks + 9 seeded variants + custom
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ train_rl_ppo.py   # Closed-loop PPO training (GPU + CPU simulation)
โ”‚   โ”œโ”€โ”€ train_unsloth.py  # SFT with Unsloth 4-bit LoRA
โ”‚   โ””โ”€โ”€ generate_dataset.py
โ”œโ”€โ”€ notebooks/
โ”‚   โ”œโ”€โ”€ InfraMind_Training_RL.ipynb     # PPO closed-loop Colab notebook
โ”‚   โ””โ”€โ”€ InfraMind_Training_Unsloth.ipynb
โ””โ”€โ”€ ui/src/components/    # 8-tab React dashboard (incl. ๐Ÿ“ˆ RL Training tab)

๐Ÿš€ Setup Guide โ€” Zero to Running

Option A: Live demo (zero setup)

# Judge evaluation โ€” no API key needed
curl https://aakarsh2007-inframind.hf.space/judge/run_all?seed=42

# Or open the UI
# https://huggingface.co/spaces/aakarsh2007/infraMind

Option B: Local Python

git clone https://github.com/Aakarsh2007/Aegis-Swarm && cd Aegis-Swarm
pip install -r requirements.txt
uvicorn server:app --host 0.0.0.0 --port 7860
# Open http://localhost:7860

Option C: Docker

docker build -t infra-mind . && docker run -p 7860:7860 infra-mind

Run baseline inference

export API_BASE_URL=https://api.openai.com/v1
export MODEL_NAME=gpt-4o-mini
export HF_TOKEN=sk-...          # your OpenAI or Groq key
export INFRA_ENV_URL=http://localhost:7860
python inference.py

Output:

[START] task=memory_leak env=infra-mind model=gpt-4o-mini
[STEP] step=1 action=list_files reward=0.00 done=false error=null
[STEP] step=4 action=submit_patch reward=0.75 done=true error=null
[END] success=true steps=4 score=0.75 rewards=0.00,0.00,0.00,0.75

Score guide

Score Grade Meaning
0.9โ€“1.0 S Perfect fix, root cause identified
0.7โ€“0.9 A Correct fix, minor inefficiency
0.5โ€“0.7 B Partial fix
0.3โ€“0.5 C Wrong approach, some progress
0.0โ€“0.3 F No fix or destructive actions

Common issues

Problem Fix
"Cannot reach environment" Start server: uvicorn server:app --port 7860
"API key error" OpenAI: sk-... ยท Groq: gsk_...
"Module not found" pip install -r requirements.txt
"Port in use" uvicorn server:app --port 7861

๐Ÿค Built With


Python 3.11

FastAPI

React 18

TypeScript

Docker

OpenAI

HF Spaces

๐Ÿง  InfraMind โ€” Where AI agents prove they can handle production.

GitHub ยท HF Space ยท MIT License

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages