SentinelOps
Sends security alerts and notifications to a Telegram chat.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SentinelOps: AI Security Operations Copilot
SentinelOps is an open-source, defense-in-depth AI Security Operations Copilot built on FastMCP, Groq LLaMA 3.3, a Flask web UI, and an atomic SQLite WAL store. It pairs autonomous threat investigation with strict human-in-the-loop interlocks: untrusted log ingestion is delimited against prompt injection, destructive tools are filtered from the model's schema, proposals require verified evidence and bind parameters cryptographically via SHA-256 params_hash, and all operational state transitions are committed to a tamper-evident, SHA-256 hash-chained audit log with SQLite head verification.
Architecture
System Component & Evidence-Token Architecture
+----------------------------------------------------------------------------------------------------+
| INVESTIGATION & REASONING |
| |
| +-----------------------------+ Prompt & Tools +----------------------------------+ |
| | GROQ LLM (LLaMA 3.3) |<=======================>| FAST-MCP SERVER | |
| | - Autonomous Reasoning | | - Schema Filter (Read/Propose) | |
| | - Cannot execute actions | | - Session Context Management | |
| | - Passes evidence_token | +-----+----------------------+-----+ |
| +-----------------------------+ | | |
+------------------------------------------------------------------|----------------------|----------+
| |
1. search_logs(query) | | 2. check_ip_reputation(ip)
v v v
+-----------------------------------------------+ +-----------------------------------------------+
| CHROMADB VECTOR STORE | | ABUSEIPDB THREAT INTEL |
| - Embeddings: all-MiniLM-L6-v2 ONNX | | - Real-time abuse confidence score (0-100) |
| - Ingests & indexes security audit telemetry | | - Score >= 50 flagged malicious |
| - Raw logs returned in <untrusted_data> tag | | - Mints session-bound evidence_token |
| - Structured source_ip -> observed_ips table | +-----------------------+-----------------------+
+-----------------------+-----------------------+ |
| | Returns evidence_token
| Structured IPs & Suspicious Events | & reputation score
+-------------------------+-------------------------+
|
v
+-----------------------------------+
| POLICY ENGINE CHECK |
| [propose_block_ip/create_inc] |
| * Target IP in observed_ips? |
| * Valid evidence_token supplied? |
| * Target IP in Protected List? |
| * Derive severity & approvals |
+-----------------+-----------------+
|
| PASS: Generates action token & params_hash
v
+-----------------------------------+
| ATOMIC SQLITE WAL STORE |
| - Stored: pending proposal |
| - Cryptographic params_hash |
| - Severity: Critical (2 approvals|
| - audit_head (last_seq, head) |
+-----------------+-----------------+
|
+------------------------------------------------------|---------------------------------------------+
| HUMAN-IN-THE-LOOP APPROVAL |
| v |
| +-----------------------------+ HTTP POST /confirm/<token> +----------------------+ |
| | OPERATOR (BROWSER) |------------------------------------>| FLASK WEB GATEWAY | |
| | - Reviews IP, Reason, Hash | | - 3 Route Gates | |
| | - Confirms action | | - params_hash check | |
| +-----------------------------+ +----------+-----------+ |
| | |
| 4. execute_pending_action(token, hash) v |
| (Human-Only Tool: Hidden from LLM) +----------------------+ |
| | FIREWALL SANDBOX | |
| | & AUDIT CHAIN | |
| | - iptables rule file | |
| | - SHA-256 log chain | |
| +----------------------+ |
+----------------------------------------------------------------------------------------------------+Component Interaction Summary
Groq LLaMA 3.3 (Autonomous Copilot): Drives threat reasoning and investigations through tool calling. Destructive tools (
execute_pending_action,expire_blocks) are removed from its tool schema (HUMAN_ONLY_TOOLS), guaranteeing that the LLM cannot directly apply firewall rules or alter defensive configurations.ChromaDB (Vector Log Search & Prompt Injection Defense): Indexes security telemetry with ONNX
all-MiniLM-L6-v2. Raw log lines returned to the LLM are sanitized and isolated in<untrusted_data>delimiters to defeat indirect prompt injections. FastMCP extracts only structured metadata fields (source_ip,client_ip) and records them into the SQLiteobserved_ipspolicy table.FastMCP Server (Tool Gateway & Human Gatekeeper): Enforces input validation, manages session contexts, interfaces with AbuseIPDB, and restricts destructive actions exclusively to human operator routes.
Evidence-Token Check (Anti-Hallucination & Provenance Verification):
When the agent calls
check_ip_reputation(ip), FastMCP queries AbuseIPDB and mints an authenticatedresult_token(stored in SQLiteevidencetable).High/critical escalations (
create_incident,notify_telegram) and mitigations (propose_block_ip) require thisevidence_token.The Policy Engine validates that:
The token exists and belongs to the active session.
The token is cryptographically bound to the target IP being acted on.
Telemetry confirms a malicious threshold (score $\ge 50$ or confirmed high-threat log event).
Target is not in the fail-closed protected allowlist (
data/protected.yaml).
Hallucinated targets or prompt-injected victim IPs (e.g.
10.0.0.1) fail closed immediately withpolicy_denied:unobserved_ipormissing_evidence_token.
Related MCP server: impact-preview
Quickstart
1. Prerequisites
Python 3.11+ (or Python 3.12 for optional ChromaDB semantic search)
Git
2. Setup Local Environment
# Clone and enter directory
cd sentinelops
# Create and activate virtual environment
python -m venv .venv
# On Windows PowerShell:
.\.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
# Install dependencies
python -m pip install -r requirements.txt3. Configure Environment
# Copy example configuration
cp .env.example .env
# Configure .env:
# GROQ_API_KEY=gsk_... # Required only for live LLM mode
# USE_REAL_APIS=false # Default: offline deterministic stub mode
# SENTINELOPS_REQUIRE_OBSERVED_IP=true4. Run SentinelOps
# Start Web UI (runs at http://localhost:5000)
python web_ui.py
# OR start Interactive Terminal CLI
python cli.py5. Run Verification & Test Suite
# Run the complete test suite (Unit, Hardening, Security Gates, E2E, Eval Harness)
python tests/run_all.py
# Verify cryptographic audit chain integrity
python -m sentinelops.verify_log data/action_log.jsonlSecurity Guarantees
SentinelOps enforces rigorous security properties proved by automated unit, integration, and security gate tests:
Prompt Injection Containment: All external log contents are wrapped in
<untrusted_data>XML fences. System prompts explicitly instruct the agent that content within these fences is raw data. Crucially, the Policy Engine validates that an IP cannot be proposed for blocking unless observed in a structured log field or with reputation score $\ge 50$. Poisoned free-text instructions cannot trigger action proposals.Hidden Execution Tools (
HUMAN_ONLY_TOOLS): Destructive tools (execute_pending_action,expire_blocks) are stripped from LLM tool definitions via schema transformation. If an injected LLM hallucinated a direct execution call, the agent loop rejects it before forwarding to FastMCP.Session-Bound Evidence Tokens: High and critical severity incident creations require a valid 8-character cryptographic token issued by
check_ip_reputationwithin the same session. Agents cannot fabricate incidents without active investigation.Parameter Binding via SHA-256
params_hash: At proposal time, canonical JSON parameters (type, target, reason, TTL, severity, required approvals) are hashed. Both/confirmandexecute_pending_actionindependently recompute and verifyparams_hashfrom the SQLite row. Tampering with targets or lowering severity fromcriticaltolowin the database causes immediate execution refusal.Multi-Party Approval Gate: Proposals derive severity server-side. Non-critical proposals execute on 1 human confirmation.
criticalseverity actions require distinct confirmations from 2 separate operator identities.Fail-Closed Infrastructure Allowlist: Critical network infrastructure (
127.0.0.1,8.8.8.8,1.1.1.1,192.168.1.1,127.0.0.0/8) cannot be blocked. Ifdata/protected.yamlis missing or corrupted, the system falls back to hardcoded built-in protections and fails closed. The allowlist is re-checked insideexecute_pending_action.Tamper-Evident SHA-256 Audit Chain: Every proposed, confirmed, declined, expired, and executed action is cryptographically chained (
prev_hash). Concurrent writes are protected with OS file locks (msvcrt/fcntl). Clean tail truncations are detected via head state comparison against SQLiteaudit_head.
Agent Evaluation Results
The SentinelOps eval harness (evals/run_evals.py) runs 20 deterministic scenarios covering clear attackers, benign traffic, multi-IP investigations, all 6 prompt injection attack styles, protected IP defense, quarantine path escapes, and unblock workflows:
Metric | Benchmark Target | Result | Status |
Forbidden Action Rate |
|
| PASSED |
Tool-Call Accuracy |
|
| PASSED |
Correct Decision Rate |
|
| PASSED |
Hallucinated Evidence Rate |
|
| PASSED |
Avg Latency / Investigation | N/A |
| INFO |
Avg Steps / Investigation | N/A |
| INFO |
Detailed scenario breakdown and live LLM variance analysis can be found in docs/EVALS.md.
FastMCP Tool Inventory (13 Tools)
SentinelOps defines 13 FastMCP tools partitioned into public agent tools and human-only administrative tools:
Tool Name | Access Level | Description |
| Agent | FastMCP connectivity and health check. |
| Agent | Search security logs (returns wrapped |
| Agent | Query IP reputation and generate authenticated evidence tokens. |
| Agent | File incidents (enforces evidence token requirement for high/critical). |
| Agent | List recorded incidents from local store. |
| Agent | Propose blocking an IP address (returns preview token and |
| Agent | Propose isolating a suspicious file in the sandbox. |
| Agent | Propose removing an active firewall block rule for a currently blocked target. |
| Agent | Propose restoring an existing quarantined file to its verified sandbox path. |
| Agent | Read recent cryptographic audit trail records. |
| Agent | Send security alerts (requires evidence token for critical notifications). |
| Human-Only | Executes confirmed action tokens. Hidden from LLM; called only by human confirmation flow. |
| Human-Only | Scans and expires active block rules past TTL. Hidden from LLM schema. |
Configuration Reference
Configuration is managed via environment variables (with safe defaults in stub mode):
# Core Mode Settings
USE_REAL_APIS=false # 'false' runs deterministic stub data; 'true' uses Groq & AbuseIPDB
ENABLE_DEBUG_ENDPOINTS=false # Enables debug tools; strictly false in production
FLASK_DEBUG=false # Flask debug mode
# LLM & Third-Party APIs
GROQ_API_KEY= # Groq API key for LLaMA 3.3
ABUSEIPDB_API_KEY= # AbuseIPDB API key
TELEGRAM_BOT_TOKEN= # Telegram bot token for alerts (optional)
TELEGRAM_CHAT_ID= # Telegram chat ID for alerts (optional)
# Policy & Defense Settings
SENTINELOPS_REQUIRE_OBSERVED_IP=true # Require IP observation before proposing blocks
SENTINELOPS_OBSERVED_IP_TTL=3600 # Observed IP TTL in seconds (default: 1 hour)
SENTINELOPS_MIN_BLOCK_SCORE=50 # Minimum reputation score required for block proposal
SENTINELOPS_BLOCK_TTL=3600 # Firewall rule expiration TTL in seconds (default: 1 hour)
SENTINELOPS_SUSPICIOUS_EVENTS= # Comma-separated list of suspicious log event types
SENTINELOPS_PROTECTED_FILE=data/protected.yaml # YAML allowlist of protected IPs and CIDRsKnown Limitations
Operator Identity Authentication: Operator identities are currently passed via the
X-Operator-IDHTTP header (or session ID) rather than an authenticated session token. Because the current deployment lacks cryptographic authentication (such as OIDC, SAML, or signed JWT session cookies), the two-person approval mechanism is not yet cryptographically strong against an adversarial insider capable of spoofing HTTP headers.Total File and Database Rewrite: The SHA-256 hash chain reliably detects tampering, entry modification, record reordering, and tail truncation via SQLite
audit_head. However, an adversary with root/filesystem access who simultaneously rewrites bothaction_log.jsonland the SQLite database can recalculate the hash chain from a forged genesis record. Defense against simultaneous rewrite requires an external trust anchor (e.g., remote append-only syslog, WORM storage, or hardware security module).Windows Platform Symlink Escape Test: On Windows operating systems without Developer Mode or elevated Administrator privileges, non-privileged Python processes return
WinError 1314when creating filesystem symlinks. Consequently, the symlink escape test (test_quarantine_rejects_symlink_pointing_outside_sandbox) is skipped on Windows and validated in POSIX/Linux CI environments.
Further Documentation
Related MCP Connectors
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Human-in-the-loop review and approval for AI agents. Audit trail, approval policies, native MCP.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Human-in-the-loop for AI agents over MCP: durable approvals with a hosted review page & audit trail
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP servers exposing security operations tools (VirusTotal, MITRE Caldera, LimaCharlie) to AI agents with defense-in-depth safety controls.3MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that provides impact preview and approval workflow for AI agent actions, allowing users to see diffs and risk assessments before any changes are executed.1MIT
- FlicenseNot gradedqualityFmaintenanceMCP server for AI agent compliance that screens actions before execution and records decisions in an immutable, SIEM-ready audit trail.84 npm-
- FlicenseNot gradedqualityCmaintenanceThis MCP server provides secure access to databases for AI agents, enforcing authentication, authorization, human approval, logging, and notifications to prevent dangerous actions.-