मुख्य सामग्री पर जाएं
Agent Evaluation agentic AI systems के लिए तीन safety checkpoints देता है: tool calls को execution से पहले evaluate करो, tool results को agent को वापस भेजने से पहले scan करो, और किसी भी text में prompt injection detect करो जो agent process करने वाला है।

तीन Checkpoints

Tool Call Evaluation

Tool run होने से पहले ALLOW / FLAG / BLOCK। 1.5–3.0 credits।

Tool Result Scanning

Tool output पर PII detection + injection check। 0.5–1.0 credits।

Prompt Injection Detection

किसी भी input text पर fast injection scan। 0.5 credits।

Quick example

from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

# 1. User input में injection check करो
injection = client.agent.detect_injection(text=user_input)
if injection.injection_detected:
    return "Invalid input detected."

# 2. Execution से पहले tool call evaluate करो
tool_check = client.agent.evaluate_tool_call(
    tool_name="send_email",
    tool_input={"to": "user@example.com", "body": agent_draft},
    agent_context="Customer support agent",
)
if tool_check.recommendation == "block":
    return f"Tool call blocked: {tool_check.explanation}"

# 3. Tool execute करो, फिर result scan करो
tool_output = execute_tool(tool_name, tool_input)
result_scan = client.agent.scan_tool_result(
    tool_name="send_email",
    tool_result=tool_output,
)
if result_scan.pii_detected:
    tool_output = result_scan.redacted_result

आगे क्या करें

API Reference: Tool Call

Tool call evaluation की full specification।

Python SDK: Agent Evaluation

तीनों agent endpoints के लिए Python SDK reference।