Works with the AI Agents you already use
MCP Security & Sandbox Auditor
by ishaan phaye
Battle-tested 8-domain security & concurrency audit skill for MCP servers, AI agent tool harnesses, and container sandboxes.
Free
MCP Security & Sandbox Auditor
Example session with this skill installed
Run a complete security and sandbox audit of our local Model Context Protocol (MCP) server (mcp-server/index.ts, runtime/sandbox.py, and Dockerfile). Inspect the tool execution boundaries, network egress, path sanitization, and container hardening against zero-trust standards.
- Read your context and instructions
- Compiled the mcp security
I have completed a systematic security and isolation audit of your MCP server implementation and sandbox runtime across all 8 security domains.
MCP Security & Sandbox Audit Report
Release Gate Verdict: NO-GO
Finding Breakdown: 2 Critical (P0) · 2 High (P1) · 1 Medium (P2) · 0 Low (P3)
Invariant Scorecard
| Domain | Target File(s) | Status | Verdict |
|---|---|---|---|
| 1. Path Traversal & Encodings | mcp-server/tools/fs.ts | ❌ FAIL | Prefix collision allows /workspace-evil access |
| 2. Sandbox & Kernel Hardening | runtime/sandbox.py, Dockerfile | ❌ FAIL | read_only rootfs and seccomp profile omitted |
| 3. Fail-Closed Execution | runtime/sandbox.py | ❌ FAIL | Silent fail-open to host subprocess.run() |
| 4. Cgroups & Resource Limits | runtime/sandbox.py | ⚠️ PARTIAL | Memory cap active; swap and pids_limit missing |
| 5. SSRF & Egress Controls | mcp-server/tools/http.ts | ❌ FAIL | IPv4-mapped IPv6 & 3xx redirects bypass filter |
| 6. IPC Bridge Security | runtime/bridge.py | ✅ PASS | Strictly bound to 127.0.0.1; CORS disabled |
| 7. Concurrency & Locking | runtime/pool.py | ✅ PASS | Non-blocking spawns outside checkout mutex |
| 8. Context Window Safety | mcp-server/utils/truncate.ts | ⚠️ PARTIAL | Truncation cuts multi-byte UTF-8 codepoints |
Prioritized Findings & Remediation Diffs
1. [P0] Silent Fail-Open to Host Subprocess (CRIT-01)
- Location:
runtime/sandbox.py:42 - Root Cause: Container launch failure falls back to host execution inside an unhandled
exceptblock. - Impact: Any Docker daemon timeout or error silently runs arbitrary LLM bash commands directly on the host machine.
- Minimal Fix:
--- a/runtime/sandbox.py
+++ b/runtime/sandbox.py
@@ -42,3 +42,3 @@
except Exception as exc:
- return subprocess.run(cmd, shell=True, capture_output=True)
+ raise RuntimeError(f"Sandbox execution failed closed: {exc}") from exc
- Verification Test: Assert
RuntimeErroris raised when Docker daemon is stopped:pytest tests/test_security.py::test_fail_closed_on_daemon_error.
2. [P0] Omitted Seccomp & Writable Root Filesystem (CRIT-02)
- Location:
runtime/sandbox.py:68 - Root Cause:
client.containers.run()is invoked withoutread_only=Trueorsecurity_opt=["no-new-privileges:true"]. - Impact: Malicious code executing in the container can modify system binaries or attempt privilege escalation.
- Minimal Fix:
--- a/runtime/sandbox.py
+++ b/runtime/sandbox.py
@@ -68,2 +68,5 @@
image="sandbox-worker:latest",
+ read_only=True,
+ tmpfs={"/tmp": "rw,noexec,nosuid,size=16m"},
+ security_opt=["no-new-privileges:true", f"seccomp={seccomp_profile_json}"],
3. [P1] Boundary Escape via Prefix Collision (HIGH-01)
- Location:
mcp-server/tools/fs.ts:24 - Root Cause: Path validation uses bare string prefix
target.startsWith(workspaceDir). - Impact: Access to
/workspace-privateor/workspace_secretsis allowed because/workspaceis a prefix. - Minimal Fix:
--- a/mcp-server/tools/fs.ts
+++ b/mcp-server/tools/fs.ts
@@ -24,2 +24,3 @@
- if (!resolved.startsWith(workspaceRoot)) {
+ const boundary = workspaceRoot.endsWith("/") ? workspaceRoot : `${workspaceRoot}/`;
+ if (resolved !== workspaceRoot && !resolved.startsWith(boundary)) {
throw new Error("Path traversal outside workspace");
4. [P1] SSRF Bypass via IPv4-Mapped IPv6 & Redirects (HIGH-02)
- Location:
mcp-server/tools/http.ts:38 - Root Cause:
fetch()follows 3xx redirects automatically and does not normalize::ffff:127.0.0.1or[::ffff:7f00:1]. - Impact: Allows attacker to pivot through the tool harness to hit AWS/GCP instance metadata (
169.254.169.254) or localhost microservices. - Minimal Fix: Set
redirect: "manual", loop through max 3 hops re-validating theLocationheader, and unpack::ffff:IP representations prior to subnet checking.
Uninspected Files Checklist
-
docker/seccomp-profile.json(Verify dangerous syscalls likeptrace,unshare, andbpfare blocked) -
mcp-server/package.json(Verify@modelcontextprotocol/sdkversion is patched against known CVEs)
Recommended Next Steps
- Apply the 4 minimal diffs above.
- Run
pytest tests/test_security.pyandnpm testto verify regression prevention. - Re-run
mcp-security-auditorto verify cleanGOverdict before opening the server to untrusted tools.
Connects securely to your tools. The creator never sees your data.
About this skill
Audits Model Context Protocol (MCP) servers, tool-calling agent harnesses, and micro-container sandboxes for real-world isolation bypasses, security vulnerabilities, and concurrency bottlenecks—going beyond README claims and mocked unit tests.
What it checks (8-Domain Rubric):
-
Path Traversal & Encodings: Multi-pass URI decoding, null bytes, Unicode NFKC normalization, Windows drive/UNC paths, and symlink/prefix-collision escapes.
-
Container & Kernel Hardening: Verifies read_only rootfs, noexec /tmp tmpfs, cap_drop=["ALL"], no-new-privileges, non-root UID/GID, and wired custom Seccomp-BPF profiles.
-
Fail-Closed Execution & Watchdogs: Catches silent fail-open fallbacks to host subprocesses and GNU timeout exit-code collisions (124 vs 137 OOM kills).
-
Cgroups & Resource Ceilings: Swap-thrashing immunity (memswap_limit == mem_limit), PIDs limits for fork-bomb containment, and CPU quotas.
-
SSRF & Egress Controls: Blocks RFC-1918, loopback, cloud metadata (169.254.169.254), CGNAT (100.64.0.0/10), IPv4-mapped IPv6 (::ffff:127.0.0.1), 3xx redirects, and DNS rebinding.
-
IPC & Localhost Bridge Security: Strict 127.0.0.1 binding, wildcard CORS exposure, and ephemeral workspace cleanup on teardown.
-
Concurrency & Pool Locking: Detects blocking container/process spawns held inside asyncio.Lock or mutexes that cause checkout starvation.
-
Context-Window & UTF-8 Safety: Hard output truncation with UTF-8 continuation-byte scanning to prevent \uFFFD corruption.
Output: Produces a prioritized GO / CONDITIONAL GO / NO-GO scorecard (P0–P3) with exact file paths, exploit scenarios, minimal remediation diffs, and verification tests.
Requires access to implementation code and configuration files. Does not perform active network fuzzing or live exploit attempts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 12 days ago
- Free with an Agensi account
Nothing to install. It runs in your AI agent.
- Optional
Docker
Runs purely as an in-session architectural and code auditor. No API keys, database credentials, or external accounts required.
Permissions
File Scopes
Read access is used exclusively for offline inspection of MCP tool definitions, IPC bridges, container launch arguments, and Dockerfiles. The audit operates completely within your local agent session with zero telemetry, zero data egress, and no modification of your codebase without explicit request.
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.