Registry Mirror
Skip to content

Repository files navigation

HauntOps

When production breaks, HauntOps hunts down the ghost, and shows you every footprint it followed.

Try it · Features · Screenshots · How it works · Use your own system · Kiroween write-up

License: MIT Self-hosted No API key needed Built with Kiro


HauntOps is an open-source, self-hosted incident investigator. An alert from your monitoring tool opens an incident automatically, or you open one by hand. One click starts the investigation. HauntOps then reads your logs, maps stack traces to source code, finds the commits that touched that code, runs your own tests before and after the suspect commit, and ranks the competing explanations.

Every claim in the result links to a stored piece of evidence. When evidence is missing, the report says so. HauntOps never touches production, and it sends nothing to Jira or Slack until a person approves the exact text.

Root cause analysis: ranked hypotheses, each with its investigative score worked out from the evidence behind it
Ranked hypotheses. The score is arithmetic over evidence you can open, not a confidence percentage.

Features

Investigation

  • One-click investigation. It reads your logs, maps stack frames to source code and to the commits that changed them, runs your tests before and after the suspect commit, and writes a report. You can also let it start by itself (see Incidents below).
  • A live timeline. Each stage appears in the UI as soon as it is stored. The timeline recovers from stored history if the connection drops, and you can cancel a running investigation.
  • Competing hypotheses, each one challenged. A critic stage tests every explanation. The investigative score is arithmetic over evidence you can open, never presented as a probability.
  • Your own tests in a sandbox. dotnet test or pytest runs at the suspect commit and at its parent, in a locked-down container with no internet and no credentials.
  • Evidence for every claim. The report cites stored evidence (E1, E2, …) and lists what is still unknown. You can download it as Markdown or open a printable postmortem to print or save as PDF.
  • Verdicts on hypotheses. People mark which hypothesis was the real cause. The Overview tracks the investigator's accuracy: how often the cause was ranked first or in the top three.
  • Works with no model. Only triage uses a model, and the other stages are deterministic. The offline demo replays recorded runs.

Incidents

  • Many ways in. Open incidents by hand, from HMAC-signed webhooks, or from Alertmanager and Grafana receivers. Optional detection opens them from bursts of errors in stored logs. Repeated alert deliveries are de-duplicated, and a resolved alert resolves its incident.
  • Auto-investigate. Optional per project, off by default: every new incident starts an investigation within about 15 seconds.
  • Teamwork. Incidents have assignees, comments, severity and status. Every incident keeps a history of who reported, edited, assigned, resolved or reopened it, and when, along with every investigation it had.
  • Find things fast. Filter incidents by project, service, status, severity, source, assignee and creation date. Full-text search covers incidents and evidence.
  • Overview dashboard. Widgets you can show or hide: needs attention, incident activity, unresolved by severity and by project, recent and recently resolved incidents, agent activity, and investigator accuracy.

Actions and integrations

  • A person approves every outside action. Jira issues and Slack messages show the exact text before approval. Failures are recorded honestly, and an owner can try again with the same content.
  • Pick your model provider. Choose it in Settings: OpenAI, Anthropic, Azure OpenAI, Google Gemini, OpenRouter, Ollama, or any OpenAI-compatible server. Saving tests it, and the next investigation uses it without a restart.
  • GitHub. Public repositories need no token; private ones need a read-only token. A discovery step finds the languages, frameworks and test tools, and shows the file behind each finding.
  • Log ingestion. Send structured JSON or OpenTelemetry OTLP/HTTP, gzip, deflate or Brotli compressed. Secrets are redacted before storage, and old logs are deleted after a retention period you set.

Security and operations

  • Logs stay data. Log text is treated as untrusted. Prompt injection inside a log stays evidence and never becomes an instruction to the model.
  • Project isolation and roles. Every read and write is checked against project membership. Projects have owners and members, and administrators manage the installation.
  • Account protection. Accounts lock after repeated failed sign-ins. Users can sign out everywhere, and administrators can disable accounts or force a password change.
  • Encrypted credentials. Credentials are encrypted with AES-256-GCM and only their last four characters are ever shown. The encryption key can be rotated.
  • Hardening and audit. A content security policy, cross-site request checks, rate limits and containers with dropped capabilities. An append-only audit trail and a system status page are available to administrators.
  • Self-hosted and simple. Docker Compose with PostgreSQL as the only infrastructure: no Redis, no vector database, no message broker.

