跳转到主要内容

Parameters

tool_name
string
必填
Name of the tool that produced this result.
tool_result
string
必填
The raw output returned by the tool.
agent_context
string
Description of the agent’s role and current task.
redact_pii
boolean
默认值:"true"
If true, returns a redacted version of the result with PII replaced by placeholders.

Request

curl -X POST https://api.responsibleailabs.ai/railscore/v1/agent/scan-tool-result \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "tool_name": "search_database",
    "tool_result": "Customer John Smith (SSN: 123-45-6789) called on 2026-03-15.",
    "redact_pii": true
  }'

Response

{
  "result": {
    "pii_detected": true,
    "injection_detected": false,
    "risk_level": "medium",
    "pii_types": ["full_name", "ssn"],
    "redacted_result": "Customer [NAME] (SSN: [REDACTED]) called on 2026-03-15.",
    "recommendation": "warn"
  },
  "credits_consumed": 0.5
}
result.pii_detected
boolean
true if personally identifiable information was found in the tool result.
result.injection_detected
boolean
true if a prompt injection attempt was detected in the tool output.
result.pii_types
string[]
Types of PII found: full_name, email, phone, ssn, credit_card, address, date_of_birth, etc.
result.redacted_result
string
The tool result with PII replaced by type placeholders. Only present when redact_pii=true.
result.recommendation
string
Suggested action: "allow", "warn", or "block".