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

# PolicyInfer

> **Required scope:** write

**Required scope:** `write`

### Request body

`PolicyInferRequest`

<ParamField body="org_id" type="string" />

<ParamField body="tool_input" type="any" required />

<ParamField body="tool_name" type="string" required />

### Response

`PolicyInferResponse`

<ResponseField name="confidence" type="number (double)" required />

<ResponseField name="decision" type="string" required />

<ResponseField name="processing_time_ms" type="integer (int64)" required />

<ResponseField name="proof_trace" type="ProofNode[]" required>
  <Expandable title="ProofNode">
    <ResponseField name="input" type="string" required />

    <ResponseField name="log_prob" type="number (double)" required />

    <ResponseField name="position" type="integer" required />

    <ResponseField name="symbol" type="string" required />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Policy inference result                            |
| `400` | Invalid request                                    |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |
| `500` | Internal server error                              |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/policy/infer' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "tool_input": null,
    "tool_name": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "confidence": 7.5,
    "decision": "string",
    "processing_time_ms": 250,
    "proof_trace": [
      {
        "input": "string",
        "log_prob": 1.5,
        "position": 1,
        "symbol": "string"
      }
    ]
  }
  ```
</ResponseExample>
