FireGuardApi reference

Check user input

Evaluate the latest user message and conversation history against the project policies and security guardrail.

POST
/input_guardrails

Evaluate the latest user message and conversation history against the project policies and security guardrail.

Authorization

ApiKeyAuth
X-Api-Key<token>

FireGuard organization API key.

In: header

Query Parameters

conversation_id*string

FireGuard conversation ID returned by the conversation endpoint.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/input_guardrails?conversation_id=string" \  -H "Content-Type: application/json" \  -d '{    "messages_history": [      {        "role": "system",        "content": "You are a helpful assistant."      },      {        "role": "user",        "content": "What is the weather today?"      }    ]  }'
{  "is_safe": true,  "input_request": {    "id": "string",    "role": "string",    "content": {      "text": "string",      "text_with_context": "string"    }  },  "policies_guardrail_results": {    "policies": [      {        "id": "string",        "name": "string",        "description": "string",        "criticality": "low",        "detection_threshold": 0,        "detection_is_above_threshold": true,        "status": "success",        "value": 0,        "is_safe": true,        "policy_violation_message": "string"      }    ],    "is_safe": true,    "timestamp": "2019-08-24T14:15:22Z"  },  "security_guardrail_results": {    "is_safe": true,    "timestamp": "2019-08-24T14:15:22Z",    "value": 0,    "security_violation_message": "string"  }}