التحقق من الحماية
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
}الحواجز الوقائية والتفويض
تسجيل درجة Guardrail
تطبيق العتبات على درجة مقدمة من تطبيقك.
POST
/
v1
/
guardrails
/
check
التحقق من الحماية
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
}يسجل درجة تطبيقك لإدخال أو إخراج وكيل. لا يقوم بمسح النص الخام أو حساب درجة أمان مستقلة. قدم الدرجة التي ينتجها الكاشف الخاص بك.
الحقول المطلوبة هي
يتعامل المعالج الحالي مع النتيجة المحذوفة على أنها صفر. أرسل دائمًا نتيجة صريحة؛ لا تثبت نتيجة
agent_id، check_type، وguardrail_type. يجب أن يكون check_type إما input أو output.
| النتيجة المقدمة | النتيجة |
|---|---|
| أكبر من 0.8 | fail |
| أكبر من 0.5، حتى 0.8 | warn |
| 0.5 أو أقل | pass |
pass أن المحتوى آمن. تحاول عملية فحص فاشلة فتح قاطع الدائرة الخاص بالوكيل.
content_hash هو بيانات وصفية، وليس محتوى تم تحميله للتحليل. يستخدم الإيصال الحالي علامة نظام في حقل التوقيع الخاص به؛ لا تعامله كدليل تشفيري.الجسم
application/json

