How vigil-soc/vigil works
1. Overall shape
Vigil is an AI SOC platform with four main runtime surfaces: a React frontend, a FastAPI backend API, a headless SOC daemon, and a PostgreSQL-backed data layer. The product is organized around workflow-driven incident handling rather than a single monolithic app.
2. User-facing control plane
The frontend/ app is the operator console. It exposes dashboards, case management, investigation views, workflow builders, settings, and AI/LLM configuration. It talks almost entirely to the backend API, not directly to data sources or tools.
3. Backend API boundary
backend/main.py and backend/api/ implement the HTTP surface for cases, findings, analytics, AI decisions, approvals, workflows, integrations, auth, webhooks, and system config. This layer is mostly a request/response façade: route handlers delegate to shared services and database modules rather than containing heavy business logic.
4. Business logic layer
The core application behavior lives in top-level services/. This is where case workflows, approvals, enrichment, search, SLA policy logic, graph building, LLM routing, MCP integration, ingestion, and reporting are implemented. Both the backend API and the daemon reuse these services, which is the main architectural reuse boundary in the repo.
5. Autonomous SOC daemon
daemon/ is the headless execution engine for continuous monitoring and background processing. It includes pollers, schedulers, Kafka ingestion, workflow/orchestration, responder logic, sandbox handling, federation sync, and LLM worker coordination. This is the part that runs without the UI and is responsible for ongoing SOC automation.
6. Workflow and agent model
Workflows are plain-text playbooks in workflows/*/WORKFLOW.md. They define multi-agent sequences such as incident response, full investigation, threat hunt, and forensic analysis. The agent concepts are described in the README; the implementation is split between workflow services and agent orchestration code, with workflows selecting which specialized agent capabilities and tools get used in each phase.
7. Tooling and external integrations
Vigil uses MCP as the main integration boundary for external systems. The repo contains local tool implementations in tools/ and MCP-oriented services in services/mcp_*, plus configuration in mcp-config.json and mcp-servers/. Material integrations include SIEMs, EDR/XDR, threat intel, sandboxing, ticketing, chat, and detection-engineering sources. This is how agents reach Splunk, CrowdStrike, VirusTotal, Jira, Slack, Timesketch, and similar systems.
8. Data persistence and schema
database/ holds the PostgreSQL connection, models, service layer, and SQL initialization scripts. The schema includes auth, cases, workflows, approvals, threat indicators, federation, LLM providers, AI model configs, and budgets. data/ holds validation schemas, taxonomy, and reference datasets, while database/init/ and the Helm chart’s mirrored init files define how the database is bootstrapped.
9. AI/LLM execution path
LLM behavior is abstracted through services such as llm_gateway, llm_router, llm_worker, provider discovery, prompt security, and model registry. The repo also includes docker/bifrost/, which appears to be the multi-provider gateway layer for routing across Claude/OpenAI/Ollama. In practice, agents and workflows call these services rather than binding to a single model provider.
10. Security and control mechanisms
Authentication, CSRF, rate limiting, security headers, secrets management, and token blacklisting are split across backend/middleware/, backend/services/, and core/. The README notes DEV_MODE=true as a default bypass for development; production auth is an important boundary because it changes how the backend and UI are exposed.
11. Observability and operations
The repo includes telemetry and sanitization in core/telemetry*, monitoring hooks in backend/monitoring.py and daemon/metrics.py, plus Docker/Grafana/Prometheus/OpenTelemetry assets under docker/. This indicates the system is designed to expose runtime health, workflow activity, and cost/usage metrics as first-class operational data.
12. Deployment topology
There are three main deployment paths: local scripts (start_web.sh, start_daemon.sh), Docker Compose under docker/, and a production Helm chart under helm/vigil/. The Helm chart deploys backend, daemon, Postgres, Redis, optional LLM worker components, ingress, service monitors, and init jobs, so the production diagram should show multiple pods/services rather than a single application container.
13. Testing and validation
The repo has broad unit/integration/security coverage in tests/, plus scenario scripts in scripts/ for data generation, integration checks, migrations, and exports. This suggests a layered system where schema, integration contracts, and security boundaries are important enough to be tested separately from the UI and orchestration logic.
14. Key architecture boundaries to draw
A good diagram should separate: operator UI, backend API, shared domain services, autonomous daemon/worker processes, PostgreSQL persistence, and external MCP-backed tools/services. The most important data flows are: UI/API requests into services, services reading/writing PostgreSQL, daemon-driven background workflows using the same services, and agent/tool calls out through MCP to third-party SOC systems.
Main entry points: services Domain Services · orchestrator.py Daemon Pipeline · api API Routes · database Database
Components 18
Operator UI
React console for analysts and admins.
- Frontend · Operator-facing UI for cases, investigations, workflows, settings, and AI controls.
frontend/src - Cases UI · Case tables, detail panels, evidence, SLA, comments, and tasks.
frontend/src/components/cases - Settings UI · LLM providers, agents, skills, federation, integrations, budgets, and database controls.
frontend/src/components/settings
API Boundary
HTTP surface and request orchestration.
- Backend App · Application entrypoint for middleware, monitoring, and route wiring.
backend/main.py - API Routes · Case, finding, workflow, auth, integration, analytics, and webhook endpoints.
backend/api - Middleware · Auth, CSRF, rate limiting, and security headers.
backend/middleware
Shared Services
Reusable SOC workflow and integration logic.
- Domain Services · Core business logic reused by the API and daemon.
services - Workflow Engine · Case automation, approvals, investigation flows, workflow runs, and AI-generated workflows.
services/case_workflow_service.py - LLM Stack · Gateway, router, worker, prompt security, model registry, and provider discovery.
services/llm_gateway.py - Integrations · MCP client/registry, integration bridge, secrets, and tool orchestration.
services/mcp_service.py
Headless Runtime
Continuous processing and automation engine.
- Daemon · Background SOC execution entrypoint.
daemon/main.py - Daemon Pipeline · Pollers, Kafka ingestion, scheduler, orchestrator, processor, responder, and agent runner.
daemon/orchestrator.py - Federation · Connectors and sync loop for external SIEM/XDR sources.
daemon/federation
Persistence
Database schema, models, and reference data.
- Database · Connection, models, services, and configuration tables.
database - DB Init · SQL bootstrap scripts mirrored into the Helm chart.
database/init - Reference Data · Validation schemas, taxonomy, and seed datasets.
data
External Systems
Third-party SOC tools and deployment targets.
- SOC Tools · Splunk, CrowdStrike, Sentinel, Jira, Slack, VirusTotal, sandbox, and other external systems accessed through tools and MCP.
tools - Deployments · Docker Compose, bifrost gateway, and Helm chart for backend, daemon, database, Redis, and LLM workers.
helm/vigil
Connections 24
- Frontend → Backend App: uses API · UI reads and mutates state through the backend HTTP surface.
- Cases UI → API Routes: case flows · Case management screens depend on case, findings, SLA, and workflow endpoints.
- Settings UI → API Routes: admin flows · Settings screens manage integrations, skills, models, and budgets through API routes.
- Backend App → Middleware: wraps · Application startup installs security and request controls.
- Backend App → API Routes: mounts · Main app exposes the HTTP route modules.
- API Routes → Domain Services: delegates · Routes delegate business logic to reusable services.
- API Routes → Database: reads/writes · API handlers persist and query cases, approvals, workflows, and configs.
- Domain Services → Workflow Engine: includes · Workflow and approval logic is a central service boundary.
- Domain Services → LLM Stack: includes · LLM routing, workers, and prompt safety are part of shared application logic.
- Domain Services → Integrations: includes · MCP and integration orchestration are implemented as shared services.
- Domain Services → Database: persists · Core services store cases, runs, budgets, skills, and federation state.
- Daemon → Daemon Pipeline: starts · Daemon entrypoint launches the background processing pipeline.
- Daemon Pipeline → Workflow Engine: executes · Background automation reuses the same workflow and approval services as the API.
- Daemon Pipeline → LLM Stack: uses · Daemon tasks coordinate LLM workers and model routing.
- Daemon Pipeline → Database: syncs state · Polling, ingestion, and orchestration read and update persistent records.
- Daemon Pipeline → Federation: syncs · Federation adapters normalize external detections into the platform.
- Federation → SOC Tools: connects to · Adapters talk to SIEM and XDR systems such as Splunk and CrowdStrike.
- Integrations → SOC Tools: brokers · MCP services and tools reach external SOC platforms and SaaS systems.
- DB Init → Database: bootstraps · SQL initialization defines tables and seed schema for PostgreSQL.
- Reference Data → Domain Services: drives · Schemas and taxonomies inform validation, enrichment, and detection logic.
- Deployments → Backend App: deploys · Compose and Helm deploy the API service.
- Deployments → Daemon: deploys · Compose and Helm deploy the headless automation runtime.
- Deployments → Database: provisions · Production topology includes PostgreSQL and supporting stateful services.
- Deployments → LLM Stack: supports · Deployment includes LLM worker and bifrost routing components.