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

# Migrate to version 2

> Move a Firewall integration from POST /classify to POST /v2/classify.

Version 2 returns one decision per item in place of the version 1 verdict. The request does not change. Version 1 remains available and has no retirement date. See [versioning](https://silmaril.security/docs/api-reference/versioning.md).

## Change the URL

| Client | Change |
| - | - |
| Silmaril SDK 1.0 and later | None. Keep your provisioned `SILMARIL_API_URL`. |
| Direct HTTP | Replace the final `/classify` in the request URL with `/v2/classify`. |

With SDK 1.0 and later, the SDK selects the version itself. It calls `/v2/classify` on the deployment your URL identifies. When that call answers `403`, `404`, or `405`, the deployment may predate version 2, and the SDK calls `/classify` instead. It then derives each decision from the version 1 result. `confidence` and `severity` are `null` on those decisions. SDK versions before 1.0 call version 1.

For direct HTTP, keep any path prefix before `/classify`. The API key, headers, and error responses do not change.

## Keep the request

A body accepted by `/classify` is accepted by `/v2/classify` with the same meaning. The legacy `threshold` and `temperature` request fields are not part of version 2.

## Map the response

| Version 1 | Version 2 | Change |
| - | - | - |
| `prediction` | `action` | `allow` or `block`. `block` when the model label is `MALICIOUS` or `governance.action` is `block`. |
| `model_prediction` | `source` | The model label is `MALICIOUS` exactly when `source` is `model`. On a block, `source` is `governance` when only governance blocks. |
| `primary_outcome` | `outcome` | The predicted harm on a model block that has one, otherwise `null`. An allowed event has `null`, not `benign`. |
| `score`, `threshold` | `confidence`, `severity` | Ordered labels that describe the Firewall's assessment of the item. They are not derived from `score` or `threshold`, and no numeric score or threshold is returned. |
| `predictions` | `results` | Always an array in input order. A single event returns one decision in it. |
| `governance` | `governance` | Unchanged. The key is always present and is `null` when empty. |
| `model_id` | `model_id` | Unchanged. The identifier of the model release that classified the item, for provenance. |
| `review` | `review` | Unchanged. Present at the top level only when the request set it. |

Version 2 returns no `outcome_scores` or other score maps. Every key of a decision is always present and is `null` when empty.

## Compare responses

Each pair shows the two versions' responses for the same result. The version 1 bodies show the fields that map to version 2.

### Model block

```json Version 1 theme={"theme":"github-light-default"}
{
  "prediction": "MALICIOUS",
  "score": 1.0,
  "threshold": 0.5,
  "primary_outcome": "control_abuse",
  "outcome_scores": {
    "control_abuse": 0.75
  },
  "model_id": "silmaril-cascade-1-6"
}
```

```json Version 2 theme={"theme":"github-light-default"}
{
  "results": [
    {
      "action": "block",
      "source": "model",
      "confidence": "high",
      "severity": "moderate",
      "outcome": "control_abuse",
      "governance": null,
      "model_id": "silmaril-cascade-1-6"
    }
  ]
}
```

### Governance block

```json Version 1 theme={"theme":"github-light-default"}
{
  "prediction": "MALICIOUS",
  "model_prediction": "BENIGN",
  "score": 0.0,
  "threshold": 0.5,
  "primary_outcome": "benign",
  "outcome_scores": {},
  "governance": {
    "action": "block",
    "rule_id": "block-shell",
    "policy_version": "policy-9",
    "resource": {
      "kind": "mcp_tool",
      "id": "search",
      "parent_id": "arxiv-mcp-server"
    },
    "identity_revision": "rev-1"
  },
  "model_id": "silmaril-cascade-1-6"
}
```

```json Version 2 theme={"theme":"github-light-default"}
{
  "results": [
    {
      "action": "block",
      "source": "governance",
      "confidence": null,
      "severity": null,
      "outcome": null,
      "governance": {
        "action": "block",
        "rule_id": "block-shell",
        "policy_version": "policy-9",
        "resource": {
          "kind": "mcp_tool",
          "id": "search",
          "parent_id": "arxiv-mcp-server"
        },
        "identity_revision": "rev-1"
      },
      "model_id": "silmaril-cascade-1-6"
    }
  ]
}
```

### Batch

```json Version 1 theme={"theme":"github-light-default"}
{
  "predictions": [
    {
      "prediction": "BENIGN",
      "score": 0.0,
      "threshold": 0.5,
      "primary_outcome": "benign",
      "outcome_scores": {},
      "model_id": "silmaril-cascade-1-6"
    },
    {
      "prediction": "MALICIOUS",
      "score": 1.0,
      "threshold": 0.5,
      "primary_outcome": "secret_exposure",
      "outcome_scores": {
        "control_abuse": 0.25,
        "secret_exposure": 0.75
      },
      "model_id": "silmaril-cascade-1-6"
    }
  ],
  "review": "standard"
}
```

```json Version 2 theme={"theme":"github-light-default"}
{
  "results": [
    {
      "action": "allow",
      "source": null,
      "confidence": null,
      "severity": null,
      "outcome": null,
      "governance": null,
      "model_id": "silmaril-cascade-1-6"
    },
    {
      "action": "block",
      "source": "model",
      "confidence": null,
      "severity": null,
      "outcome": "secret_exposure",
      "governance": null,
      "model_id": "silmaril-cascade-1-6"
    }
  ],
  "review": "standard"
}
```

## When confidence and severity are null

`confidence` and `severity` describe the Firewall's assessment of the item, and are set only when that assessment is the reason for the block. Both are `null`:

* on an allow
* on a block that came from a governance policy
* on a block the Firewall reached without that assessment

When either field is set, `action` is `block` and `source` is `model`. Do not use these fields to decide whether to block.

## Update enforcement

In version 1, a client stops an event when `prediction` is `MALICIOUS` or `governance.action` is `block`. In version 2, `action` is the only field to enforce on: stop an event when `action` is anything other than `allow`. Apply that check to every item in `results`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.