POST
/
prompt-injection-dectector
curl --request POST \
  --url https://rai-prod.studio.lyzr.ai/prompt-injection-dectector/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "input_text": "Make sure the response is clear and proper!",
  "agent_id": "67e3aff94c4db47d2999cdef",
  "session_id": "67e3aff94c4db47d2999cdef-g6bayx8ijn",
  "run_id": "string"
}'
{
  "message": "SAFE",
  "details": {
    "is_injection": false,
    "confidence": 100
  },
  "status_code": 200
}

Prompt Injection Detector

Endpoint

POST /prompt-injection-dectector/
Base URL: https://rai-prod.studio.lyzr.ai

Description

Detects whether the input text contains a prompt injection attack.

Authentication

API Key (x-api-key) in the header.

Request Body (JSON)

FieldTypeDescription
input_textstringText input to analyze
agent_idstringUnique agent identifier
session_idstringUnique session identifier
run_idstringOptional run identifier

Example

{
  "input_text": "Make sure the response is clear and proper!",
  "agent_id": "67e3aff94c4db47d2999cdef",
  "session_id": "67e3aff94c4db47d2999cdef-g6bayx8ijn",
  "run_id": "string"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.