tnshgarg/SentinelOps
<div align="center">
๐ก๏ธ SentinelOps
Interactive Incident Response Control Room โ OpenEnv Environment
A multi-step agentic reinforcement-learning environment where AI agents monitor surveillance camera feeds, detect anomalies, track suspects across cameras, classify threats, and escalate incidents.
    
</div>
๐ฏ Overview
SentinelOps simulates a real-world AI security analyst operating a multi-camera surveillance control room. Unlike static VQA benchmarks, SentinelOps creates multi-step agentic episodes where decisions have sequential consequences and rewards are accumulated across trajectories.
Real-World Applications
๐๏ธ Architecture
Alert Trigger โ Observation State โ Agent Action โ Environment Transition โ Reward โ Next StateEpisode Flow (5โ10 steps)
- Anomaly alert arrives on a camera feed
- Agent inspects the current frame
- Agent navigates temporal history (previous/next frames)
- Agent switches cameras to track subjects
- Agent classifies threat severity
- Agent escalates or dismisses the alert
Design Patterns
๐ Project Structure
sentinelops/
โโโ inference.py # Root-level inference script (submission entry point)
โโโ env.py # Core environment engine (reset/step/state)
โโโ grader.py # Deterministic rubric-based graders
โโโ models.py # Pydantic data models
โโโ config.py # Centralised configuration
โโโ openenv.yaml # OpenEnv manifest
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Production Docker image
โโโ validate-submission.sh # Pre-submission validation
โโโ .env.example # Environment variable template
โ
โโโ server/
โ โโโ app.py # FastAPI HTTP server
โ
โโโ tasks/
โ โโโ easy/ # Single-camera anomaly detection
โ โโโ medium/ # Multi-frame temporal reasoning
โ โโโ hard/ # Multi-camera coordinated incidents
โ
โโโ assets/
โ โโโ frames/ # CCTV surveillance frame images
โ โโโ sequences/ # Multi-frame sequences
โ
โโโ tests/
โโโ test_env.py # Environment unit tests
โโโ test_grader.py # Grader unit tests
โโโ test_api.py # API integration tests๐ฎ Action Space
๐ Reward Engineering
Rewards are accumulated across the trajectory (delayed reward), making this significantly stronger than one-shot scoring.
๐ Task Difficulty Ladder
๐ข Easy โ Single Camera Anomaly
- Detect suspicious objects
- Identify count mismatches
- 2 tasks, 3โ8 steps
๐ก Medium โ Multi-Frame Progression
- Identify when events begin (temporal reasoning)
- Classify movement patterns
- 2 tasks, 5โ10 steps
๐ด Hard โ Multi-Camera Coordinated Incidents
- Switch between camera feeds
- Track subject paths across areas
- Predict threat escalation
- Decide emergency response
- 2 tasks, 7โ15 steps
๐ Quick Start
Prerequisites
- Python 3.11+
- Docker (for deployment)
- Hugging Face API token
Installation
# Clone the repository
git clone <repo-url>
cd sentinelops
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtRunning the Server
# Start the environment server
uvicorn server.app:app --host 0.0.0.0 --port 7860 --reloadRunning Inference
# Set environment variables
export API_BASE_URL=https://router.huggingface.co/v1
export MODEL_NAME=meta-llama/Llama-3.1-8B-Instruct:cheapest
export HF_TOKEN=hf_your_token_here
export ENV_URL=http://localhost:7860
# Run inference
python inference.pyRunning Tests
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ -v --tb=shortDocker
# Build
docker build -t sentinelops .
# Run
docker run -p 7860:7860 sentinelops
# Validate
./validate-submission.sh http://localhost:7860๐ API Endpoints
Example: Reset
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "easy-001-parking-intrusion"}'Example: Step
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action_type": "inspect_current_frame"}'๐ Grading
Scoring is fully deterministic โ no LLM-as-judge. Each difficulty tier has its own rubric:
Easy Rubric (max 1.0)
- Frame inspection: 0.15
- Anomaly detection: 0.25
- Risk classification: 0.30
- Escalation decision: 0.30
Medium Rubric (max 1.0)
- Frame inspection: 0.10
- Temporal navigation: 0.20
- Anomaly onset identification: 0.20
- Risk classification: 0.25
- Escalation decision: 0.25
Hard Rubric (max 1.0)
- Camera coverage: 0.15
- Target camera identification: 0.15
- Cross-camera temporal reasoning: 0.15
- Anomaly frame inspection: 0.10
- False-positive avoidance: 0.10
- Risk classification: 0.15
- Escalation decision: 0.20
๐ Structured Log Format
The inference script emits mandatory structured logs to stdout per hackathon spec:
[START] {"task_id": "easy-001-parking-intrusion", "difficulty": "easy", "title": "Parking Lot Vehicle Break-In"}
[STEP] {"step": 1, "action": "inspect_current_frame", "payload": null, "reward": 0.15, "cumulative_reward": 0.15, "done": false}
[STEP] {"step": 2, "action": "request_next_frame", "payload": null, "reward": 0.2, "cumulative_reward": 0.35, "done": false}
[STEP] {"step": 3, "action": "classify_risk", "payload": "dangerous", "reward": 0.15, "cumulative_reward": 0.5, "done": false}
[STEP] {"step": 4, "action": "escalate_incident", "payload": null, "reward": 0.3, "cumulative_reward": 0.8, "done": true}
[END] {"task_id": "easy-001-parking-intrusion", "score": 1.0, "steps": 4, "status": "success"}The evaluator parses these lines to verify scores. flush=True ensures immediate output with no buffering.
โ Quality Gate Checklist
- [x]
openenv validatepasses - [x]
docker buildsucceeds - [x]
docker runstarts correctly - [x] HF Space
/resetreturns HTTP 200 - [x]
[START]/[STEP]/[END]structured stdout logs emitted - [x]
MODEL_NAMEenv var used as primary inference model - [x]
API_BASE_URL+HF_TOKENwired through OpenAI client - [x] Inference completes under 20 minutes (โค 1s sleep per step)
- [x] Runs on vcpu=2, memory=8GB (lightweight FastAPI + HTTP calls only)
- [x] Reproducible score variance < 2%
- [x] 65/65 unit tests pass
- [x] No placeholder functions or TODOs
- [x] All endpoints runnable
- [x] Deterministic grading (no LLM-as-judge)
- [x] Perfect score (1.0) achievable on all 6 tasks
๐ License
This project is licensed under the MIT License.
<div align="center">
Built for the Meta ร Scaler OpenEnv Hackathon by Team Adaptrix
SentinelOps โ Where AI meets real-world security surveillance
</div>