Try it in five minutes

You need Docker with Compose v2: about 6 GB of disk and 4 GB of memory for Docker. You don't need an account, an API key or a model. The demo is fully offline.

git clone https://github.com/codzz/HauntOps.git
cd HauntOps
./scripts/quickstart.sh

On Windows, run powershell -ExecutionPolicy Bypass -File scripts/smoke-compose.ps1 instead.

The script writes a .env with random secrets, builds five containers and waits until they are healthy. The first build takes a few minutes. Then:

  1. Open http://127.0.0.1:3000 and click Explore the demo. No password is needed.
  2. Open Incidents, then the incident Checkout returns HTTP 500 after latest deploy (DEMO DATA).
  3. Click Investigate and watch the Live investigation tab. Each stage appears as soon as it is written to the database. The test stage builds and tests the demo repository twice, so allow two or three minutes on the first run.
  4. Look through Evidence, Root cause analysis and Report, then go to Proposed actions and propose a Slack message.

A second demo project, Inventory service (DEMO DATA), runs the same investigation on a Python codebase. The first demo project is C#.

Everything in the demo is simulated and labelled DEMO DATA in the UI and in the database.

What you will see

These screenshots come from the demo project. All the data in them is simulated and labelled DEMO DATA.

Live investigation timeline

A live timeline of real events. Each stage reports what it examined, what it found, its limitations and what is still missing. Nothing is a progress animation.

Log evidence including a prompt injection attempt shown as data

Logs are untrusted. A log line saying "IGNORE ALL PREVIOUS INSTRUCTIONS" stays a piece of evidence and cannot become an instruction. Secrets are redacted before storage.

Stack frame mapped to source code and to the commit that changed it

From stack frame to commit. The stack frame is mapped to the method, the source lines and the commit that changed them 20 minutes before the incident.

Report with what is known, what is unknown and a timeline

A report built only from stored records. It lists what is known, what is still unknown and a timeline, and each line cites its evidence (E1, E2, …). You can download it as Markdown.

Approval screen showing exactly what will be sent to Slack

Humans approve every external action. You see exactly what would be sent before you approve it. If Slack is not configured, the result is recorded as "not executed: integration not configured" and never shown as a fake success. A failed action can be tried again. Every step goes to an append-only audit trail.

Incident comments and history, including the assignment

Work on it as a team. Assign the incident, leave comments, and follow its history: who reported, assigned, edited or resolved it, and every investigation it had.

Overview dashboard with incident activity and severity widgets

An overview you can arrange. Open and investigating incidents, waiting approvals, activity over time, severity and project breakdowns, and the investigator's accuracy from the team's verdicts. Show or hide each widget.

Printable postmortem with the confirmed root cause and timeline

A postmortem ready to print. One page with the incident, the root cause the team confirmed, the timeline, actions taken, follow-ups and comments. Print it or save it as PDF.

How it works

The agent's rules, current pipeline and roadmap are in AGENT.md.

flowchart LR
    I[Incident<br/>manual or alert webhook] --> T[Triage]
    T --> L[Log investigator<br/>groups errors, correlates requests,<br/>redacts secrets]
    L --> C[Code investigator<br/>stack frames to symbols<br/>to recent commits]
    C --> R[Test runner<br/>your tests at the suspect commit<br/>and its parent, no network]
    R --> A[Analyst and critic<br/>competing hypotheses,<br/>each one challenged]
    A --> P[Report<br/>every claim cites evidence]
    P -.-> X[Proposed Jira / Slack action<br/>waits for human approval]
Loading

The investigation is a LangGraph pipeline. Each stage writes evidence, with a source reference and a reliability note, to PostgreSQL before the next stage starts. The UI streams those events over SignalR and recovers from the stored history if the connection drops.

The investigative score of a hypothesis is the reliability of its supporting evidence minus the reliability of its contradicting evidence, and the UI shows the full sum. It ranks hypotheses. It is not a probability, and HauntOps never calls it one.

