A reinforcement learning environment simulating real-world IT incident management. An AI agent acts as an on-call Site Reliability Engineer (SRE), triaging alerts, diagnosing root causes, applying fixes, and writing post-mortems across four tasks of increasing difficulty.
Environment Description
Production systems fail. Alerts fire. Your agent decides what to do.
At every step the agent receives the current state — a list of active incidents, each with a service, severity, status, age, and logs — and takes one action on one incident. The episode ends when all incidents are handled or the step budget runs out.
Task 1 — Single Alert Triage (Easy)
One incident, 5 steps. Investigate to confirm it is real, then resolve or escalate.
Task 2 — Multi-Service Queue (Medium)
Four incidents of mixed severity across different services. 15 steps. Score is weighted by severity — critical incidents matter most. One incident may be a false alarm.
Task 3 — Cascading Failure Response (Hard)
Three initial incidents on interdependent services. 14 steps. Unhandled critical/high incidents age each step and trigger cascade incidents on downstream services after 2 steps. Use mitigate to buy time without fully resolving.
Task 4 — Full Incident Lifecycle (Very Hard)
Multiple incidents requiring the full SRE workflow per incident. 20 steps. Each incident must go through: triage → investigate → execute_fix → write_postmortem → resolve. Skipping steps is penalised.
1docker build -t incident-env .2docker run -p 8000:8000 incident-env
Running the Inference Script
bash
1exportHF_TOKEN=your_token
2exportENV_BASE_URL=http://localhost:8000 # or your HF Space URL3exportMODEL_NAME=Qwen/Qwen2.5-72B-Instruct
4python inference.py
Runs an LLM agent across all 4 tasks and emits structured [START] / [STEP] / [END] logs.
Run the greedy baseline agent:
python run_baseline.py
Smoke-test the environment:
python test_env.py
Project Structure
api/
main.py FastAPI app, route definitions, session management
env/
environment.py IncidentEnv class (reset / step / get_state)
generator.py Task-specific incident generation
graders.py Shared grader logic (triage, RCA, remediation, postmortem)
rewards.py Shaped reward function
constants.py SLA deadlines, escalation thresholds, severity configs
incident_templates.py Real-world incident scenarios with logs and metrics
tasks/
task1.py Easy task config + grader
task2.py Medium task config + grader
task3.py Hard task config + grader + cascade dependencies
task4.py Very hard task config + grader (full lifecycle)
models/
incident.py Incident model
state.py State model
action.py Action model
task_config.py TaskConfig model
ui/
index.html Dashboard UI
script.js Client-side logic
styles.css Styles
client.py HTTP client for agents (session-aware)
inference.py LLM inference script (OpenAI API client)
run_baseline.py Greedy baseline agent
test_env.py Smoke tests for all 4 tasks
openenv.yaml OpenEnv environment manifest
requirements.txt Python dependencies
Dockerfile Container configuration
README.md This file