A security layer that sits between your AI agent and the outside world, providing six tools for input validation, output filtering, and policy enforcement. It blocks prompt injection attempts through regex patterns, redacts PII like SSNs and credit cards, prevents malicious code execution, and enforces RBAC policies with rate limiting. The audit logger captures every request with metrics and supports external handlers. You'd reach for this when you need to lock down an AI agent that handles sensitive data or operates in a regulated environment. Configuration updates happen at runtime, and the policy engine lets you block specific paths, restrict dangerous tools, or enforce maintenance windows without redeploying.
[!License: MIT](https://opensource.org/licenses/MIT) [!MCP](https://modelcontextprotocol.io) [!Node.js](https://nodejs.org)
MCP server for AI agent security guardrails. Provides input validation, prompt injection detection, PII redaction, output filtering, policy enforcement, rate limiting, and comprehensive audit logging.
| Tool | Description |
|---|---|
validate_input | Validate and sanitize incoming requests through all guardrail checks |
filter_output | Filter and redact sensitive data (PII, secrets, credentials) from responses |
check_policy | Evaluate a request against security policies (RBAC, resource access, quotas) |
get_audit_logs | Query the audit log with filtering by type, user, time range |
get_stats | Get engine statistics including active users, block rate, request counts |
update_config | Update guardrail configuration at runtime |
npm install
{
"mcpServers": {
"guardrails": {
"type": "stdio",
"command": "node",
"args": ["/path/to/guardrails-mcp-server/index.js"]
}
}
}
src/engine/GuardrailsEngine.js # Core orchestration
src/validators/InputValidator.js # Prompt injection and PII detection
src/filters/OutputFilter.js # Redaction and harmful content blocking
src/policies/PolicyEngine.js # RBAC, quotas, maintenance windows
src/audit/AuditLogger.js # Event logging and metrics
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent