إعادة حساب درجة الثقة
curl --request POST \
--url https://api.truthlocks.com/v1/trust/compute \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/trust/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/trust/compute"
payload = { "agent_id": "<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/trust/compute"
payload := strings.NewReader("{\n \"agent_id\": \"<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))
}{
"score": 0.5,
"factors": {},
"deltas": {},
"computed_at": "2023-11-07T05:31:56Z"
}{
"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
}الثقة والشهادة
حساب درجة الثقة
إعادة حساب درجة الثقة لوكيل آلي بناءً على إشارات السلوك الحالية
POST
/
v1
/
trust
/
compute
إعادة حساب درجة الثقة
curl --request POST \
--url https://api.truthlocks.com/v1/trust/compute \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/trust/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/trust/compute"
payload = { "agent_id": "<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/trust/compute"
payload := strings.NewReader("{\n \"agent_id\": \"<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))
}{
"score": 0.5,
"factors": {},
"deltas": {},
"computed_at": "2023-11-07T05:31:56Z"
}{
"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
}يؤدي إلى إعادة حساب حسب الطلب لدرجة الثقة لوكيل معين. تُشتق الدرجة من عوامل متعددة مرجحة بما في ذلك معدل الشذوذ، وسجل وقت التشغيل، وعمق التفويض، وحجم الإيصالات. استخدم نقطة النهاية هذه بعد حدث مهم (تدوير المفتاح، انتهاك السياسة، انفجار الشهادات) لضمان أن الدرجة تعكس الوضع الحالي للوكيل.
تتراوح درجات الثقة من
0.0 (لا توجد ثقة) إلى 1.0 (ثقة كاملة) وتستخدمها محركات السياسات، واختيار الشهود، وبوابات التفويض عبر المنصة.
المصادقة
يتطلب رأسX-API-Key أو رمز Bearer JWT. يتم اشتقاق مساحة العمل من بيانات الاعتماد الموثقة؛ لا ترسل X-Tenant-ID.
الاستجابة
أوزان عامل النتيجة
| العامل | الوزن | الوصف |
|---|---|---|
anomaly_rate | 30% | يعاقب الوكلاء ذوي نسب الشذوذ العالية |
uptime | 25% | يكافئ التوفر المستمر |
delegation_depth | 20% | السلاسل الأعمق تقلل الثقة بشكل متناسب |
receipt_count | 25% | تشير المزيد من الإيصالات إلى تاريخ ثابت |

