There are two common ways to integrate /guard:Documentation Index
Fetch the complete documentation index at: https://docs.sagexai.com/llms.txt
Use this file to discover all available pages before exploring further.
1) Pre-LLM (block input)
- Send the user message to
/api/v1/guardbefore calling your LLM provider. - If
flagged: true, block or sanitize the input and show a user-friendly message. - If not flagged, forward the original message to the LLM.
2) Post-LLM (block output)
- Call your LLM provider first.
- Send the LLM output to
/api/v1/guard. - If
flagged: true, block returning the output and show a safe alternative.
flagged results (block, sanitize, route to a human, etc.).