--- title: "\"" ![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/5dhclqi9xa3118hltwu3.jpeg)" published: false description: "\"How Project Sentinel pairs deterministic detection and po" ![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/1hx2gzrg3dczzifirp92.jpeg)licy with specialized AI agents, human approval, and real verification probes to make incident response faster without making it reckless." tags: ai, devops, observability, opensource --- When a production system degrades at 3 a.m., the hard part is rarely the fix. It is working out what is actually wrong. Engineers move between dashboards, search logs, follow traces across services, and try to recall whether something similar happened last month. Under pressure, scattered evidence turns into guesswork. Large language models look like an obvious answer. But an unconstrained LLM in an operations loop introduces its own failure modes: it can invent telemetry that does not exist, name a root cause it has no evidence for, or trigger a remediation nobody approved. In operations, a fluent wrong answer is worse than no answer. [**Project Sentinel**](https://github.com/naraenks2007-lgtm/sentinel) is an open-source platform built around one design rule: **use AI for reasoning over evidence, and keep everything that must be trustworthy deterministic.** This article walks through how it is put together and why each boundary exists. ## The architecture in one paragraph  Monitoring detects anomalies deterministically. Specialized AI agents investigate the evidence across metrics, logs, traces, service dependencies, and persistent memory of past incidents. Deterministic backend policy enforces human-in-the-loop approval and an allowlist of recovery actions. Real verification probes confirm whether recovery actually succeeded before an incident is marked resolved. Each of those four stages guards against a specific way that AI in operations goes wrong: | Stage | Who decides | Failure it prevents | | --- | --- | --- | | Detection | Backend calculations | The model "noticing" problems that are not there | | Investigation | AI agents, schema-validated | Overconfident diagnosis without evidence | | Remediation | Policy, allowlist, human approval | Unsafe or improvised actions | | Verification | Real health and telemetry probes | Declaring success because a command returned 0 | ## Detection you can audit  Sentinel's anomaly detection is computed by the backend from real data: error rates, latency deviation percentages, moving averages, rate of change, and threshold breaches. An optional Isolation Forest model can be enabled once at least 20 data points are available, and it is explicitly labelled as non-probabilistic so its output is never mistaken for a calibrated likelihood. The operational dashboard follows the same philosophy. It shows live health, service availability, firing alerts, and Prometheus-based KPIs and charts. When there is no data, it shows an empty state rather than fabricated telemetry. Everything downstream depends on a monitoring layer that never pretends to know more than it does. The observability stack underneath is standard and open source: - **Prometheus** for metrics - **Loki and Promtail** for logs - **OpenTelemetry Collector and Grafana Tempo** for traces - **Grafana** for dashboards ## Dependency mapping and backtracking  In a distributed system, the service that is alerting is often not the service that is broken. Sentinel models service dependencies and traverses them in both directions, examining upstream callers and downstream dependencies. In the demo environment, the chain looks like this: 


text
demo-frontend -> toxiproxy-gateway -> demo-api -> demo-postgres / demo-worker

 The traversal is grounded in real timestamps, alerts, and trace spans. A latency spike at the frontend can be followed back to the database or worker where it began, instead of being blamed on whichever component paged first. ## Seven agents, one investigation Rather than a single all-purpose prompt, Sentinel divides the investigation among seven specialized agents: | Agent | Responsibility | | --- | --- | | Metrics Analyst | Quantitative signals and deviations | | Log Investigator | Error patterns and timelines in logs | | Trace & Dependency Investigator | Request paths across services | | Historical Memory Analyst | Similar past incidents and what resolved them | | Root Cause Coordinator | Weighs findings and proposes a conclusion | | Remediation Planner | Suggests actions from the approved catalog | | Verification Analyst | Judges whether recovery truly worked | Two design choices make this trustworthy in practice. **Structured outputs.** Each agent's output is validated against Pydantic schemas, so downstream components receive predictable data rather than free-form prose. **Abstention by default.** When evidence is missing, the system does not guess. It answers with a fixed statement: *"Insufficient evidence to determine the root cause."* Making honesty the default behavior does more for trust than any amount of prompt tuning. ## Persistent memory and a resilient LLM gateway Incidents repeat. Sentinel uses the Hindsight API as persistent contextual memory so agents can recall earlier investigations, with a PostgreSQL fallback if the memory service is unavailable. Secrets are scrubbed before anything is stored. For model access, an LLM gateway routes requests to Groq as the primary provider, with automatic fallback to OpenRouter. Local Ollama models are deliberately excluded. A tool meant to help during outages should not stop working because a single provider has one. ## Controlled self-healing "Self-healing" is the part of AIOps that makes careful engineers nervous, and rightly so. Sentinel treats it as a controlled capability, not an autonomous one: - **Allowlisted action catalog.** Only pre-approved recovery actions can ever execute. The model cannot improvise a command. - **RBAC and human approval gates.** Role-based access control and explicit approval keep a person in the loop. - **Target validation.** Actions are checked against their intended target before running. - **Audit logs.** Every step is recorded for later review. - **Emergency stop.** Operators can halt automated recovery immediately. The AI proposes; deterministic policy disposes. A hallucinated recommendation can, at worst, be rejected. It can never be executed. ## Verification that does not take the model's word for it Most remediation tooling stops at "the restart command succeeded." Sentinel goes further. After an action, it runs real health and telemetry verification to confirm the service is genuinely back, and only then marks the incident resolved. A Verification Analyst agent interprets the results, but the evidence itself comes from probes, not from the model's opinion. ## A fault injection lab for safe experimentation To demonstrate and test the full loop, Sentinel ships with a Fault Injection Lab: an isolated Demo API, Demo Worker, Demo PostgreSQL, Toxiproxy for network faults, and k6 scenarios. Everything it produces is explicitly tagged as `simulated`, so synthetic failures can never be confused with real production incidents. You can exercise the whole pipeline end to end: inject a fault, watch detection fire, review the investigation, approve a recovery action, and see verification confirm the result. ## Professional incident reports Each incident can be turned into a 20-section report, exported as Markdown and PDF. That gives teams a consistent artifact for postmortems, handovers, and compliance, without anyone assembling it by hand after a long night. ## Getting started The stack runs with Docker Compose. Copy the example environment file, set your secret key and provider API keys (Groq, OpenRouter, and Hindsight), then bring everything up: 


bash
cp .env.example .env

edit .env: SECRET_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, HINDSIGHT_API_KEY

docker compose up --build -d

 The UI is then available at `http://localhost:5173`. The repository also includes documentation for setup, architecture, the API, security, and evaluation, along with a guided demo script. ## Why these boundaries matter The interesting thing about Sentinel is less any single feature than where it draws its lines: 1. Detection is deterministic, so the system cannot hallucinate a problem. 2. Agents must show evidence or abstain, so it cannot hallucinate a cause. 3. Actions come from an allowlist and require approval, so it cannot hallucinate a fix into production. 4. Recovery is confirmed by measurement, so it cannot hallucinate success. As teams look to bring AI into on-call workflows, this is a pattern worth borrowing. The goal is not to remove engineers from incident response. It is to give them an investigation that is faster, better documented, and honest about its own limits. ## Try it and contribute Project Sentinel is open source. Explore the code, run the demo, and share feedback or ideas on GitHub: **[github.com/naraenks2007-lgtm/sentinel](https://github.com/naraenks2007-lgtm/sentinel)** If you are building AI-assisted operations tooling, I would like to hear how you decide what the model may do and what it may not. Share your approach in the comments. [Watch the Tutorial on YouTube](https://youtu.be/Sx4tZlEKaUw?si=kwPwTrhbD2j2rBbN)