Skip to main content
Added in SDK 2.6.0. Every API key is bound to an application whose governance policy is configured centrally in the dashboard. These three methods let your code read that configuration at runtime — useful for startup checks, dashboards, and monitoring. They are read-only and consume no credits.

Application configuration

get_config() returns the application the key is bound to, its governance policy, and whether enforcement is actively shaping responses or only observing them.
from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

cfg = client.get_config()

print(f"Application: {cfg.application.id} ({cfg.application.environment})")
print(f"Plan:        {cfg.application.plan}")
print(f"Enforcement: {cfg.policy.enforcement}")   # log_only | block | regenerate
print(f"Eval mode:   {cfg.policy.eval_mode}")      # basic | deep
print(f"Threshold:   {cfg.policy.overall_threshold}")
print(f"Mode:        {cfg.enforcement.mode}")      # enforce | monitor

if cfg.policy.locked:
    print("Policy is locked by an administrator; per-request overrides are ignored.")

Plan capabilities

get_capabilities() reports what the key’s plan can access — evaluation modes, compliance frameworks, agent and DPDP features, and request limits. Use it to adapt behavior without hard-coding plan assumptions.
caps = client.get_capabilities()

print(f"Plan: {caps.plan}")
print(f"Frameworks: {caps.compliance.get('frameworks')}")
print(f"DPDP evidence available: {caps.dpdp.get('evidence')}")   # Pro+ only
print(f"Requests/day: {caps.limits.get('requests_per_day')}")     # None = unlimited

Dimension metadata

get_dimensions() returns the eight RAIL dimensions with the weight and threshold configured for your application, plus the score bands a result falls into.
dims = client.get_dimensions()

for d in dims.dimensions:
    print(f"{d.get('name'):14} weight={d.get('weight')} threshold={d.get('threshold')}")

for band in dims.score_bands:
    print(band.get("band"), ">=", band.get("min"))
Each typed result also exposes a .raw dict with the unmodified response, so new fields are always reachable even before the SDK adds a typed accessor.

Async

The async client exposes the same three methods:
import asyncio
from rail_score_sdk import AsyncRAILClient

async def main():
    client = AsyncRAILClient(api_key="YOUR_RAIL_API_KEY")
    caps = await client.get_capabilities()
    print(caps["plan"])  # async client returns raw dicts

asyncio.run(main())

Configuration API

The REST endpoints behind these methods.

Policy Engine

How enforcement, thresholds, and locking work.