मुख्य सामग्री पर जाएं
Agent Evaluation agentic AI systems के लिए तीन safety checkpoints देता है: tool calls को execute होने से पहले evaluate करें, tool results को agent के पास वापस जाने से पहले scan करें, और जिस भी text को agent process करने वाला है उसमें prompt injection पकड़ें। यह उन systems के लिए है जहाँ कोई AI agent खुद tools (functions, APIs, retrieval) call कर सकता है। अगर आपकी application सिर्फ़ text generate करती है, तो आप इसे छोड़कर Evaluation use कर सकते हैं। अगर आप agents बनाते हैं, तो ये checkpoints उन जगहों की रक्षा करते हैं जहाँ कोई agent कोई action ले सकता है या उससे प्रभावित हो सकता है।

तीन checkpoints

Tool Call Evaluation

tool चलने से पहले ALLOW / FLAG / BLOCK।

Tool Result Scanning

tool output पर PII detection और injection check।

Prompt Injection Detection

किसी भी input text पर तेज़ injection scan।
इन्हें उसी क्रम में लगाएं जिस क्रम में agent चलता है: पहले आने वाले input पर injection पकड़ें, फिर किसी tool call को execute होने से पहले evaluate करें, फिर tool result को agent के पास लौटने से पहले scan करें। आप एक checkpoint अपना सकते हैं या तीनों; अगर एक से शुरू कर रहे हैं, तो user input पर prompt-injection detection सबसे ज्यादा सुरक्षा देती है।

Quick example

from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

# 1. Check for injection in user input
injection = client.agent.detect_injection(text=user_input)
if injection.injection_detected:
    return "Invalid input detected."

# 2. Evaluate tool call before execution
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. Execute the tool, then scan the result
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 का पूरा specification।

Python SDK: Agent Evaluation

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