Skip to main content
POST
Send independent events in texts. For conversation-aware checks, use ordered single-event requests with the same metadata.conversationId. Batch classification neither reads nor updates conversation history. The request body is the same as in version 1. The request URL is your provisioned SILMARIL_API_URL with the final /classify replaced by /v2/classify. Each example derives it. results holds one decision per text, in input order. Enforce on the action of every item before consuming it. Choose cURL, TypeScript, JavaScript, Python, Go, or Java in the request examples. They use standard HTTP libraries. The Java example requires Java 17 or later.
This response is for a two-item batch that set review to standard. The first item is allowed and the second is a model block.
Every key of a decision is always present and is null when empty. Ignore fields you do not recognize. model_id identifies the model release that classified the item. Record it for provenance. Do not enforce on it.

Handle the decisions

HTTP 200 returns one decision per item. action is the only field to enforce on: treat any value other than allow as a block. In Block mode, stop a blocked event. In Warn or Shadow mode, record the would-block decision and continue. Handle request failures with your application’s error policy. Error status codes and bodies are the same as in version 1. See modes and enforcement for the full decision model.

Read a block

source names who decided a block: model or governance. It is model when both block. outcome is the predicted harm on a model block that has one. confidence and severity describe the Firewall’s assessment of the item, and are set only when that assessment is the reason for the block. They are null on an allow, on a block that came from a governance policy, and on a block the Firewall reached without that assessment.

Optional review depth

The optional top-level review field accepts standard or deep. See review depth for requirements and selection behavior. Review selection applies to the entire batch. When the request sets review, the response carries the same value in a top-level review field beside results. The field is absent otherwise, and decisions carry no review field.

Authorizations

x-api-key
string
header
required

API key provisioned for your deployment.

Body

application/json
texts
string[]
required

Independent events, at most 100 per request. Input-size limits depend on your deployment.

Required array length: 1 - 100 elements
Minimum string length: 1
hooks
enum<string>[]

One hook per text, in input order. Length must match texts.

Boundary being checked. Use the SDK hook labels shown here.

Available options:
user_input,
system_prompt,
tool_call,
tool_response,
llm_output,
unknown
tool_names
(string | null)[]

One tool name or null per text. Length must match texts.

metadata
(object | null)[]

One metadata object or null per text. Length must match texts.

JSON metadata for this event. SDKs add request identity under silmaril. A conversationId connects ordered single-event calls when conversation history is supported. Batch metadata does not connect events into a sequence.

resources
(object | null)[]

One concrete resource or null per text, where supported. Length must match texts.

Concrete governance resource, where supported. id must not be blank. mcp_tool requires parent_id; other resource kinds must omit parent_id.

identity_revision
string

Resource-catalog revision, where supported by the deployment.

Minimum string length: 1
review
enum<string>

Optional request-wide review selection. standard selects standard review. deep requests an additional review of eligible potentially harmful events when available on your deployment. An event may complete without additional review. Omit review to inherit the deployment default. Review depth is independent of enforcement mode.

Available options:
standard,
deep
Example:

"deep"

Response

One decision per text in the results array, in input order. Block decisions still return HTTP 200.

results
Decision · object[]
required

One decision per item, in input order. Always an array, for text and texts alike.

review
enum<string>

Present only when the request set review. It acknowledges the selection for the entire request; decisions carry no review field. An event may complete without additional review.

Available options:
standard,
deep
Example:

"deep"