AgentSentrix 🛡️⚡
Real-Time Agentic Security Gateway, Multi-Tier Risk Engine & 3D WebGL Threat Visualizer
💡 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.
- Python SDK Middleware: Wrap any Python tool call or function with a single decorator
- 🌐 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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentsentrix-0.1.0.tar.gz | 46.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentsentrix-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.6 kB
Release files / agentsentrix-0.1.0.tar.gz
| Download URL | agentsentrix-0.1.0.tar.gz |
|---|---|
| Size | 46.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b087c623f81a28c27638f9b2467d8716d46bb6840e5ff49a0d864ed78e3d185
|
|
BLAKE2b-256 checksum How to use checksums |
79a44f204c100a71825ba41a35cea9e9a98d27987a8b2f27ec86cda08d90e1c7
|
| 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.0-py3-none-any.whl
| Download URL | agentsentrix-0.1.0-py3-none-any.whl |
|---|---|
| Size | 43.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3713518fc186fa29fe8155d327f09469c3b42bade11b377a603e42f267b4635e
|
|
BLAKE2b-256 checksum How to use checksums |
2b4aa1427d9aa44069e4b3bcdf653eafc14e3ce93c6c53a970ec06ecd9d13a84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|