nemoguardrails.library.zscaler_aiguard.actions
nemoguardrails.library.zscaler_aiguard.actions
Zscaler AI Guard integration for NeMo Guardrails.
Scans prompts and LLM responses using the Zscaler AI Guard DAS API via the zscaler-sdk-python SDK.
By default, uses resolve-and-execute-policy (automatic policy selection). Set AIGUARD_POLICY_ID to use execute-policy with a specific policy.
Required environment variables: AIGUARD_API_KEY - Zscaler AI Guard API key (Bearer token) AIGUARD_CLOUD - Cloud region, e.g. us1, us2, eu1 (default: us1)
Optional environment variables: AIGUARD_POLICY_ID - Specific policy ID to use (default: auto-resolved)
Module Contents
Classes
Functions
Data
API
Bases: EnvironmentError
Build a human-readable block message with full context.
Access an attribute by name from either a dict or an object.
Lazily initialise the Zscaler AI Guard SDK client.
Call the AI Guard API synchronously (wrapped with asyncio.to_thread).
Scan content using Zscaler AI Guard.
Parameters:
Content to scan (user prompt or bot response).
“IN” for user prompts, “OUT” for bot responses.
Optional policy ID. If provided, calls execute_policy instead of resolve_and_execute_policy. Can also be set via AIGUARD_POLICY_ID environment variable.
Returns: RailOutcome
The rail decision with the parsed AI Guard response as metadata.