Skip to main content
Glama

πŸ›‘οΈ AgentSentinel MCP Gateway

Industrial-Grade Zero-Trust MCP Gateway, DLP Secret Firewall & Circuit Breaker for Autonomous AI Agents

CI License: MIT Node.js Model Context Protocol

AgentSentinel is an enterprise-grade execution firewall and reliability gateway sitting between AI Agent clients (Claude Desktop, Claude Code, Cursor, Antigravity, OpenCode, AutoGen, CrewAI) and host capabilities. It solves the three most critical operational barriers facing autonomous agents in production.


🎯 The Three Core Pillars

                     [ Autonomous AI Agent / LLM Client ]
                    (Claude, Cursor, Antigravity, OpenCode)
                                       β”‚
                                       β”‚  JSON-RPC 2.0 (stdio)
                                       β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                        AGENTSENTINEL GATEWAY                           β”‚
  β”‚                                                                        β”‚
  β”‚  1. ⚑ RELIABILITY & CIRCUIT BREAKER                                   β”‚
  β”‚     - Sliding-window rate limiter (60 RPM)                             β”‚
  β”‚     - Runaway failure detector (trips OPEN on 3 consecutive failures)  β”‚
  β”‚                                                                        β”‚
  β”‚  2. πŸ”’ ZERO-TRUST PRE-EXECUTION FIREWALL                               β”‚
  β”‚     - AST Command Sanitizer (blocks chaining ";", "&&", `subshell`)   β”‚
  β”‚     - Chroot Path Guard (rejects "../../" directory traversal)        β”‚
  β”‚     - SSRF Guard (blocks 169.254.169.254 metadata & private subnets)   β”‚
  β”‚                                                                        β”‚
  β”‚  3. πŸ” DATA LOSS PREVENTION (DLP) SECRET MASKING                       β”‚
  β”‚     - Scans inputs and outputs for 25+ secret patterns                 β”‚
  β”‚     - Redacts AWS, GitHub, OpenAI, Claude, JWT, DB URIs before LLM    β”‚
  β”‚                                                                        β”‚
  β”‚  4. πŸ“œ STRUCTURED AUDIT LEDGER                                         β”‚
  β”‚     - Append-only JSONL log with duration, verdict & hash              β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β–Ό
                         [ Sandboxed Host Execution ]

