Skip to main content

Module guardian

Module guardian 

Source
Expand description

Host-facing Guardian invocation. One prepared target request is sent once; non-2xx responses retain their complete original body and no retry is done.

Structs§

GuardianLimits
GuardianPreflight
GuardianResourceLimits
GuardianStreamLimits

Enums§

GuardianClassifyInvocation
GuardianNativeResponse
The validated semantic label is paired with the complete generated target response. Hosts can use this provenance to map usage/IDs and synthesize the native Responses SSE lifecycle without treating the label as a bare JSON replacement for the client response.
GuardianReviewInvocation
GuardianStreamContext
Concrete invocation facts used by the existing direct response pair. Claude and Gemini need a factual timestamp, and missing usage details need actual host facts. No timestamp or zero counter is supplied by this adapter.
GuardianStreamInvocation

Functions§

classify
classify_sse
prepare_with_resources
Prepare one request using the caller’s authorized resource scope. No model invocation or publication occurs here; cancellation cannot trigger a retry. Source evidence retains its original references for subsequent SSE binding.
review
review_sse
Run one prepared review request and return the client’s native Responses SSE body. Return controls are taken from the prepared client request.