Skip to main content
prediction is the authoritative BENIGN or MALICIOUS verdict. primary_outcome is a forward-compatible string: SDKs expose constants for known labels, but deployments can return additional labels. Treat the constants as routing conveniences rather than a closed verdict enum. The backend wire fields are prediction, primary_outcome, outcome_scores, detector_scores, and detector_counts. Handler functions such as continueNormally and redactAndSuppress in these examples belong to your application.

Prerequisites

Initialize the SDK client for your runtime and classify a boundary. The SDK examples use the client initialized in the matching setup guide. In Block mode, Python and Go expose an enforced block through its error; the examples retain that verdict for routing. TypeScript returns the verdict directly. The Java example routes a parsed HTTP response using the public wire fields, without an SDK dependency.

Outcome taxonomy

In Block mode, continue only when prediction is benign and no applicable governance policy blocks the request. For malicious results, route the primary outcome using this table of known legacy labels. The table is not exhaustive. Block by default if the outcome is missing or unrecognized.

Route a result in Block mode

This example enforces blocking. For observational behavior, record the verdict and continue according to your effective mode.
The TypeScript, Python, and Go handlers belong to your application; every handler except continueNormally or continue_normally must stop the event. Go handlers return an error, and securityLog records the event. The Java 17 example accepts a JSON object decoded by your application’s JSON library and returns an action name: dispatch that action before consuming the event, record security events for block_and_escalate, and allow the event only for continue_normally. For a Java SDK block, retain FirewallBlockedException.result() as described in Java errors.

Expected result

A benign prediction invokes your continue handler. A governance-policy block is denied before the prediction is checked. A malicious prediction invokes the matching outcome handler, or the default blocking handler when no outcome matches.

Field names

Read optional governance fields only when the decision is present. See events and conversations for request fields.