Guardrails

io.github.ExpertVagabond由 GitHub 账号 ExpertVagabond 发布v1.0.1更新于 Oct 24, 2026

AI Agent Guardrails MCP server - security layer

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

一个本地 MCP 服务器,为 AI 代理增加安全护栏层:输入校验、提示注入检测、PII 脱敏、策略检查与审计日志。

可以做什么
通过全部护栏检查校验并清理传入请求,包括提示注入检测和恶意代码拦截。过滤并脱敏响应中的敏感数据,如 PII、密钥和凭据。按 RBAC、资源访问和配额等安全策略评估请求。按类型、用户和时间范围查询审计日志,并读取活跃用户、拦截率和请求数等引擎统计。在运行时更新护栏配置。
适用场景
适合助手或代理处理不可信输入、需要本地检查点来筛查请求、脱敏敏感输出并保留审计记录的场景。也适用于需要策略执行、速率限制或记录被拦截请求的部署。
运行要求
作为本地 stdio 进程在用户机器上运行,从 npm 包 guardrails-mcp-server 安装,并用 Node.js 启动。README 给出指向服务器 index.js 路径的手动配置示例。未声明认证、环境变量或请求头。
安装前请注意
服务器会检查并脱敏敏感内容,可能处理传输中的 PII、凭据和私钥,需确认日志存放位置。update_config 工具会在运行时更改护栏设置,审计日志会记录用户活动。检测基于正则表达式,可能漏掉新型攻击或误报正常内容。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Guardrails,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

bash
npm install

Configuration

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

Project Structure

src/engine/GuardrailsEngine.js    # Core orchestrationsrc/validators/InputValidator.js   # Prompt injection and PII detectionsrc/filters/OutputFilter.js        # Redaction and harmful content blockingsrc/policies/PolicyEngine.js       # RBAC, quotas, maintenance windowssrc/audit/AuditLogger.js           # Event logging and metrics

License

MIT

来源:README.md,提交 2ecb5e7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分