LLM agents act as on-call Site Reliability Engineers, investigating simulated production incidents under partial observability, time pressure, and cascading failures.
๐ฎ Live Dashboard ยท ๐ Environment Docs ยท ๐ Benchmark Guide ยท ๐ค Agent Guide ยท ๐ Reward Design
When production systems fail at 3 AM, engineers must quickly investigate cascading failures across distributed microservices to identify the root cause. This environment simulates that exact challenge โ a gym-compatible RL benchmark where agents must:
โ
16 Incident Tasks โ CPU spikes, memory leaks, database deadlocks, SSL cert expiry, multi-fault scenarios, long-horizon planning
โ
7 Action Types โ read_logs, check_metrics, check_health, run_db_query, restart_service, rollback_deployment, declare_rca
โ
6 Microservices โ API gateway (victim), auth, orders, notifications, Redis cache, PostgreSQL database
โ
Multi-Fault Support โ Dual independent failures (e.g., Redis + Auth both failing)
โ
Cascade Mechanics โ Secondary failures triggered at specific episode steps
โ
Red Herrings โ Services with suspicious metrics but NOT the root cause
โ
Long-Horizon Planning โ 50-step episodes testing sustained reasoning ability
โ
Evidence-Based Rewards โ Investigation actions earn +0.10 to +0.18 per unique evidence type
โ
Sequence Bonuses โ Fixes with prior evidence get up to 1.0x multiplier (blind fixes: 0.0x)
โ
Redundancy Penalties โ Repeating actions escalates penalties (-0.08 โ -0.20)
โ
Efficiency Bonuses โ Faster solutions score higher (up to +0.30 for time saved)
โ
RCA Rewards โ Correct diagnosis: +0.50 base + bonuses, Wrong: -0.40 penalty
โ
Domain-Aware Dispatch โ Microservices, CI/CD, and Kafka reward functions
โ
Real-Time Playground โ Manual testing interface with live action/observation display
โ
Custom Model Benchmarking โ Load any HuggingFace model for real LLM inference evaluation
โ
Leaderboard Visualization โ Compare model performance across all tasks from benchmark.json
โ
About Page โ Full project documentation and architecture overview
โ
Premium Dark Theme โ Sleek UI with amber accents and smooth micro-interactions
โ
CPU-Safe Model Loading โ Detailed error diagnostics with graceful fallback
โ
Expert Agent โ Rule-based baseline achieving >0.80 on all tasks (training/expert_agent.py)
โ
SFT Data Generator โ Export expert trajectories as trajectories.jsonl for supervised fine-tuning
โ
Benchmark Runner โ Automated evaluation harness with persistent leaderboard (benchmark_runner.py)
โ
REST API โ OpenEnv-compliant FastAPI server with full endpoint coverage (server/app.py)
โ
LLM Judge โ Adversarial evaluation with phase-order enforcement (judge/llm_judge.py)
โ
Multi-Provider LLM Client โ OpenAI, Anthropic, Mock fallback with retry logic (judge/llm_client.py)
# Clone repository
git clone https://github.com/yourusername/incident-response-env
cd incident-response-env
# Install dependencies
pip install -e .
# Start the server (includes FastAPI + Gradio dashboard)
uvicorn server.app:app --host 0.0.0.0 --port 7860
Open the dashboard: http://localhost:7860/dashboard
docker build -t incident-response-env .
docker run -p 7860:7860 incident-response-env
Configure your LLM provider and run automated benchmark:
Bash:
export API_BASE_URL="https://api.openai.com/v1"
export API_KEY="sk-YOUR_OPENAI_KEY"
export MODEL_NAME="gpt-4o"
python inference.py
PowerShell:
$env:API_BASE_URL="https://api.openai.com/v1"
$env:API_KEY="sk-YOUR_OPENAI_KEY"
$env:MODEL_NAME="gpt-4o"
python inference.py
Supported providers: OpenAI, Anthropic (via LiteLLM), HuggingFace Inference, Together AI, Ollama (local)
All tasks test incident response skills with varying difficulty levels, from shallow (10 steps) to long-horizon planning (50 steps):
| Task ID | Difficulty | Max Steps | Root Cause | Challenge Type |
|---|---|---|---|---|
task_cpu_spike |
Easy | 10 | Auth service CPU hot loop | Basic investigation |
task_disk_full |
Easy | 12 | Postgres disk space exhaustion | Resource limits |
task_db_connection_leak |
Medium | 15 | Order-service connection pool leak | Connection management |
task_redis_memory_eviction |
Medium | 15 | Redis memory threshold cascade | Cache management |
task_api_rate_limit |
Medium | 12 | API gateway rate limit config | Gateway investigation |
task_deadlock_order_service |
Medium | 15 | Database deadlock in orders | Database locks |
task_ssl_cert_expired |
Hard | 18 | SSL certificate expiration | Certificate management |
task_slow_query_postgres |
Hard | 18 | Slow query blocking pool | Query optimization |
task_auth_service_500 |
Hard | 20 | Auth service internal errors | Error investigation |
task_k8s_pod_crashloop |
Hard | 20 | Kubernetes pod crash loop | Container orchestration |
task_memory_leak |
Hard | 20 | Service memory leak OOM | Memory profiling |
task_thread_starvation |
Hard | 20 | Thread pool starvation | Concurrency issues |
task_canary_poison |
Expert | 25 | Canary deployment config bug | Deployment strategies |
task_clock_skew |
Expert | 25 | System clock skew across services | Distributed systems |
task_expert |
Expert | 25 | Multi-fault: Redis + Auth | Multiple root causes |
task_expert_long_horizon |
Expert | 50 | Latent cascade at step 35+ | Long-horizon planning |
task_expert_long_horizon
Tests true long-horizon reasoning over 50 steps:
Why this matters: Reveals whether agents develop genuine SRE reasoning vs. pattern-matching quick fixes.
Agents have 7 distinct action types for investigation and remediation:
{"action_type": "read_logs", "target": "auth-service"}
{"action_type": "check_metrics", "target": "redis-cache"}
{"action_type": "check_health", "target": "order-service"}
{"action_type": "run_db_query", "target": "postgres-db"}
{"action_type": "restart_service", "target": "notification-service"}
{"action_type": "rollback_deployment", "target": "order-service"}
{"action_type": "declare_rca", "target": "redis-cache"}
api-gateway โ Always a victim, never the root cause (forces upstream tracing)auth-service โ Authentication and authorization serviceorder-service โ Core business logic servicenotification-service โ Async notification processingredis-cache โ In-memory caching layerpostgres-db โ Primary databaseEvery action returns a structured observation with:
| Field | Type | Description |
|---|---|---|
message |
string | Current observation text (logs, metrics, health status, query results) |
step |
int | Current step number in episode |
done |
bool | Episode finished flag |
alert |
string | Original incident alert description |
metrics |
object | Service metrics (CPU, memory, connections) if requested |
current_reward |
float | Reward for last action taken |
cumulative_reward |
float | Total accumulated reward |
The environment uses a domain-aware reward function (reward.py) with sophisticated evidence tracking:
| Action Type | Reward | Notes |
|---|---|---|
read_logs |
+0.10 to +0.18 | Higher reward for relevant service |
check_metrics |
+0.10 to +0.15 | CPU, memory, connection stats |
check_health |
+0.08 to +0.12 | Service status check |
run_db_query |
+0.12 to +0.18 | Database investigation |
| Action Type | Correct | Wrong |
|---|---|---|
restart_service |
+0.30 + bonuses | -0.30 |
rollback_deployment |
+0.30 + bonuses | -0.30 |
declare_rca |
+0.50 + bonuses | -0.40 |
Evidence Bonus (0 to +0.20):
Efficiency Bonus (0 to +0.30):
(max_steps - current_step) / max_steps ร 0.30Sequence Multiplier (0.0x to 1.0x):
| Timing | Penalty | Notes |
|---|---|---|
| Early episode (< 50% steps) | -0.08 | Gentle penalty for exploration |
| Late episode (โฅ 50% steps) | -0.20 | Harsh penalty for inefficiency |
Final scores are clamped to [0.001, 0.999] to prevent:
Fast Expert Solve (0.88):
Base RCA: +0.50
Evidence bonus: +0.20 (4 evidence types)
Efficiency bonus: +0.18 (solved in 4/10 steps)
Total: 0.88
Slower Correct Solve (0.72):
Base RCA: +0.50
Evidence bonus: +0.10 (2 evidence types)
Efficiency bonus: +0.06 (solved in 8/10 steps)
Investigation: +0.06 (from evidence gathering)
Total: 0.72
Wrong Diagnosis (-0.40):
Incorrect RCA: -0.40 (hard penalty for guessing)
The interactive dashboard provides:
# Dashboard automatically handles:
# 1. HuggingFace model loading (transformers pipeline)
# 2. Real LLM inference (no mock data)
# 3. CPU-safe execution with error diagnostics
# 4. Progress tracking across all 16 tasks
# 5. JSON results export
Supported models:
Example usage in dashboard:
meta-llama/Llama-2-7b-chat-hfbenchmark.json# Option 1: Via FastAPI server (recommended)
uvicorn server.app:app --host 0.0.0.0 --port 7860
# Dashboard available at: http://localhost:7860/dashboard
# Option 2: Standalone Gradio
python server/gradio_app.py
# Dashboard available at: http://localhost:7860
The FastAPI server (server/app.py) provides OpenEnv-compliant endpoints:
POST /reset
Start a new episode for a specific task.
Request:
{
"task_id": "task_expert"
}
Response:
{
"observation": "Alert: High error rate detected on API Gateway...",
"step": 0,
"done": false,
"alert": "High error rate detected...",
"current_reward": 0.0,
"cumulative_reward": 0.0
}
POST /step
Execute one action in the current episode.
Request:
{
"action_type": "read_logs",
"target": "auth-service"
}
Response:
{
"observation": "Auth service logs show JWT validation errors...",
"step": 1,
"done": false,
"current_reward": 0.15,
"cumulative_reward": 0.15,
"metrics": {
"cpu_percent": 85.3,
"memory_mb": 1024,
"connections": 150
}
}
GET /grade
Get final episode score.
Response:
{
"score": 0.88,
"task_id": "task_expert",
"solved": true
}
GET /state
Get ground truth state (debug only โ spoils the answer).
Response:
{
"root_cause_service": "redis-cache",
"secondary_faults": ["auth-service"],
"red_herrings": ["notification-service"],
"fault_type": "memory_eviction",
"cascade_step": 15
}
GET /tasks
List all available tasks.
Response:
{
"tasks": [
{
"id": "task_cpu_spike",
"difficulty": "easy",
"max_steps": 10,
"description": "Auth service CPU hot loop"
},
...
]
}
GET /health
Liveness check for monitoring.
Response:
{
"status": "healthy",
"version": "1.0.0"
}
# 1. Start episode
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "task_expert"}'
# 2. Investigate logs
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action_type": "read_logs", "target": "api-gateway"}'
# 3. Check metrics
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action_type": "check_metrics", "target": "redis-cache"}'
# 4. Declare RCA
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action_type": "declare_rca", "target": "redis-cache"}'
# 5. Get final score
curl http://localhost:7860/grade
# 1. Start episode
$body = @{task_id = "task_expert"} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:7860/reset" -Method POST -ContentType "application/json" -Body $body
# 2. Investigate logs
$body = @{action_type = "read_logs"; target = "api-gateway"} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:7860/step" -Method POST -ContentType "application/json" -Body $body
# 3. Check metrics
$body = @{action_type = "check_metrics"; target = "redis-cache"} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:7860/step" -Method POST -ContentType "application/json" -Body $body
# 4. Declare RCA
$body = @{action_type = "declare_rca"; target = "redis-cache"} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:7860/step" -Method POST -ContentType "application/json" -Body $body
# 5. Get final score
Invoke-RestMethod -Uri "http://localhost:7860/grade"
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gradio Dashboard (Dark Theme + Amber UI) โ
โ Manual Playground | Custom Benchmarking | Leaderboard โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Server (server/app.py) โ
โ /reset | /step | /grade | /state | /tasks | /health โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IncidentResponseEnv (environment.py) โ
โ State management | Task dispatch | Trajectory logging โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Reward System (reward.py - Domain-Aware) โ
โ โข EvidenceTracker: Multi-type evidence collection โ
โ โข Domain dispatch: Microservices | CI/CD | Kafka โ
โ โข Sequence bonuses | Redundancy penalties | RCA scoringโ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Supporting Components โ
โ โข models.py: Pydantic data models โ
โ โข task_config.py: Task registry โ
โ โข simulators/: CI/CD + Kafka state machines โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
incident-response-env/
โ
โโโ Core Environment
โ โโโ environment.py # Main Gym environment
โ โโโ models.py # Pydantic data models
โ โโโ reward.py # Domain-aware reward function
โ โโโ task_config.py # Task ID registry
โ
โโโ Server & UI
โ โโโ server/
โ โ โโโ app.py # FastAPI REST API
โ โ โโโ dashboard_impl.py # Gradio dashboard implementation
โ โ โโโ gradio_app.py # Standalone Gradio launcher
โ โโโ app.py # Gradio entry point wrapper
โ
โโโ Evaluation & Training
โ โโโ inference.py # LLM agent benchmark runner
โ โโโ benchmark_runner.py # Full benchmark orchestration
โ โโโ training/
โ โโโ expert_agent.py # Rule-based expert (>0.80 on all tasks)
โ โโโ generate_data.py # SFT trajectory generator
โ
โโโ LLM Infrastructure
โ โโโ judge/
โ โโโ llm_client.py # Multi-provider client (OpenAI/Anthropic/Mock)
โ โโโ llm_judge.py # Adversarial evaluation with phase enforcement
โ
โโโ Simulators (Future Expansion)
โ โโโ simulators/
โ โโโ cicd_simulator.py # CI/CD pipeline state machine
โ โโโ kafka_simulator.py # Kafka cluster state machine
โ
โโโ Tasks & Data
โ โโโ tasks/
โ โ โโโ cicd_tasks.json # CI/CD task definitions
โ โ โโโ kafka_tasks.json # Kafka task definitions
โ โโโ sft_data/
โ โโโ trajectories.jsonl # Generated training data
โ โโโ generation_stats.json
โ
โโโ Testing
โ โโโ test/ # Integration tests
โ โ โโโ test_api_tasks.py
โ โ โโโ test_full_episode.py
โ โ โโโ test_inference_tasks.py
โ โ โโโ verify_inference_tasks.py
โ โโโ tests/ # Unit tests (pytest)
โ โโโ conftest.py
โ โโโ test_environment.py
โ โโโ test_llm_client.py
โ โโโ test_llm_judge.py
โ โโโ test_reward.py
โ
โโโ Documentation
โ โโโ docs/
โ โโโ AGENT.md # Agent operating manual
โ โโโ BENCHMARK.md # Benchmarking guide
โ โโโ DESIGN.md # Design philosophy
โ โโโ ENVIRONMENT.md # Environment specification
โ โโโ REWARDS.md # Reward engineering
โ โโโ SKILLS.md # Agent capability taxonomy
โ
โโโ Configuration
โ โโโ Dockerfile # Production container
โ โโโ pyproject.toml # Python package config
โ โโโ requirements.txt # Dependencies
โ โโโ openenv.yaml # OpenEnv specification
โ โโโ start.sh # Docker startup script
โ
โโโ README.md # This file
judge/llm_judge.py)
Adversarial evaluation with phase-order enforcement:
Judge scoring criteria:
judge/llm_client.py)
Supports multiple LLM providers with unified interface:
| Provider | Configuration | Example |
|---|---|---|
| OpenAI | API_BASE_URL=https://api.openai.com/v1 |
gpt-4o, gpt-4-turbo |
| Anthropic | API_BASE_URL=https://api.anthropic.com/v1 |
claude-3-opus-20240229 |
| HuggingFace | API_BASE_URL=https://api-inference.huggingface.co/v1 |
meta-llama/Llama-2-70b |
| Together AI | API_BASE_URL=https://api.together.xyz/v1 |
mistralai/Mixtral-8x7B |
| Ollama | API_BASE_URL=http://localhost:11434/v1 |
Any local model |
| Mock | Automatic fallback if no API key | Deterministic responses |
Features:
| Level | Score Range | Behavior | Example |
|---|---|---|---|
| 0 โ Random Walker | 0.00โ0.15 | Repeats actions, never declares RCA | Random policy |
| 1 โ Symptom Chaser | 0.15โ0.40 | Exhaustively checks all services | Breadth-first search |
| 2 โ Structured Investigator | 0.40โ0.70 | Finds right service, wrong fix/timing | GPT-3.5 baseline |
| 3 โ Expert SRE | 0.70โ1.00 | Evidence โ Hypothesis โ Fix โ RCA | Expert agent, GPT-4o |
| Agent | Easy Tasks | Medium Tasks | Hard Tasks | Expert Tasks | Avg Score |
|---|---|---|---|---|---|
| Random | 0.12 | 0.08 | 0.05 | 0.03 | 0.07 |
| Expert (Rule-based) | 0.92 | 0.87 | 0.83 | 0.81 | 0.86 |
| GPT-4o | 0.88 | 0.75 | 0.62 | 0.54 | 0.70 |
| GPT-3.5-turbo | 0.65 | 0.48 | 0.32 | 0.21 | 0.42 |
Key insights:
training/expert_agent.py)
Rule-based agent that serves as strong baseline and SFT data source:
Strategy:
Performance: >0.80 on all 16 tasks
training/generate_data.py)
Exports expert trajectories in JSONL format for supervised fine-tuning:
python run_generate_data.py --num_episodes 100 --output sft_data/trajectories.jsonl
Output format:
{
"task_id": "task_expert",
"trajectory": [
{"step": 0, "action": {"action_type": "read_logs", "target": "api-gateway"}, "observation": "...", "reward": 0.15},
{"step": 1, "action": {"action_type": "check_metrics", "target": "redis-cache"}, "observation": "...", "reward": 0.12},
...
],
"total_reward": 0.88,
"final_score": 0.88,
"rca_correct": true
}
Use cases:
benchmark_runner.py)
Run comprehensive benchmarks across all tasks and models:
python benchmark_runner.py \
--model gpt-4o \
--episodes_per_task 5 \
--output benchmark.json
Output format (benchmark.json):
{
"leaderboard": [
{
"agent": "gpt-4o",
"scores": {
"task_cpu_spike": 0.92,
"task_expert": 0.54,
...
},
"average": 0.70,
"solved": 10,
"rank": 1
}
],
"timestamp": "2026-04-26T14:30:00Z"
}
Leaderboard ranking:
Task task_expert includes dual independent failures:
Secondary faults emerge mid-episode:
Deliberately misleading symptoms:
Purpose: Test agent's ability to distinguish correlation from causation
Agent sees only what it queries:
Dockerfile includes:
requirements.txtBuild and run:
docker build -t incident-response-env .
docker run -p 7860:7860 incident-response-env
| Variable | Description | Default |
|---|---|---|
API_BASE_URL |
LLM provider endpoint | https://api.openai.com/v1 |
API_KEY |
API key for LLM provider | Required |
MODEL_NAME |
Model identifier | gpt-4o |
DASHBOARD_PORT |
Gradio dashboard port | 7860 |
LOG_LEVEL |
Logging verbosity | INFO |
GitHub Actions example:
name: Benchmark Agent
on: [pull_request]
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install -e .
- env:
API_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL_NAME: gpt-4o
run: |
uvicorn server.app:app --host 0.0.0.0 --port 7860 &
sleep 5
python inference.py
- uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: benchmark.json
| Document | Description |
|---|---|
| AGENT.md | Complete agent operating manual with optimal strategies |
| BENCHMARK.md | Multi-model benchmarking guide and result interpretation |
| DESIGN.md | Design philosophy and architectural decisions |
| ENVIRONMENT.md | Full API reference and task definitions |
| REWARDS.md | Reward engineering philosophy and tuning guide |
| SKILLS.md | Agent capability taxonomy and prompt engineering |
We welcome contributions! Areas of interest:
See ENVIRONMENT.md for extension guide.
Who benefits from solving this benchmark?
Market context:
This environment implements the OpenEnv Specification v1.0:
โ
Standardized REST API (/reset, /step, /grade, /state, /tasks)
โ
Structured observations with done flag and reward signals
โ
Task registry with difficulty levels and descriptions
โ
Reproducible episodes with fixed random seeds
โ
Documented action/observation spaces
โ
OpenEnv manifest (openenv.yaml)
Manifest highlights:
environment:
name: "Incident Response Environment"
version: "1.0.0"
domain: "microservices_sre"
tasks:
count: 16
difficulty_levels: ["easy", "medium", "hard", "expert"]
action_space:
type: "discrete"
cardinality: 42 # 7 action types ร 6 services
observation_space:
type: "text"
partial_observability: true
Apache 2.0 โ Free for research, commercial use, and derivative works.
See LICENSE for full terms.
Built for the OpenEnv ร Scaler Hackathon 2026 with the goal of making AI agents reliable enough to be your on-call engineer.
Special thanks to:
๐จ Making AI Reliable Enough to Be Your On-Call Engineer ๐จ
๐ฎ Try Live Demo ยท ๐ Read the Docs ยท ๐ Report Bug ยท ๐ก Request Feature
โญ Star this repo if you find it useful!
An OpenEnv-compliant reinforcement learning benchmark where LLM agents must diagnose cascading microservices failures โ just like a real Site Reliability Engineer would.
โ Phase 1-5 Complete โ Full environment with RL training, multi-LLM support, and trajectory logging.
๐ฎ Live Demo ยท ๐ Environment Docs ยท ๐ Benchmark Guide ยท ๐ค Agent Guide ยท ๐ Reward Design
An OpenEnv-compliant RL environment where LLM agents act as on-call SREs, investigating simulated microservices failures to identify root causes under time pressure.
Every tech company running software in production has incidents. A database slows down, an API starts throwing 500 errors, users cannot log in. The on-call engineer must investigate noisy, incomplete signals and identify the root cause as fast as possible. This environment simulates that exact task.
Every major tech company loses an average of $300,000 per hour during production incidents. (Gartner, 2023 โ IT Downtime Cost Report)
When production goes down, an on-call SRE receives a pager alert at 3 AM. They have minutes โ not hours โ to investigate a cascade of noisy, incomplete signals across dozens of microservices, form a hypothesis, apply the right fix, and declare a root cause. Getting it wrong means extended downtime, lost revenue, and user churn.
This is not a solved problem. Current AI systems cannot reliably perform sequential diagnostic reasoning under:
incident-response-env is the first OpenEnv-compliant RL benchmark built around this exact challenge.
| Benchmark Type | What It Tests | Limitation |
|---|---|---|
| Static Q&A | Knowledge recall | No sequential decisions |
| Code generation | Single-turn output | No feedback loop |
| Tool-use benchmarks | Tool calling | No partial observability |
| incident-response-env | Sequential diagnosis under uncertainty | None โ this is real SRE work |
Unlike benchmarks where the agent sees everything at once, here the agent only knows what it queries. It must build a mental model of a broken system step by step โ exactly as a human engineer would.
trajectories.jsonl for supervised fine-tuningSee docs/ENVIRONMENT.md for simulator roadmap.
The agent has 7 distinct action types, each with a specific diagnostic or remediation purpose:
{"action_type": "read_logs", "target": "<service>"}
{"action_type": "check_metrics", "target": "<service>"}
{"action_type": "check_health", "target": "<service>"}
{"action_type": "run_db_query", "target": "postgres-db"}
{"action_type": "restart_service", "target": "<service>"}
{"action_type": "rollback_deployment", "target": "<service>"}
{"action_type": "declare_rca", "target": "<service>"}
Available services: api-gateway ยท auth-service ยท order-service ยท notification-service ยท redis-cache ยท postgres-db
Every action returns a rich observation:
| Field | Type | Description |
|---|---|---|
message |
string | Current observation text |
step |
int | Current step number |
done |
bool | Episode finished |
alert |
string | Original incident alert |
metrics |
object | Service metrics (if requested) |
16 carefully crafted incident scenarios of increasing difficulty, from shallow (10 steps) to long-horizon planning (50 steps):
| Task | Difficulty | Max Steps | Description |
|---|---|---|---|
task_cpu_spike |
Easy | 10 | Auth service CPU hot loop |
task_disk_full |
Easy | 12 | Disk space exhaustion on postgres |
task_db_connection_leak |
Medium | 15 | Order-service connection pool exhaustion |
task_redis_memory_eviction |
Medium | 15 | Redis memory threshold eviction cascade |
task_api_rate_limit |
Medium | 12 | API gateway rate limiter misconfiguration |
task_deadlock_order_service |
Medium | 15 | Database deadlock in order-service |
task_ssl_cert_expired |
Hard | 18 | SSL certificate expiration cascade |
task_slow_query_postgres |
Hard | 18 | Slow query blocking connection pool |
task_auth_service_500 |
Hard | 20 | Auth service internal server errors |
task_k8s_pod_crashloop |
Hard | 20 | Kubernetes pod crash loop |
task_memory_leak |
Hard | 20 | Service memory leak causing OOM |
task_thread_starvation |
Hard | 20 | Thread pool starvation in microservice |
task_canary_poison |
Expert | 25 | Canary deployment strips auth headers |
task_clock_skew |
Expert | 25 | System clock skew across services |
task_expert |
Expert | 25 | Multi-root-cause: Redis + Auth failures |
task_expert_long_horizon |
Expert | 50 | Long-horizon cascade: Latent secondary fault at step 35+ |
task_expert_long_horizon
Addresses Hackathon Theme #2: Long-Horizon Planning
This 50-step task forces agents beyond shallow next-token reasoning:
Why this matters: Tests whether agent can maintain context, plan ahead, and avoid optimization traps. A 50-step episode reveals whether the agent develops genuine SRE reasoning vs. pattern-matching lucky guesses.
"Order service started failing after the 14:30 deployment. Auth service appears degraded."
A bad deployment on order-service cascades to make auth-service appear broken โ a deliberate red herring. Logs show missing environment variables. The correct fix is rollback.
Tests: Red herring resistance, multi-service correlation.
The agent investigates a 6-service production stack comprising an api-gateway (always a victim), auth-service, order-service, notification-service, redis-cache, and postgres-db.
Key design principle: The gateway is always a victim, never the root cause. This forces agents to trace causality upstream.
+0.05 to +0.12 โ relevant evidence foundโ0.08 โ redundant action (early, before 50% steps)โ0.20 โ redundant action (late, after 50% steps)+0.30 โ correct intervention (restart/rollback)โ0.30 โ wrong service restarted/rolled back+0.50 + evidence bonus + efficiency bonus โ correct RCA declaredโ0.40 โ wrong RCA declared[0.001, 0.999]| Model | task_easy | task_medium | task_hard | Avg Score | Solved |
|---|---|---|---|---|---|
| Random agent | ~0.15 | ~0.08 | ~0.04 | ~0.09 | 0/3 |
| Qwen2.5-72B | ~0.75 | ~0.60 | ~0.45 | ~0.60 | 2/3 |
| Human expert | ~0.95 | ~0.90 | ~0.85 | ~0.90 | 3/3 |
The human-AI gap on task_hard is 0.40 points. Closing it requires genuine sequential reasoning, not pattern matching.
The benchmark cleanly separates agents into four capability tiers:
| Level | Score | Behavior |
|---|---|---|
| 0 โ Random Walker | 0.00โ0.15 | Repeats same action, never declares RCA |
| 1 โ Symptom Chaser | 0.15โ0.40 | Reads gateway logs, then diffuses across all services exhaustively |
| 2 โ Structured Investigator | 0.40โ0.70 | Finds right service, applies wrong fix type or declares too late |
| 3 โ Expert SRE | 0.70โ1.00 | 3-step hypothesis, corroborating evidence, correct fix, time bonus |
The gap between Level 2 and Level 3 is red herring resistance โ the most discriminative signal in this benchmark.
The environment ships with inference.py, a reference baseline agent that uses chain-of-thought prompting.
The baseline works with any OpenAI-compatible endpoint. OpenAI (GPT-4o) is the recommended baseline.
Bash:
export API_BASE_URL="https://api.openai.com/v1"
export API_KEY="sk_YOUR_OPENAI_KEY"
export MODEL_NAME="gpt-4o"
python inference.py
PowerShell:
$env:API_BASE_URL="https://api.openai.com/v1"
$env:API_KEY="sk_YOUR_OPENAI_KEY"
$env:MODEL_NAME="gpt-4o"
python inference.py
To use other providers, change the API_BASE_URL, API_KEY, and MODEL_NAME accordingly.
| Provider | Endpoint | Model Example | Setup |
|---|---|---|---|
| OpenAI โญ | https://api.openai.com/v1 |
gpt-4o, gpt-4-turbo |
Get API key |
| Anthropic (Claude) | Proxy via LiteLLM | claude-3-opus |
Install LiteLLM |
| HuggingFace Inference | https://api-inference.huggingface.co/v1 |
meta-llama/Llama-2-70b |
Get token |
| Together AI | https://api.together.xyz/v1 |
mistralai/Mixtral-8x7B |
Get API key |
| Ollama (local) | http://localhost:11434/v1 |
Any local model | Install Ollama |
Each task returns a score in [0.001, 0.999]. Higher is better. For correct RCA declarations, the final score is computed as:
Breaking it down:
| Component | Impact | Notes |
|---|---|---|
| Base RCA Reward | +0.50 | Awarded for declaring correct RCA |
| Evidence Bonus | 0 to +0.20 | +0.05 per unique evidence type gathered (logs, metrics, health, queries); max 0.20 |
| Efficiency Bonus | 0 to +0.30 | Reward for fast diagnosis: (max_steps - step_count) / max_steps ร 0.30 |
| Redundancy Penalty | โ0.08 or โ0.20 | Early repeats (before 50% steps): โ0.08; Late repeats: โ0.20 |
| Wrong Interventions | โ0.30 | Penalty for restarting/rolling back the wrong service |
| Wrong RCA | โ0.40 | Penalty for declaring incorrect root cause |
Examples:
Fast, thorough solve (0.88): Gather 4 evidence types, declare correct RCA at step 4 of 10
Slower correct solve (0.72): Gather 2 evidence types, declare correct RCA at step 8 of 10
Wrong diagnosis (โ0.40): Declare incorrect RCA service
Wrong intervention then correct RCA (0.35): Restart wrong service (โ0.30), then declare correct RCA
The leaderboard ranks agents by average score across all three tasks:
{
"agent": "Qwen2.5-72B-Instruct",
"scores": {
"task_easy": 0.92,
"task_medium": 0.68,
"task_hard": 0.41
},
"average": 0.67,
"solved": 2, // tasks with score >= 0.70
"rank": 5
}
Performance tiers:
task_medium (wrong fix bonus, severe penalty)Embed the benchmark in GitHub Actions to test your agents automatically on every PR.
# .github/workflows/benchmark.yml
name: Benchmark Agent
on: [pull_request]
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with: { python-version: '3.11' }
- run: pip install -e .
- env:
API_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL_NAME: gpt-4o
run: |
uvicorn server.app:app --host 0.0.0.0 --port 7860 &
sleep 3
python inference.py > benchmark.json
Clone the repository and start the FastAPI + Gradio server:
Bash/PowerShell:
git clone https://github.com/Praneeth0910/incident-response-env
cd incident-response-env
pip install -e .
uvicorn server.app:app --host 0.0.0.0 --port 7860
Open http://localhost:7860/dashboard to play manually.
docker-compose up --build
See docker-compose.yml for port mappings.
Configure your environment variables and run inference.py.
Unix / Bash:
export API_BASE_URL="https://api.openai.com/v1"
export API_KEY="sk_YOUR_OPENAI_KEY"
export MODEL_NAME="gpt-4o"
python inference.py
Windows / PowerShell:
$env:API_BASE_URL="https://api.openai.com/v1"
$env:API_KEY="sk_YOUR_OPENAI_KEY"
$env:MODEL_NAME="gpt-4o"
python inference.py
Send REST commands directly to evaluate custom agents without inference.py:
# Start an episode
curl -X POST http://localhost:7860/reset -H "Content-Type: application/json" -d '{"task_id": "task_easy"}'
# Take step
curl -X POST http://localhost:7860/step -H "Content-Type: application/json" -d '{"action_type": "read_logs", "target": "api-gateway"}'
# Get score
curl http://localhost:7860/grade
The environment is built with a modular domain-aware architecture supporting multiple incident types:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User Interface (Gradio Dashboard) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Server (port 7860) โ
โ /reset, /step, /grade, /tasks, /state, /health โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IncidentResponseEnv (State Machine) โ
โ Management, task dispatch, trajectory logging โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Reward System (Phase 4 โ Domain-Aware) โ
โ โข Reward.py: Domain-dispatched reward functions โ
โ โข EvidenceTracker: Multi-type evidence collection โ
โ โข Support for: CI/CD, Kafka, Microservices โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Simulators (Phase 1-2 Extensions โ Experimental) โ
โ โข cicd_simulator.py: GitHub Actions/GitLab CI โ
โ โข kafka_simulator.py: Apache Kafka state machine โ
โ โข Status: Integrated into reward.py, optional in env โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Current (Phase 1-5): Microservices incidents only.
Phase 1-2 simulators available via reward.py routing (see docs/ for roadmap).
incident-response-env/
โโโ environment.py # Core RL environment (primary)
โโโ models.py # Pydantic data models
โโโ reward.py # Domain-aware reward functions
โโโ task_config.py # Task ID registry
โโโ inference.py # Benchmark inference script
โโโ benchmark_runner.py # Full benchmark orchestration
โโโ app.py # Gradio entry point
โโโ start.sh # Docker startup script
โ
โโโ server/
โ โโโ app.py # FastAPI application + REST endpoints
โ โโโ dashboard_impl.py # Gradio terminal dashboard
โ โโโ gradio_app.py # Standalone Gradio launcher
โ
โโโ judge/
โ โโโ llm_client.py # LLM client (OpenAI / Anthropic / mock)
โ โโโ llm_judge.py # Adversarial phase-aware judge
โ
โโโ simulators/
โ โโโ cicd_simulator.py # CI/CD pipeline state machine
โ โโโ kafka_simulator.py # Kafka cluster state machine
โ
โโโ training/
โ โโโ expert_agent.py # Rule-based expert for SFT data generation
โ โโโ generate_data.py # SFT dataset generator
โ
โโโ tasks/
โ โโโ cicd_tasks.json # CI/CD task definitions
โ โโโ kafka_tasks.json # Kafka task definitions
โ
โโโ docs/
โ โโโ AGENT.md # Full agent operating manual
โ โโโ ENVIRONMENT.md # Complete environment specification
โ โโโ BENCHMARK.md # Multi-model benchmarking guide
โ โโโ REWARDS.md # Reward engineering deep dive
โ โโโ SKILLS.md # Agent capability taxonomy + prompt engineering
โ โโโ blog.md # Technical blog โ SRE AI innovation story
โ
โโโ sft_data/ # Generated training trajectories
โโโ test/ # Integration tests
โโโ tests/ # Unit tests (pytest)
โโโ Dockerfile # Production container
โโโ openenv.yaml # OpenEnv specification manifest
โโโ README.md # This file
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Liveness check |
/reset |
POST | Start a new episode ({"task_id": "task_easy"}) |
/step |
POST | Execute one action |
/grade |
GET | Get final episode score [0.0, 1.0] |
/state |
GET | Ground truth state (debug only โ spoils the answer) |
/tasks |
GET | List all available tasks |
Example session (Bash):
# Start episode
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "task_hard"}'
# Take action
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action_type": "read_logs", "target": "redis-cache"}'
# Get score
curl http://localhost:7860/grade
Example session (PowerShell):
# Start episode
$body = @{task_id = "task_hard"} | ConvertTo-Json
Invoke-WebRequest -Uri "http://localhost:7860/reset" -Method POST -ContentType "application/json" -Body $body
# Take action
$body = @{action_type = "read_logs"; target = "redis-cache"} | ConvertTo-Json
Invoke-WebRequest -Uri "http://localhost:7860/step" -Method POST -ContentType "application/json" -Body $body
# Get score
Invoke-WebRequest http://localhost:7860/grade
Who benefits from solving this benchmark?
The global Site Reliability Engineering market is valued at $8.7 billion (2024) and growing at 15% CAGR. Every percentage point improvement in automated incident resolution translates directly to engineering hours saved and service reliability improved.
| Document | Description |
|---|---|
| AGENT.md | Complete agent operating manual โ optimal strategies, anti-patterns, example episodes |
| ENVIRONMENT.md | Full API reference, task definitions, extending the environment |
| BENCHMARK.md | Multi-model benchmarking, supported endpoints, result interpretation |
| REWARDS.md | Reward engineering philosophy, tuning guide, RL training tips |
| SKILLS.md | Agent skill taxonomy, prompt engineering recommendations |
Want to add new fault types, tasks, or services? See ENVIRONMENT.md for the extension guide.
Pull requests welcome for:
Apache 2.0 โ free for research, commercial use, and derivative works.
Built for the OpenEnv ร Scaler Hackathon 2026
Making AI reliable enough to be your on-call engineer.