FireGuard

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

On this page