Check Guardrail
curl --request POST \
--url https://api.truthlocks.com/v1/guardrails/check \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_type": "<string>",
"guardrail_type": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check_type: '<string>',
guardrail_type: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/guardrails/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/guardrails/check"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_type": "<string>",
"guardrail_type": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/guardrails/check"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check_type\": \"<string>\",\n \"guardrail_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"allowed": true,
"violations": [
{
"rule": "<string>",
"description": "<string>",
"severity": "low"
}
],
"receipt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Guardrails & Delegation
Record a Guardrail Score
Apply thresholds to a score supplied by your application.
POST
/
v1
/
guardrails
/
check
Check Guardrail
curl --request POST \
--url https://api.truthlocks.com/v1/guardrails/check \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_type": "<string>",
"guardrail_type": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check_type: '<string>',
guardrail_type: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/guardrails/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/guardrails/check"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_type": "<string>",
"guardrail_type": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/guardrails/check"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check_type\": \"<string>\",\n \"guardrail_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"allowed": true,
"violations": [
{
"rule": "<string>",
"description": "<string>",
"severity": "low"
}
],
"receipt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Records your application’s score for an agent’s input or output. It does not scan raw text or calculate an independent safety score. Supply the score produced by your own detector.
The required fields are
The current handler treats an omitted score as zero. Always send an explicit score; a
agent_id, check_type, and guardrail_type. check_type must be input or output.
| Submitted score | Result |
|---|---|
| Greater than 0.8 | fail |
| Greater than 0.5, up to 0.8 | warn |
| 0.5 or lower | pass |
pass result does not establish that content is safe. A failed check attempts to open the agent’s circuit breaker.
content_hash is metadata, not uploaded content for analysis. The current receipt uses a system marker in its signature field; do not treat it as cryptographic proof.Authorizations
API key for machine-to-machine authentication
Body
application/json

