
ROCmShield is an enterprise-grade, local-first security proxy that intercepts every tool call between AI coding assistants (Cursor, Claude Code) and Model Context Protocol (MCP) servers. It solves a critical gap: AI agents can run `rm -rf /` or exfiltrate `.env` files with no audit trail. We built a three-layer defense pipeline. Layer 1 — Static Policy Engine: A local `policy.yaml` defines allow/deny/ask rules with regex on tool name, arguments, and paths. Known-safe commands pass through in under 5ms. Known-bad patterns (`rm -rf`, `sudo`) are blocked instantly. Layer 2 — Semantic LLM Evaluator: When a command doesn't match any static rule, it's passed to a local Llama-3-8B model running on AMD ROCm. The model classifies intent as ALLOW, DENY, or ESCALATE, catching obfuscated attacks regex cannot express — base64-encoded `rm -rf`, `${IFS}` substitution, `curl | bash` exfiltration. For the hackathon MVP, this slot is filled by a deterministic `MockLlmEvaluator` that catches these patterns via heuristics. The real Llama-3-8B integration is code-complete; AMD GPU pod time was exhausted during the build window, and Developer Cloud credits are pending manual approval. Swapping the mock for the real evaluator is a single constructor call — no architectural changes required. Layer 3 — SQLite Audit Logging: Every decision is recorded to a local SQLite database with full context (tool name, arguments, decision, evaluator, reason, timestamp). Security teams can export logs as JSONL via the `rocmshield audit export` subcommand. Built in Rust with Tokio. 34 unit + integration tests passing, including end-to-end tests that verify obfuscated base64 commands are blocked. Containerized via multi-stage Docker build (non-root, OCI-labeled). clippy::pedantic clean. Zero external API calls — no data leaves the host. The engine crate forbids network crates. Every enterprise using AI coding agents needs this security layer.
13 Jul 2026