OpenAgentShield
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenAgentShieldcheck if this shell command is safe: echo hi; reboot"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ก๏ธ OpenAgentShield โ Zero-Trust Security Gateway for Autonomous AI Agents
The Open-Source Security Firewall & AST Sandbox for AI Agent Tool Calls and Model Context Protocol (MCP) Middleware.
Engineered by KGiSL Campus Solvers โข Lead Maintainer: Nandhakumar M (Google Student Ambassador, B.E. CSE Cyber Security)
๐ The Global Real-World Challenge
Autonomous AI agents (Claude Code, Google Antigravity, Cursor, AutoGPT, Windsurf) are rapidly gaining write and shell execution powers on developer workstations, cloud infrastructure, and connected hardware (e.g. Android ADB devices).
However, indirect prompt injection, malicious supply chains, and LLM hallucinations can lead to disastrous real-world outcomes:
Catastrophic System Deletion: AI executing
rm -rf /or recursive deletions.Shell Command Injections: Chained shell payloads (
; reboot,| sh,&& rm) escaping caller arguments (e.g. Google Artemis Issue #55).Credential Exfiltration: Leaking
.envAPI keys, SSH private keys, or GitHub personal access tokens back into public LLM completions or logs.
OpenAgentShield acts as a high-performance, transparent proxy firewall between AI agents and underlying system tools, intercepting every invocation in micro-seconds to enforce zero-trust security policies.
Related MCP server: SentinelGate
๐๏ธ Architecture Overview
[ Autonomous AI Agent / MCP Client ]
(Claude Code / Antigravity / Cursor)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenAgentShield Core โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 1. AST Shell Guard & Injection โ
โ 2. Secret & PII Redaction โ
โ 3. Sensitive File Boundaries โ
โ 4. Cryptographic Audit Hasher โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
[ Action Verdict ]
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โผ โผ โผ
[๐ BLOCK] [๐ REDACT] [โ
ALLOW]
Denied & Logged Sanitized & Run Safe Executionโจ Core Defense Modules
1. ๐ Shell AST & Command Injection Guard
Tokenizes shell invocations and detects dangerous system binaries (
mkfs,dd,fdisk,reboot,shutdown).Mitigates subshell chaining (
;,&&,|,`,$()).Validates Android package names against strict reverse-domain grammar (
^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$), eliminating ADB injection vectors.
2. ๐ Zero-Leak Secret Sanitizer
Scans input/output payloads for Google Cloud API keys, OpenAI keys, Anthropic keys, GitHub tokens (
ghp_,github_pat_), AWS credentials, and RSA private keys.Automatically substitutes detected tokens with zero-knowledge markers (e.g.
[REDACTED:GOOGLE_API_KEY]) before payloads touch logging or external agents.
3. ๐ Sensitive File System Boundary
Blocks unauthorized reads and edits to
.env,.aws/credentials,/etc/passwd,/etc/shadow, andid_rsakeys.
4. โก MCP Middleware Decorator
Provides
@interceptor.protect_toolto wrap any Model Context Protocol (MCP) server tool asynchronously with zero latency overhead.
๐ Quickstart & Interactive Simulation
1. Install Dependencies
pip install -r requirements.txt2. Run the Interactive Attack & Defense Simulation
python app.pyExecutes live inspection across 6 representative real-world attack scenarios (CVE-style destructive rm, shell chaining, ADB injection, credential exfiltration, and sensitive file reading).
๐ป Python Usage Example
from agent_shield import AgentFirewall, ActionVerdict
# Initialize zero-trust firewall
firewall = AgentFirewall()
# Inspect an agent tool invocation before running it
result = firewall.inspect_tool_call(
tool_name="run_command",
arguments={"CommandLine": "echo 'Hello'; reboot"}
)
if result.verdict == ActionVerdict.BLOCK:
print(f"Attack Blocked! Reasons: {result.reasons}")
else:
print("Action approved for execution.")Protecting Model Context Protocol (MCP) Tools
from agent_shield import MCPInterceptor
interceptor = MCPInterceptor()
@interceptor.protect_tool("execute_command")
async def execute_command(CommandLine: str):
# This function will NEVER run if CommandLine contains dangerous or malicious syntax
return os.system(CommandLine)๐งช Verification & Automated Tests
OpenAgentShield maintains 100% test pass rates across all security assertion vectors:
pytest tests/test_firewall.pyOutput:
tests/test_firewall.py ......... [100%]
============================== 9 passed in 0.14s ==============================๐ค Global Contributor Roadmap
We welcome student developers and security researchers worldwide:
eBPF Kernel Sandboxing: Linux kernel level process confinement for agent bash subshells.
Real-Time Web Dashboard: FastAPI + React telemetry dashboard with live agent risk visualizer.
LangChain / CrewAI Middleware: Drop-in callbacks for popular Python agent frameworks.
Adversarial Benchmark Dataset: 100+ standardized red-teaming test cases for LLM agent jailbreaks.
Part of the KGiSL Campus Solvers open-source ecosystem. Built with โค๏ธ in Coimbatore, India for the global developer community.
This server cannot be deployed
Maintenance
Related MCP Connectors
Security firewall for AI agents โ scans MCP calls for injection, secrets, and risks.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
AgentGuard โ 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
- gatewayOAuthai.sealgate
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA transparent proxy and execution firewall that intercepts and audits AI agent tool calls against configurable security policies before forwarding them to downstream MCP servers. It provides safe execution environments with features like data redaction, anti-loop protection, and unified alert dispatching.-

SentinelGateofficial
AlicenseNot gradedqualityAmaintenanceOpen-source MCP proxy that enforces security policies, content scanning, and audit logging between AI agents and tool servers25AGPL 3.0- AlicenseNot gradedqualityDmaintenanceA defensive gateway and firewall for AI agents using MCP servers, scanning tool calls, responses, and manifests for prompt injection, secrets, dangerous commands, and drift before allowing execution.MIT
- AlicenseNot gradedqualityBmaintenanceSecurity scanner and runtime proxy for MCP servers. Catches tool poisoning, prompt injection, and rug-pull attacks (silent tool description changes) before they reach your AI agent. Includes a static scanner and a runtime stdio proxy.59 npmMIT