> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent : Évaluation des appels d'outils

> POST /railscore/v1/agent/tool-call -- Évaluer un appel d'outil avant son exécution.

<Info>
  **Concept :** [Évaluation des agents](/concepts/agent-evaluation) | **Python :** [`client.agent.evaluate_tool_call()`](/sdk/python/agent-evaluation)
</Info>

## Paramètres

<ParamField body="tool_name" type="string" required>
  Nom de l'outil appelé.
</ParamField>

<ParamField body="tool_params" type="object" required>
  Paramètres transmis à l'outil.
</ParamField>

<ParamField body="agent_context" type="object">
  Rôle et tâche actuelle de l'agent. Objet avec champs optionnels : `goal` (chaîne), `prior_tool_calls` (tableau d'objets), `agent_id` (chaîne), `turn_index` (entier).
</ParamField>

<ParamField body="domain" type="string" default="general">
  Indication de domaine pour affiner l'évaluation (par exemple, `finance`, `healthcare`).
</ParamField>

<ParamField body="mode" type="string" default="basic">
  Profondeur d'évaluation : `basic` ou `deep`.
</ParamField>

<ParamField body="compliance_frameworks" type="string[]">
  Cadres à vérifier (par exemple, `india_dpdp`, `gdpr`).
</ParamField>

<ParamField body="custom_thresholds" type="object">
  Remplacer les seuils de décision. Objet avec champs optionnels : `block_below` (nombre 0-10), `flag_below` (nombre 0-10), `dimension_minimums` (objet de dimension → score minimum).
</ParamField>

## Requête

```bash theme={null}
curl -X POST https://api.responsibleailabs.ai/railscore/v1/agent/tool-call \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "tool_name": "send_email",
    "tool_params": {"to": "admin@company.com", "body": "Click: http://suspicious.com"},
    "agent_context": {"goal": "Customer support chatbot resolving a ticket"}
  }'
```

## Réponse

```json theme={null}
{
  "decision": "BLOCK",
  "decision_reason": "Suspicious URL detected in email body.",
  "event_id": "evt_1a2b3c4d",
  "rail_score": {"score": 2.4, "confidence": 0.82, "summary": "High-risk tool call."},
  "dimension_scores": {"safety": {"score": 2.1}},
  "compliance_violations": [],
  "suggested_params": null,
  "policy": {"block_below": 3.0, "flag_below": 5.0, "threshold_source": "default"},
  "context_signals": {"tool_risk_level": "high"},
  "credits_consumed": 1.0,
  "evaluation_depth": "basic",
  "evaluated_at": "2026-06-25T10:00:00Z"
}
```

<ResponseField name="decision" type="string">
  `"ALLOW"`, `"FLAG"`, ou `"BLOCK"`. Une décision `BLOCK` retourne HTTP 403 ; `ALLOW`/`FLAG` retournent 200.
</ResponseField>

<ResponseField name="decision_reason" type="string">
  Explication lisible de la décision.
</ResponseField>

<ResponseField name="rail_score" type="object">
  `score` (0-10), `confidence` (0-1), et une chaîne `summary`.
</ResponseField>

<ResponseField name="suggested_params" type="object">
  Valeurs de paramètres plus sûres lorsque le moteur peut les proposer, sinon `null`.
</ResponseField>
