mcpField
G
guardrails

guardrails

Local
github.com/ExpertVagabondSecurity1Updated 9w ago

About guardrails

guardrails is an MCP server that adds security checks for AI agents. It validates inputs, filters outputs, enforces policies, limits request rates, and records audit events.

Key features

  1. 01Input validation and sanitization
  2. 02Prompt injection detection
  3. 03PII and secret redaction
  4. 04Policy checks and rate limiting
  5. 05Audit logs and runtime configuration

Use cases

  1. 01Screening agent requests for injection attempts
  2. 02Removing sensitive data from responses
  3. 03Applying access rules and request quotas

MCP support

It exposes guardrail operations to MCP clients through tools for input validation, output filtering, policy checks, audit queries, statistics, and configuration updates.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"expertvagabond-guardrails": {
"command": "npx",
"args": [
"-y",
"guardrails-mcp-server"
]
}
}
}
Run commandnpx -y guardrails-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmguardrails-mcp-server1.0.1

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

guardrails-mcp-server

[!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.

Tools

ToolDescription
validate_inputValidate and sanitize incoming requests through all guardrail checks
filter_outputFilter and redact sensitive data (PII, secrets, credentials) from responses
check_policyEvaluate a request against security policies (RBAC, resource access, quotas)
get_audit_logsQuery the audit log with filtering by type, user, time range
get_statsGet engine statistics including active users, block rate, request counts
update_configUpdate guardrail configuration at runtime

Security Features

  • Prompt Injection Detection -- 12 regex patterns for jailbreak, DAN mode, system prompt override
  • PII Detection and Redaction -- SSN, credit card, email, phone, IP, API keys, AWS keys, JWT, passwords, private keys, connection strings
  • Malicious Code Blocking -- eval, exec, subprocess, child_process, shell injection
  • Policy Engine -- Block sensitive paths, dangerous tools, unauthenticated destructive ops, URL allowlist, maintenance windows
  • Rate Limiting -- Per-user sliding window (configurable requests/minute)
  • Audit Logging -- Timestamped events with metrics, log rotation, external handler support

Install

npm install

Configuration

{
  "mcpServers": {
    "guardrails": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/guardrails-mcp-server/index.js"]
    }
  }
}

Project Structure

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

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.