Verificar 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
}Barreras de seguridad y delegación
Registrar una puntuación de barandilla
Aplique umbrales a una puntuación proporcionada por su aplicación.
POST
/
v1
/
guardrails
/
check
Verificar 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
}Registra la puntuación de su aplicación para la entrada o salida de un agente. No escanea texto sin formato ni calcula una puntuación de seguridad independiente. Suministre la puntuación producida por su propio detector.
Los campos obligatorios son
El controlador actual trata una puntuación omitida como cero. Siempre envíe una puntuación explícita; un resultado
agent_id, check_type y guardrail_type. check_type debe ser input o output.
| Puntuación enviada | Resultado |
|---|---|
| Mayor que 0.8 | fail |
| Mayor que 0.5, hasta 0.8 | warn |
| 0.5 o menos | pass |
pass no establece que el contenido sea seguro. Una verificación fallida intenta abrir el disyuntor del agente.
content_hash son metadatos, no contenido cargado para análisis. El recibo actual utiliza un marcador del sistema en su campo de firma; no lo trate como prueba criptográfica.Cuerpo
application/json

