Skip to main content
A classification evaluates an event. Your integration applies the result before the protected action or content is consumed.

Read the decision

Check prediction and the optional governance.action. A malicious prediction or a governance action of block is a would-block decision. Governance can block an event whose prediction is BENIGN. The returned score and threshold are diagnostic fields. Route on the verdict and applicable governance decision. Use outcomes for additional malicious-result detail. Claude Enterprise receives a native allow or deny action. Anthropic applies it according to your organization’s inference-hook settings; a returned denial in Shadow mode is a would-block decision.

Confidence scores

The score field ranges from 0 to 1 and expresses confidence in the model’s assessment of an event as harmful, safe, or uncertain. A high-confidence safe assessment can return prediction: "BENIGN" with score: 0.98. Silmaril combines the assessment with your configured policies to produce the final prediction. Route on prediction and the applicable governance.action in the effective mode. Your configured confidence threshold applies to potentially harmful events with available confidence. The comparison uses the value before display rounding; equality passes. Your policy determines whether a result below the threshold is allowed or recorded for observation. When confidence is unavailable, score is 0, the confidence threshold remains unevaluated, and Silmaril applies your configured uncertainty policy. Continue to handle the returned prediction and governance action. Where present, malicious_score is an alias of score.

Apply the result

Choose Shadow or Warn explicitly when observing. Python and Go use a Block fallback when the response and local configuration omit a mode. Framework adapters resolve their own override first, then the client setting, then an optional response mode, then Block. Current classify responses omit mode. SDK results preserve explicit local choices. Java examples choose a mode explicitly. In Shadow mode, LangChain callbacks, Deep Agents middleware, and protect() classify in the background: the protected step continues without waiting, and the finding is reported when the classification finishes. Direct classify() calls and Vercel middleware wait for each verdict in every mode.

Handle a failed check

An API, network, timeout, or cancellation error leaves the event without a verdict. Choose whether that boundary stops or continues when classification fails. Deep Agents allows execution on classification errors by default. Set failOpen: false in TypeScript or fail_open: False in Python when execution requires a completed check. That setting also keeps Shadow checks inline for LangChain callbacks and Deep Agents, because a background classification cannot stop the step it observes. The LiteLLM starter uses unreachable_fallback: fail_open. Check each integration guide for its error policy. Claude Enterprise’s Allow the request and Block the request settings choose how failed checks are handled. Both enforce returned denials while Enforce verdicts is on. Shadow mode allows requests regardless of verdict or failure; turning Enforce verdicts off stops requests from reaching Silmaril.

Enable blocking

Start with observation and verify connected boundaries. Review would-block findings, choose the error policy, then enable Block on the intended boundary. Repeat verification after changing the mode. For streaming output, buffer and classify content before delivery when blocking must prevent exposure. The Vercel AI SDK 7 adapter buffers for you in Block mode. LangChain callbacks and the AI SDK 5 and 6 middleware classify streamed output after it is delivered, so a block stops the run without recalling text. Checks cover the paths connected to Silmaril. Route every protected operation through those paths.