Skip to main content

AgentSentrix 🛡️⚡

Real-Time Agentic Security Gateway, Multi-Tier Risk Engine & 3D WebGL Threat Visualizer

Python Version License: MIT Version


💡 What is AgentSentrix?

AgentSentrix is an open-source, production-grade security framework designed to protect AI agent workflows (LangGraph, CrewAI, AutoGen, custom Python agents) against unintended command execution, secret leaks, intent drift, and prompt injection.

It acts as an inline security firewall that intercepts tool calls, evaluates risk in real-time across a 3-tier scoring pipeline, suspends dangerous operations in a Human-in-the-Loop Quarantine, and streams live 3D telemetry to a WebGL visualizer.


✨ Key Features

  • ⚡ Multi-Tier Risk Pipeline ($T0 \rightarrow T1 \rightarrow T2$):
    • Tier 0 (~1ms): Deterministic YAML security policies & Shannon entropy secret detection.
    • Tier 1 (~50ms): Local Ollama model checking prompt injection & intent drift.
    • Tier 2 (~300ms): Groq LLM-as-a-Judge evaluating ambiguous risk scores ($30–70$).
  • 🛑 Human-in-the-Loop Quarantine: High-risk actions automatically pause agent execution until approved or blocked by a security operator via the dashboard.
  • 🔌 Flexible Interception Sensors:
    • Python SDK Middleware: Wrap any Python tool call or function with a single decorator @sentrix.intercept_tool().
    • MCP Proxy: Translucent Stdio/SSE proxy intercepting Model Context Protocol (MCP) server calls.
    • Shell Shim: CLI binary wrapper intercepting raw bash/powershell terminal executions.
  • 🌐 3D WebGL Threat Visualizer Dashboard: Next.js 14 + WebGL 3D canvas rendering live topology, particle beams, composite risk gauges, and drilldown context drawers.
  • 📊 ML Observability & Big-Data Analytics: Integrated MLflow tracking ($T0/T1/T2$ metrics, false positives) and zero-copy DuckDB-to-Parquet export for PySpark analytics.

🚀 Quickstart — Developer Python SDK

1. Install agentsentrix

pip install agentsentrix

2. Wrap Agent Tools with @sentrix.intercept_tool()

import asyncio
import subprocess
from agentsentrix import AgentSentrixSDK, SecurityBlockError

# Initialize SDK pointing to local or cloud AgentSentrix Security Gateway
sentrix = AgentSentrixSDK(server_url="http://localhost:8000", fail_safe=True)

# Wrap any agent tool or function
@sentrix.intercept_tool(agent_id="my-langgraph-agent", action_type="shell_exec")
async def execute_command(command: str):
    # 1. SDK sends action payload to AgentSentrix Gateway
    # 2. If risk is high, execution SUSPENDS waiting for human approval on the dashboard
    # 3. If BLOCKED, raises SecurityBlockError
    return subprocess.run(command, shell=True, capture_output=True, text=True).stdout

async def main():
    try:
        output = await execute_command("cat src/main.py")
        print("Command Output:", output)
    except SecurityBlockError as err:
        print("Security Alert:", err)

if __name__ == "__main__":
    asyncio.run(main())

🔌 Alternative Interception Methods

Option A: MCP (Model Context Protocol) Server Proxy

Point your mcp.json config at the AgentSentrix Proxy:

{
  "mcpServers": {
    "git-sync": {
      "command": "agentsentrix-proxy",
      "args": ["--target", "npx", "-y", "@modelcontextprotocol/server-git"]
    }
  }
}

Option B: Terminal Shell Shim

Intercept terminal binaries (e.g. curl, git, bash) automatically:

agentsentrix shim install --binary git

🖥️ Running the AgentSentrix Core Server & 3D Visualizer

1. Start the Security Gateway Server

python -m core.agentsentrix.server.app
# Security Gateway active at http://localhost:8000

2. Launch the 3D Threat Visualizer Dashboard

cd dashboard
npm run dev
# Dashboard active at http://localhost:3000

3. Run the Multi-Agent Simulation Benchmark

python -m sim.runner

4. Launch MLflow Observability UI

mlflow ui --port 5000 --backend-store-uri sqlite:///mlflow.db
# MLflow UI active at http://localhost:5000

5. Run Parquet Security Analytics

python -m analytics.pyspark_analytics

📊 Multi-Tier Risk Engine Architecture

               +-------------------------------------------------+
               |             Agent Tool Execution                |
               +-------------------------------------------------+
                                       |
                                       v
               +-------------------------------------------------+
               |   Tier 0: YAML Policy Rules & Shannon Entropy  | (~1ms)
               +-------------------------------------------------+
                                       |
                     +-----------------+-----------------+
                     |                                   |
           High Confidence Hit                    Ambiguous Band
           (Score <=20 or >=75)                     (Score 30-70)
                     |                                   |
                     v                                   v
             [Fast-Path Exit]            +-------------------------------+
                                         | Tier 1: Local Ollama Model    | (~50ms)
                                         +-------------------------------+
                                                         |
                                                         v
                                         +-------------------------------+
                                         | Tier 2: Groq LLM-as-a-Judge   | (~300ms)
                                         +-------------------------------+
                                                         |
                                                         v
                                              [Composite Final Score]
                                                         |
          +----------------------------------------------+----------------------------------------------+
          |                                              |                                              |
          v                                              v                                              v
   [Verdict: ALLOWED]                          [Verdict: QUARANTINED]                        [Verdict: BLOCKED]
  (Execution Proceeds)                     (Suspends Awaiting Operator)                   (SecurityBlockError Raised)

🧪 Testing Suite

Run the full automated pytest suite:

pytest tests/ -v

📜 License

Distributed under the MIT License. See LICENSE for more information.

Metadata

Release files for agentsentrix 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentsentrix 0.1.1
File Size Uploaded
agentsentrix-0.1.1.tar.gz 46.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentsentrix 0.1.1
File Interpreter ABI Platform
agentsentrix-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 90.6 kB

Release files / agentsentrix-0.1.1.tar.gz

Download URL agentsentrix-0.1.1.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fc8d68ddbef7a8001c75bbb3201007f50b9b235d10b61012f4c55bd60b574449
BLAKE2b-256 checksum
How to use checksums
d8767adeddd87f5ad0233522e5f1c8570076c5a26de58ad91a31066e8046a4cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / agentsentrix-0.1.1-py3-none-any.whl

Download URL agentsentrix-0.1.1-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5ebde002e50af45a6064cc93c7edbde009149b9905357c9e55a4e45559dd7c8
BLAKE2b-256 checksum
How to use checksums
bab39374844bb642bfef9fa41cbd2dfee07708f5e42d99c11857f6f354724d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page