Vérifier le garde-fou
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
}Garde-fous et délégation
Enregistrer un score de garde-fou
Appliquer des seuils à un score fourni par votre application.
POST
/
v1
/
guardrails
/
check
Vérifier le garde-fou
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
}Enregistre le score de votre application pour l’entrée ou la sortie d’un agent. Il ne scanne pas le texte brut et ne calcule pas de score de sécurité indépendant. Fournissez le score produit par votre propre détecteur.
Les champs obligatoires sont
Le gestionnaire actuel traite un score omis comme zéro. Envoyez toujours un score explicite ; un résultat
agent_id, check_type et guardrail_type. check_type doit être input ou output.
| Score soumis | Résultat |
|---|---|
| Supérieur à 0.8 | fail |
| Supérieur à 0,5, jusqu’à 0,8 | warn |
| 0.5 ou moins | pass |
pass n’établit pas que le contenu est sûr. Un échec de vérification tente d’ouvrir le disjoncteur de l’agent.
content_hash est une métadonnée, pas un contenu téléchargé pour analyse. Le reçu actuel utilise un marqueur système dans son champ de signature ; ne le traitez pas comme une preuve cryptographique.Corps
application/json

