Skip to main content
1

Get your API key

  1. Sign up for a free account.
  2. Open your Dashboard.
  3. Click Generate Key in the API Keys section.
Copy your key immediately. It starts with rail_ and will not be shown again.
2

Verify your key

curl https://api.responsibleailabs.ai/health
Response
{ "status": "healthy", "service": "rail-score-engine" }
3

Install an SDK

pip install rail-score-sdk
4

Score your first response

Send a piece of AI-generated content and get back a RAIL score. Here we evaluate a typical support-bot reply.
from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

result = client.eval(
    content="To reset your password, open Settings, choose Security, and "
            "select Reset password. We will email you a secure link that "
            "expires in 30 minutes.",
    mode="basic",
)

print(f"RAIL Score: {result.rail_score.score}/10")
for dim, scores in result.dimension_scores.items():
    print(f"  {dim}: {scores.score}/10")
Response
{
  "result": {
    "rail_score": { "score": 7.6, "confidence": 0.51, "summary": "RAIL Score: 7.6/10 — Good" },
    "dimension_scores": {
      "fairness":       { "score": 7.7, "confidence": 0.84 },
      "safety":         { "score": 10.0, "confidence": 0.70 },
      "reliability":    { "score": 7.7, "confidence": 0.16 },
      "transparency":   { "score": 6.5, "confidence": 0.50 },
      "privacy":        { "score": 8.0, "confidence": 0.59 },
      "accountability": { "score": 6.6, "confidence": 0.97 },
      "inclusivity":    { "score": 6.6, "confidence": 0.74 },
      "user_impact":    { "score": 7.8, "confidence": 0.09 }
    },
    "from_cache": false
  },
  "policy_outcome": { "enforcement": "block", "threshold": 7.0, "score": 7.6, "passed": true, "enforced": false },
  "metadata": { "req_id": "b00379a5-d6a7-45d6-905c-82925666a616", "mode": "basic" }
}
Reading the response:
  • rail_score.score — the overall score, 0–10, a weighted average of the eight dimensions. Here 7.6 is in the Good band.
  • dimension_scores — the score and confidence for each of the eight RAIL dimensions. The lower scores here (transparency, accountability, inclusivity around 6.6) point to what to improve: the reply does not say who to contact or what happens if the email never arrives.
  • policy_outcome — how your application’s policy judged this result: the threshold to pass, whether it passed, and whether enforcement is currently active. Here it is in monitor mode (enforced: false), so the verdict is reported but the response is not changed.
5

Go deeper with deep mode

Basic mode tells you the scores. Deep mode runs a more detailed analysis of the same content and adds a per-dimension explanation, issue tags, and improvement suggestions, so you can see why a dimension scored the way it did.
result = client.eval(
    content="To reset your password, open Settings, choose Security, and "
            "select Reset password. We will email you a secure link that "
            "expires in 30 minutes.",
    mode="deep",
    include_explanations=True,
    include_issues=True,
)

for dim, scores in result.dimension_scores.items():
    print(f"{dim}: {scores.score}/10 — {scores.explanation}")
Response (excerpt)
{
  "result": {
    "rail_score": { "score": 8.1, "confidence": 0.77, "summary": "RAIL Score: 8.1/10 — Good" },
    "dimension_scores": {
      "transparency": {
        "score": 7.0, "confidence": 0.8,
        "explanation": "The process is mostly clear, but more details on security could help.",
        "issues": ["Lack of detailed security information"]
      },
      "safety": {
        "score": 8.0, "confidence": 0.8,
        "explanation": "The process includes a secure link, but users must be cautious of phishing.",
        "issues": ["Potential phishing risks"]
      }
    },
    "issues": [
      { "dimension": "safety", "description": "Potential phishing risks" },
      { "dimension": "transparency", "description": "Lack of detailed security information" }
    ]
  },
  "metadata": { "mode": "deep" }
}
Each dimension now carries an explanation and issues, and the response gathers all flagged issues under a top-level issues array, ready to surface in a review queue or dashboard.

What’s next

Concepts: Evaluation

Understand basic vs deep mode, scoring tiers, and custom weights.

Concepts: Safe Regeneration

Auto-fix content that scores below your thresholds.

Integrations

Wrap your OpenAI, Anthropic, or Gemini calls with automatic RAIL scoring.

Python SDK

Full SDK reference with sync/async clients.