FireGuard Quickstart
Add input and output guardrails to an AI request path.
Use FireGuard as a policy and security firewall around your model call.
1. Create a Conversation
curl -X POST \
"https://api.fireraven.ai/public/fireguard/v1/conversation?project_id=$FIREGUARD_PROJECT_ID" \
-H "X-Api-Key: $FIREGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Production chat"}'Save the returned id as conversation_id.
2. Check User Input
curl -X POST \
"https://api.fireraven.ai/public/fireguard/v1/input_guardrails?conversation_id=$CONVERSATION_ID" \
-H "X-Api-Key: $FIREGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages_history": [
{ "role": "user", "content": "Can you help me with this request?" }
]
}'If is_safe is false, return the configured violation message instead of calling your model.
3. Call Your Model
Only call the LLM after the input check passes. Keep the input_request.id from the previous response because output checks use it.
4. Check Model Output
curl -X POST \
"https://api.fireraven.ai/public/fireguard/v1/output_guardrails?conversation_id=$CONVERSATION_ID" \
-H "X-Api-Key: $FIREGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_id": "'"$INPUT_ID"'",
"output": "The assistant response you want to return."
}'If the output is safe, return it to the user. If not, return the configured violation message or a fallback response.
Next Steps
API keys
Learn where FireGuard keys live and how requests are authenticated.
Concepts
Understand conversations, execution modes, policies, and monitoring.
FireGuard Agent Hooks
Protect coding agents without building a custom request path.
Create conversation reference
Inspect the request and response shape for conversation creation.
Input guardrails reference
Inspect generated schemas for input checks.
Output guardrails reference
Inspect generated schemas for output checks.