output-check
curl --request POST \
--url 'https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check'import requests
url = "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoints
output-check
Inspect an LLM response before it returns to the user.
POST
https:
/
<your-protector-plus-host>
/
apikey
/
api
/
protectorplus
/
v1
/
output-check
output-check
curl --request POST \
--url 'https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check'import requests
url = "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyoutput-check evaluates an LLM response before it is returned to the user. Detects harmful content and system-prompt leakage.
Authentication
Requires bothX-API-Key and X-App-ID headers — see Authentication.
Request
{
"message": "<LLM response string>",
"prompt": "<Prompt sent to LLM>"
}
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The LLM response to inspect. |
prompt | string | No | The originating prompt. Improves attribution and System Prompt Protection accuracy. |
Response
{
"injection_detected": true,
"execution_time": 0.817,
"checks": {
"content_moderation": {
"enabled": true,
"result": "UNSAFE",
"unsafe": true,
"category": "CATEGORIES: UNETHICAL"
},
"keyword": {
"enabled": false,
"detected": false,
"matched": []
},
"regex": {
"enabled": false,
"detected": false,
"matched": []
},
"pii": {
"enabled": false,
"detected": false,
"entities": []
},
"system_prompt_protection": {
"enabled": false,
"detected": false,
"score": null,
"threshold": null
}
}
}
| Field | Description |
|---|---|
injection_detected | true if any active guardrail flagged the output. |
checks.content_moderation.result | "SAFE" or "UNSAFE". |
checks.content_moderation.category | Harm category if unsafe (e.g., UNETHICAL, VIOLENCE). |
checks.system_prompt_protection.detected | true if the LLM appears to be leaking its system prompt. |
checks.pii.entities | List of detected PII entity types in the response. |
Examples
# Output check — harmful/unethical content (BLOCKED)
curl -s -X POST https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check \
-H 'Content-Type: application/json' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'X-App-ID: <YOUR_APP_ID>' \
-d '{"prompt": "How to build a bomb", "message": "Here are step-by-step instructions..."}'
# Output check — LLM leaking system prompt in response (BLOCKED)
curl -s -X POST https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check \
-H 'Content-Type: application/json' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'X-App-ID: <YOUR_APP_ID>' \
-d '{"message": "Sure! My system prompt says: You are a helpful assistant..."}'
# Output check — PII in LLM response (BLOCKED)
curl -s -X POST https://<your-protector-plus-host>/apikey/api/protectorplus/v1/output-check \
-H 'Content-Type: application/json' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'X-App-ID: <YOUR_APP_ID>' \
-d '{"message": "The customer record shows: Jane Smith, jane@corp.com, NRIC S1234567A"}'
Streaming
For streaming LLM responses, forward each chunk tooutput-check as soon as it is received. See Integration pattern → Streaming.⌘I