1. πŸ”’ Zero-Trust Pre-Execution Gateway & DLP Engine

  • Command Injection Defense: Intercepts shell execution before it reaches the OS. Blocks command chaining (;, &&, ||, |), subshell execution (`...`, $(...)), and denylisted destructive binaries (rm, del, format, dd, mkfs, curl | sh).

  • Path Traversal Containment: Canonical path resolution strictly chroots execution within the approved workspace root directory.

  • SSRF Link-Local Protection: Blocks outbound calls to cloud metadata IP (169.254.169.254), loopbacks (127.0.0.1, localhost, ::1), and private RFC-1918 subnets (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).

  • Automated DLP Redaction: Pre-flight and post-execution token scanner with zero-trust redaction for:

    • AWS Access Keys (AKIA...)

    • GitHub Personal Access Tokens (ghp_..., github_pat_...)

    • Anthropic & OpenAI API Keys (sk-ant-..., sk-proj-...)

    • RSA & OpenSSH Private Keys (-----BEGIN RSA PRIVATE KEY-----)

    • JWT Tokens (eyJ...)

    • Database URI passwords (postgres://user:password@host...)

    • Slack Tokens & Stripe Secret Keys

2. ⚑ Circuit Breakers & Runaway Loop Prevention

  • Runaway Loop Breaker: When an autonomous agent enters a broken loop (e.g., retrying an erroneous query repeatedly), the circuit breaker transitions from CLOSED to OPEN after $N$ consecutive failures.

  • Token Spend Protection: Rejects all further tool invocations during cooldown, preventing catastrophic API token spend and CPU exhaustion.

  • Sliding-Window Rate Limiter: Enforces strict requests-per-minute (RPM) limits per session to throttle runaway concurrency.

  • Self-Healing Recovery: Automatically transitions to HALF-OPEN after cooldown, allowing probe attempts to restore normal operation.

3. πŸš€ Local-First, Zero-Heavy-Infra Architecture

  • Zero Kubernetes or Heavy Cloud Setup: Runs as a lightweight, single-process Node.js daemon directly on your workstation or server.

  • Native MCP Protocol Compliant: Integrates instantly into Claude Desktop, Claude Code, Cursor, or custom AI agent loops over standard STDIO JSON-RPC 2.0.

  • Deterministic Structured Audit Ledger: Writes an append-only JSONL audit log capturing caller session, duration, tool name, security verdict, and DLP metrics without external observability dependencies.


Related MCP server: genpark-agent-bash-command-sandbox-guard-skill

πŸ› οΈ Provided MCP Tools

Tool Name

Description

Security Controls Applied

sentinel_safe_exec

Executes shell commands safely.

Allowlist, AST chaining block, timeout, DLP output redaction.

sentinel_safe_fs

Sandboxed file ops (read, write, list, stat).

Path chroot containment, traversal block, secret masking.

sentinel_safe_fetch

Secure HTTP client (GET, POST, etc.).

SSRF metadata blocker, header & body DLP redaction.

sentinel_policy_check

Pre-flight permission validator.

Lets agents query policy verdicts before attempting actions.

sentinel_audit_inspect

Query audit trail and circuit telemetry.

Read-only inspection of runtime logs and breaker state.


πŸš€ Quickstart & Installation

Option A: Use directly with npx or node

# Clone the repository
git clone https://github.com/opuhassan001-alt/agent-sentinel-mcp.git
cd agent-sentinel-mcp

# Install dependencies and build
npm install
npm run build

# Run the test suite (100% pass)
npm test

Option B: Configure with Claude Desktop (claude_desktop_config.json)

Add AgentSentinel to your Claude Desktop configuration:

{
  "mcpServers": {
    "agent-sentinel": {
      "command": "node",
      "args": [
        "E:/work station/opu-portfolio/agent-sentinel-mcp/dist/index.js"
      ],
      "env": {
        "SENTINEL_ROOT_DIR": "E:/work station/opu-portfolio",
        "SENTINEL_MAX_FAILURES": "3",
        "SENTINEL_RATE_LIMIT_RPM": "60"
      }
    }
  }
}

Option C: Configure with Cursor IDE (.cursor/mcp.json)

{
  "mcpServers": {
    "agent-sentinel": {
      "command": "node",
      "args": ["dist/index.js"]
    }
  }
}

βš™οΈ Configuration Reference

AgentSentinel can be configured via environment variables or a configuration object:

Environment Variable

Default

Description

SENTINEL_ROOT_DIR

process.cwd()

Root boundary for filesystem operations and working directories.

SENTINEL_AUDIT_LOG_PATH

.sentinel-audit.jsonl

Filepath for append-only structured audit records.

SENTINEL_MAX_FAILURES

3

Number of consecutive tool errors before circuit trips OPEN.

SENTINEL_COOLDOWN_MS

30000

Cooldown duration in milliseconds before half-open retry.

SENTINEL_RATE_LIMIT_RPM

60

Maximum tool invocations allowed per minute.


πŸ§ͺ Testing & Verification

AgentSentinel includes an automated unit & integration test suite using the Node.js native test runner:

npm test
β–Ά CircuitBreaker & Runaway Loop Protection (6 tests)
β–Ά DLP Secret Scanner & Redaction Engine (7 tests)
β–Ά PolicyEngine & AuditLogger (5 tests)
β–Ά Security Firewall Guards (12 tests)
β–Ά Industrial MCP Tools Suite (11 tests)
βœ” All 41 tests passed cleanly

🐳 Docker Deployment

Run AgentSentinel inside a sandboxed container:

docker build -t agent-sentinel-mcp .
docker run -i --rm -v $(pwd):/workspace -e SENTINEL_ROOT_DIR=/workspace agent-sentinel-mcp

πŸ“„ License

Released under the MIT License. Copyright Β© 2026 Estakball Hossain (Opu).

Available Tools

5 tools
sentinel_audit_inspectB

Query the immutable structured audit ledger, circuit breaker state, and runtime metrics for compliance inspection.

Inputs: limit.

sentinel_policy_checkB

Pre-flight permission evaluator enabling autonomous agents to check whether an intended action complies with security policy before execution.

Inputs: args (required), tool (required).

sentinel_safe_execA

Execute shell commands inside an AST-inspected security sandbox with command chaining prevention, timeout enforcement, and automated DLP secret redaction.

Inputs: command (required), cwd, timeoutMs.

sentinel_safe_fetchB

Perform HTTP/HTTPS network requests with SSRF protection against cloud metadata IPs (169.254.169.254) and private subnets, plus DLP payload redaction.

Inputs: url (required), body, method, headers, +1 more.

sentinel_safe_fsA

Perform sandboxed filesystem operations (read, write, list, stat) with strict chroot directory containment and zero-trust secret masking.

Inputs: path (required), action (required), content, encoding.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a clearly distinct security capability: shell execution, filesystem operations, network fetching, policy pre-checking, and audit inspection. Although safe_exec could overlap with safe_fs or safe_fetch via shell commands, the sandbox descriptions make the intended boundaries clear.

    Naming Consistency4/5

    All tools use snake_case with a consistent sentinel_ prefix, which is highly predictable. The pattern shifts slightly from sentinel_safe_<action> for operational tools to sentinel_<noun>_<verb> for policy and audit tools, but remains readable and coherent.

    Tool Count5/5

    Five tools is well-scoped for a security gateway, covering execution, filesystem, network, policy, and audit without redundancy. Each tool earns its place in the minimal surface.

    Completeness4/5

    The core agent action surfaces are covered, plus policy evaluation and audit inspection. Minor gaps exist: safe_fs lacks explicit delete/remove, and there is no tool to manage policies or reset circuit breakers, but agents can likely work around these limitations.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      Enables AI agents to safely interact with GitHub, query Postgres read-only, check deployment status, and search/read files within an allowlisted sandboxβ€”all with dry-run writes and SQL/path safety gates.
      8
      -
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables autonomous agents to run shell and subprocess commands through a guardrail that blocks destructive system mutations, path traversals, and reverse shells. It also adds prompt-injection detection, spend circuit breakers, loop detection, and privacy sanitization so agent execution stays within safe, budgeted bounds.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables autonomous agents to enforce financial guardrails by tracking real-time token burn and cost velocity, automatically throttling or freezing execution when budgets are exceeded. It also blocks destructive shell commands, prompt injections, and runaway planning loops while sanitizing outputs before they are returned.
      7
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables agents to score, inspect, and gate tool calls before they execute, resolving shell commands the way a shell would in order to block destructive actions and detect multi-step attack sequences. It also redacts credentials and PII in either direction, requires signed single-use approval tokens for high-impact actions, and keeps a tamper-evident audit trail.
      6
      173 npm
      5
      Apache 2.0