Choose a hook
Supply the tool name for tool calls and tool responses. SDKs expose typed hook labels for these values.
Preserve conversation order
Use a caller-ownedmetadata.conversationId for one agent sequence. Send ordered individual classify() calls with that ID, waiting for and handling each verdict or error before sending the next event.
protect() in the Python and TypeScript SDKs and the parallel option on the LangChain, Deep Agents, and Vercel AI SDK integrations start a check without waiting for it. The SDK sends checks that share a conversation ID in the order they started, so those paths preserve the sequence for you.
Each SDK event also receives a metadata.silmaril.request_id. Use the request ID to correlate a classification and the conversation ID to group the sequence. Let the SDK manage request identity.
Use the client initialized in your SDK’s setup guide. In Block mode, Python, Go, and Java stop blocked events with an exception or error. TypeScript returns the verdict for your application to enforce.
ctx, fw, and userInput and returns an error. Import log and github.com/Silmaril-Security/sdk-go/firewall. The Java fragment runs inside a method that propagates classification exceptions. Handle the verdict or error according to the effective mode before continuing the sequence.
Batch independent events
Use batch classification for independent inputs. Responses preserve input order. Batch calls preserve per-item metadata while leaving conversation history unchanged. The same conversation ID on batch items leaves those items independent. Use concurrency for independent events or different conversations. Keep directclassify() calls within one conversation sequential: overlapping calls you start yourself are sent as they are made, and only protect() and the parallel integrations order them for you.
Field names
See the single-event API and SDK reference for complete request options.