A Frankenstein of four ecosystems

Part Stack Job
Web Next.js 16, React 19, TypeScript, Tailwind, shadcn/ui Onboarding wizard, incident workspace, live timeline, approvals
API ASP.NET Core 10, EF Core 10, SignalR Accounts, project isolation, schema and migrations, jobs, approvals, audit
Worker Python 3.12, LangGraph, Pydantic, Tree-sitter The investigation stages
Sandbox Locked-down container on an internal network Runs your dotnet test or pytest with no internet and no credentials
Store PostgreSQL 17 Data, job queue (FOR UPDATE SKIP LOCKED), transactional outbox, full-text search

The parts share a set of JSON Schema contracts in contracts/. C# and Pydantic types are generated from those schemas, and CI fails if the generated code is stale. PostgreSQL is the only infrastructure. There is no Redis, no vector database and no message broker.

Point it at your own system

The demo is a starting point. To investigate a real service:

  1. Create a project. A five-step wizard connects a GitHub repository (public repositories need no token; private ones need a read-only token), then discovers the languages, frameworks and test tools and shows the file behind each finding. See docs/repositories.md.
  2. Send logs. Use a project token with structured JSON or OpenTelemetry OTLP/HTTP:
    curl -X POST "http://127.0.0.1:8080/api/v1/projects/$PROJECT_ID/logs" \
      -H "Authorization: Bearer $HAUNTOPS_TOKEN" -H "Content-Type: application/json" \
      -d '{"source":"app.jsonl","records":[{"timestamp":"2026-03-01T10:00:00Z","level":"error","service":"billing","message":"boom"}]}'
    See docs/ingestion.md for the OpenTelemetry Collector setup.
  3. Let alerts open incidents. Each signed request to the alert webhook becomes an incident. The request uses a small JSON body (title, severity, service) and an HMAC-SHA256 signature, and docs/ingestion.md has a curl example. Alertmanager and Grafana need no relay script: their own receivers take their payloads, authenticated with a per-project alert token. You can also create incidents by hand, or let a project open them from its stored logs when one service logs a burst of matching errors. Log detection is off by default and a project owner turns it on. It then also looks back over the logs already stored, and it calls no model. See docs/detection.md. Starting the investigation takes one click. By default it doesn't start automatically, because in live mode an investigation sends incident details to your model provider, and each one runs your test suite twice. A project owner can turn on Investigate new incidents automatically in the project settings.
  4. Connect Jira and Slack if you want approved actions to reach them. Credentials are encrypted with AES-256-GCM and never shown again. See docs/integrations.md.

Code analysis currently covers C#, TypeScript and Python. For other languages, the report lists the missing analysis as a limitation and does not guess.

Integrations

Every integration is optional and set up per project. Project owners configure GitHub, Jira and Slack on the Integrations page. Credentials are encrypted with AES-256-GCM before they reach the database, and the API only ever shows their last four characters.

Integration What HauntOps does with it What you provide Docs
LLM The triage stage sends the incident to the model and gets back a structured summary, validated against a JSON Schema. Administrators pick the provider on the Settings page: OpenAI, Anthropic (its own Messages API), Azure OpenAI, Google Gemini, OpenRouter, a local Ollama, or any OpenAI-compatible server such as vLLM or LM Studio. Saving tests it at once, and the next investigation uses it without a restart. Runs can be recorded and replayed later with no key. Provider, model and key on the Settings page (or the HAUNTOPS_MODEL_* settings in .env) operations.md
GitHub Reads the repository for discovery, code mapping, commit history and tests. Public repositories are read without a token (GitHub allows 60 requests an hour this way). The connection test warns you if a token can also write. Nothing for a public repository; for a private one, a fine-grained token with Contents: read and Metadata: read repositories.md
Jira Creates an issue from the investigation report after a project owner approves the exact text. The link to the new issue is recorded with the approval. Atlassian Cloud site, account email, API token and project key integrations.md
Slack Posts the investigation summary to a channel after a project owner approves the exact text. Incoming webhook URL integrations.md
OpenTelemetry Accepts logs over OTLP/HTTP (JSON) from the OpenTelemetry Collector or an SDK. A project ingestion token ingestion.md
Monitoring alerts Turns Alertmanager, Grafana and HMAC-signed alert webhooks into incidents. Repeated deliveries create no duplicates, and a person still decides when to investigate. A per-project alert token or webhook secret ingestion.md

