Rail Score

ai.responsibleailabs由 responsibleailabs.ai 发布官方发布者v1.1.1更新于 Oct 25, 2026

Responsible-AI guardrails for agents: scoring with policy, injection & PII detection, DPDP.

已验证Streamable HTTP可网页运行安全与监控AI 与机器学习

概览

AI 生成的概览

托管式负责任 AI 护栏服务器,让助手为内容评分、检测提示注入与个人数据、拦截工具调用并检查合规。

可以做什么
按 RAIL 各维度为内容评分,可选按维度阈值执行策略并返回策略结果,也可反复重生成内容直至通过(较慢、费用更高)。检测不可信文本中的提示注入,并扫描工具输出中的个人数据与注入,返回脱敏文本。在工具调用执行前允许、警告或阻止该调用。对照 GDPR、CCPA、HIPAA、欧盟 AI 法案、印度 DPDP 与印度 AI 治理等框架检查内容。执行印度 DPDP 流程:扫描个人数据、实时放行或拦截处理,并生成证据、会话与计时。读取免费框架资源:维度列表、账户能力与策略 JSON 架构。
适用场景
当助手需要处理不可信输入或工具输出,并希望在推理流程外增加安全层时使用:筛查输入、拦截工具调用、检查草稿并产出合规证据。适合已使用 RAIL Score,或需要在助手内完成印度 DPDP 及多框架合规检查的团队。
运行要求
远程 Streamable HTTP 端点,无需安装。需要以 rail_ 开头的 RAIL API 密钥,通过 Authorization Bearer 头或 X-API-Key 头传递。各工具按次消耗额度,租户与速率限制与 REST API 相同。自托管为可选项,需要容器运行环境。
安装前请注意
工具每次调用都会消耗额度,部分工具单次消耗数个额度。rail_ 密钥属于凭据:当前阶段会被转发至上游 REST API,应按敏感信息保管。被分析的内容会发送到第三方托管服务;README 称返回的是判定结果与脱敏片段而非原文,但内容仍会离开你的边界。工具调用拦截可能阻止操作,执行前应先测试阈值。

AI 概览如何生成和校验

安装

在 SourceWeft 中

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

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/ai.responsibleailabs%2Frail-score/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "rail-score": {
      "type": "http",
      "url": "https://mcp.responsibleailabs.ai/mcp"
    }
  }
}

README

RAIL Score MCP Server

Add a responsible-AI safety layer to any agent in one URL.

A remote, hosted Model Context Protocol server that exposes RAIL Score's evaluation, agent-guardrail, and India DPDP compliance capabilities to any MCP client — Claude, ChatGPT, Cursor, Copilot, Replit Agent, LangGraph, CrewAI, or a custom stack — with zero SDK integration.

https://mcp.responsibleailabs.ai/mcp

The server is a thin, hardened gateway in front of the existing REST API at api.responsibleailabs.ai/railscore/v1/. It reimplements no scoring logic: it validates the caller, shapes requests and responses for agent ergonomics, and forwards to the engine. Credits, tenancy, and rate limits are identical via MCP and REST.

Quickstart

You need a RAIL API key (rail_...) from the dashboard.

Claude Code

claude mcp add --transport http rail https://mcp.responsibleailabs.ai/mcp \
  --header "Authorization: Bearer ${RAIL_API_KEY}"

Cursor / Windsurf (.cursor/mcp.json)

{
  "mcpServers": {
    "rail": {
      "url": "https://mcp.responsibleailabs.ai/mcp",
      "headers": { "Authorization": "Bearer rail_YOUR_KEY" }
    }
  }
}

Claude.ai / Desktop — Settings → Connectors → Add custom connector → URL https://mcp.responsibleailabs.ai/mcp, then paste your rail_ key.

More clients (OpenAI Responses API, LangGraph, Replit) are documented at docs.responsibleailabs.ai/mcp.

Tools

Nine tools, all rail_-prefixed. Descriptions state cost, latency, and when not to use a tool, because agents select tools from descriptions alone.

ToolPurposeCredits
rail_evaluateScore content across the 8 RAIL dimensions (optional policy enforcement)1.0 basic / 3.0 deep
rail_check_complianceCheck against gdpr, ccpa, hipaa, eu_ai_act, india_dpdp, india_ai_gov5–10
rail_detect_injectionDetect prompt injection in untrusted text0.5
rail_evaluate_tool_callAllow/warn/block a tool call before it runs1.5–3.0
rail_scan_tool_resultScan a tool's output for PII + injection, return redacted text0.5–1.0
rail_safe_regenerateIteratively regenerate content until it passes (slow)1–9
rail_dpdp_scanScan for Indian personal data under the DPDP Act 20230.5
rail_dpdp_gateReal-time DPDP processing gate (allow/block/require_action)0.3
rail_dpdp_complianceDPDP workflow: emit, require, evidence, session, timersvaries

Three read-only resources (free, zero credits): rail://framework/dimensions, rail://account/capabilities, and rail://framework/policy-schema (the JSON Schema for the policy parameter).

Policy enforcement

rail_evaluate accepts an optional policy of per-dimension threshold rules and returns a policy_outcome. A rule fires when a dimension scores below its threshold; action is the most severe fired action (block > flag > warn > allow), mirroring the rail-score-sdk Policy/Rule shape.

{ "rules": [
  { "dimension": "safety",   "threshold": 7.0, "action": "block" },
  { "dimension": "fairness", "threshold": 6.0, "action": "flag" }
] }

Precedence: if the API key's application has a dashboard policy enforced, that takes precedence (policy_outcome.source: "application"); otherwise the request policy is applied in-gateway (source: "request"). No extra credits.

The guarded agent loop

The canonical use is to wrap an agent's reasoning end to end:

  1. rail_detect_injection on untrusted input before acting on it
  2. rail_evaluate_tool_call before executing any tool call (block = hard stop)
  3. rail_scan_tool_result on the tool's output (prefer the redacted text)
  4. rail_evaluate (deep) on the draft answer, or rail_safe_regenerate to fix it
  5. rail_dpdp_scan (mask) on anything leaving the boundary in India deployments

Security model

A safety product that is itself unsafe is a credibility failure. The launch blockers (enforced and regression-tested):

  • Verdicts are structured data, never advisory prose an agent can ignore.
  • No reflection of analyzed content. Tools return verdicts, scores, spans, and masked excerpts — never the raw analyzed text (second-order injection).
  • No raw PII. Detection returns masked values and offsets only.
  • Tenant isolation by construction. Identity comes from the validated key in the auth middleware, never from a tool parameter.
  • No token passthrough in phase 2: client tokens are validated and dropped; downstream calls use the gateway's service credential. In phase 1 the bearer rail_ key is the customer's RAIL credential, so it is forwarded upstream to preserve per-tenant credits and isolation.
  • Input caps, timeouts, rate limits, and audit logging (no content bodies).

See tests/test_no_reflection.py and tests/test_pii_masking.py — these run as a hard CI gate.

Architecture

  • Transport: Streamable HTTP only, single /mcp endpoint (SSE is sunset).
  • State: stateless_http=True, json_response=True — scales horizontally behind a normal load balancer; aligns with the MCP 2026-07-28 stateless core.
  • Auth (phase 1): rail_ key via Authorization: Bearer rail_... or X-API-Key: rail_... (the latter is gateway-friendly — no Bearer prefix), validated once against POST /verify (cached 5 min) by auth.RailKeyMiddleware, then bound to the request context.
  • Discovery: GET /.well-known/mcp/server-card.json (public) lets registries that scan behind an auth wall (e.g. Smithery) enumerate the tools without a key.
  • Auth (phase 2): OAuth 2.1 resource server (RFC 9728 metadata, RFC 8707 audience binding) via the SDK's TokenVerifier.
rail_client.py   thin httpx client to api.responsibleailabs.ai (forwards key, propagates X-Request-ID)
auth.py          RailKeyMiddleware: validate rail_ keys, bind tenant
request_context.py  per-request ContextVars (key, tenant, request id)
server.py        FastMCP app: 9 tools + 3 resources + landing (/) + /health + server-card
server.json      official MCP registry manifest (ai.responsibleailabs/rail-score)

Local development

python -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
ruff check . && pytest          # unit + safety regression tests
RAIL_API_BASE=https://api.responsibleailabs.ai python server.py   # serves on :8080

Protocol smoke test against a running server (needs a real key):

npx @modelcontextprotocol/inspector --cli \
  http://localhost:8080/mcp --method tools/list \
  --header "Authorization: Bearer ${RAIL_API_KEY}"

Configuration

Env varDefaultPurpose
RAIL_API_BASEhttps://api.responsibleailabs.aiUpstream REST API
MCP_PORT8080Bind port
RAIL_UPSTREAM_TIMEOUT60Upstream call timeout (s)
RAIL_KEY_CACHE_TTL300Validated-key cache TTL (s)

Hosting

Responsible AI Labs operates the hosted server at https://mcp.responsibleailabs.ai/mcp — for almost everyone, just connect to that URL; you do not need to run anything.

To self-host, build the image and run it anywhere that serves HTTP; point it at the public REST API with RAIL_API_BASE (its default). No secrets are required: the customer's RAIL key arrives on each request.

docker build -t rail-score-mcp .
docker run -p 8080:8080 -e RAIL_API_BASE=https://api.responsibleailabs.ai rail-score-mcp

Registry

Published to the official MCP registry as ai.responsibleailabs/rail-score via server.json and the mcp-publisher CLI (DNS-authenticated responsibleailabs.ai namespace); a tagged GitHub release runs the publish-registry job automatically.

Third-party directories (Smithery, Glama, PulseMCP, mcp.so) index the repository and the official registry independently. Each is claimed and refreshed separately rather than syncing automatically, so listings can lag a release.

来源:README.md,提交 b81bd90

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通必需25 分

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

  • 已声明认证方式必需10 分

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

  • 已列出工具15 分

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

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

这个评分如何计算