
Rail Score
ai.responsibleailabs由 responsibleailabs.ai 發布官方發布者v1.1.1更新於 Oct 25, 2026
Responsible-AI guardrails for agents: scoring with policy, injection & PII detection, DPDP.
概覽
託管式負責任 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 相同。自架為選項,需要容器執行環境。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Rail Score,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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.
| Tool | Purpose | Credits |
|---|---|---|
rail_evaluate | Score content across the 8 RAIL dimensions (optional policy enforcement) | 1.0 basic / 3.0 deep |
rail_check_compliance | Check against gdpr, ccpa, hipaa, eu_ai_act, india_dpdp, india_ai_gov | 5–10 |
rail_detect_injection | Detect prompt injection in untrusted text | 0.5 |
rail_evaluate_tool_call | Allow/warn/block a tool call before it runs | 1.5–3.0 |
rail_scan_tool_result | Scan a tool's output for PII + injection, return redacted text | 0.5–1.0 |
rail_safe_regenerate | Iteratively regenerate content until it passes (slow) | 1–9 |
rail_dpdp_scan | Scan for Indian personal data under the DPDP Act 2023 | 0.5 |
rail_dpdp_gate | Real-time DPDP processing gate (allow/block/require_action) | 0.3 |
rail_dpdp_compliance | DPDP workflow: emit, require, evidence, session, timers | varies |
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:
rail_detect_injectionon untrusted input before acting on itrail_evaluate_tool_callbefore executing any tool call (block = hard stop)rail_scan_tool_resulton the tool's output (prefer the redacted text)rail_evaluate(deep) on the draft answer, orrail_safe_regenerateto fix itrail_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
/mcpendpoint (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 viaAuthorization: Bearer rail_...orX-API-Key: rail_...(the latter is gateway-friendly — no Bearer prefix), validated once againstPOST /verify(cached 5 min) byauth.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 var | Default | Purpose |
|---|---|---|
RAIL_API_BASE | https://api.responsibleailabs.ai | Upstream REST API |
MCP_PORT | 8080 | Bind port |
RAIL_UPSTREAM_TIMEOUT | 60 | Upstream call timeout (s) |
RAIL_KEY_CACHE_TTL | 300 | Validated-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版本歷史
1- v1.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式必需10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分