To use a model, choose it under Settings → AI model provider (administrators). Or, to keep the key out of the database, add these lines to .env and run docker compose up -d:

HAUNTOPS_MODEL_MODE=live
HAUNTOPS_MODEL_NAME=gpt-4o-mini                 # any model your endpoint serves
HAUNTOPS_MODEL_API_KEY=sk-...
HAUNTOPS_MODEL_ENDPOINT=                        # empty means https://api.openai.com/v1
HAUNTOPS_RECORD_RUNS=true                       # optional: save runs so they replay later without a key

Before the incident reaches the model, HauntOps redacts secret-like values and wraps the content in untrusted-content markers. A model reply that fails schema validation is retried a fixed number of times. If it still fails, triage records it as a limitation and the investigation continues. The other stages are deterministic, so an investigation still finishes with no model at all.

Running the tests

The API has 410 tests, the worker 259 and the sandbox 11. There are also 95 browser tests, which scripts/e2e-fresh-install.ps1 runs on a throwaway stack built from your working tree. Integration tests use real PostgreSQL through Testcontainers, so they need Docker.

cd services/api && dotnet test
cd services/ai-worker && uv run pytest
cd apps/web && npm run lint && npm run e2e          # e2e needs the demo stack running
powershell -ExecutionPolicy Bypass -File scripts/e2e-fresh-install.ps1          # first-run setup on a throwaway stack
powershell -ExecutionPolicy Bypass -File scripts/generate-contracts.ps1 -Check  # generated contract types are current
powershell -ExecutionPolicy Bypass -File scripts/export-schema.ps1 -Check       # database/schema.sql matches the migrations
powershell -ExecutionPolicy Bypass -File scripts/security-probe.ps1             # black-box security checks on a throwaway stack

docs/verification/ lists every requirement in the specs with the test that checks it, and the latest security probe results.

Running it for real

  • First administrator: set HAUNTOPS_PROFILE=standard in .env, start the stack and open http://127.0.0.1:3000/setup with the HAUNTOPS_SETUP_TOKEN from .env. Setup closes once an administrator exists.
  • Users and sharing: administrators create accounts in Settings. Project owners add members, and every read and write is checked against project membership.
  • Hardening: HauntOps sets a content security policy and checks for cross-site requests. It also rate-limits sign-in and side-effect actions, locks accounts after repeated failed sign-ins, and runs containers with dropped capabilities. PostgreSQL is bound to localhost. See docs/security.md.
  • Backup, restore, upgrades and troubleshooting: see docs/operations.md.

Built with Kiro

HauntOps was built for the Kiroween hackathon, in the Frankenstein category, using Kiro's spec-driven workflow. Everything Kiro used is committed in .kiro/:

  • Steering: product, architecture, coding and security rules applied to every change.
  • Specs: eight specs with requirements, design and tasks, one commit per task.
  • Custom agents: backend, frontend, AI, QA and a read-only security reviewer.
  • Hooks: a secret-and-labelling check after every file write, and a check that generated contracts are current whenever a schema is saved.

The full write-up, with what worked and what did not, is in docs/submission.md.

Repository layout

.kiro/        steering, specs, custom agents and hooks
apps/web/     Next.js UI
services/     api/ (ASP.NET Core), ai-worker/ (Python LangGraph), sandbox/ (test runner)
contracts/    JSON Schema source of truth for every cross-service payload
database/     schema.sql exported from the EF Core migrations (read by worker tests)
demo/         demo fixtures (DEMO DATA): simulated logs and git histories
docs/         operations, security, ingestion, integrations, hypotheses, report format
scripts/      quickstart, smoke test, codegen and schema checks

License

MIT

About

Self-hosted AI incident investigator. Reads logs, maps stack traces to code and commits, runs your tests, ranks root-cause hypotheses, and cites evidence for every claim. Humans approve every action.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages