Skip to main content
POST
Send one complete event in text. For multiple independent events, use batch classification. 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. Read the decision from the single item in results and enforce on its action. 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.
results is always an array, and a single event returns one decision in it. 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 decision

HTTP 200 returns a decision. 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. When the request sets review, the response carries the same value in a top-level review field beside results. The field is absent otherwise.

Authorizations

x-api-key
string
header
required

API key provisioned for your deployment.

Body

application/json
text
string
required

One complete event to classify. Input-size limits depend on your deployment.

Minimum string length: 1
Example:

"Summarize this release note."

hook
enum<string>

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

Available options:
user_input,
system_prompt,
tool_call,
tool_response,
llm_output,
unknown
Example:

"user_input"

tool_name
string

Tool name when checking a tool call or tool response.

Example:

"read_file"

metadata
object

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.

resource
object

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 for deployments supporting concrete governance identities.

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

A results array holding the decision for the event. A block decision still returns 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"