Recompute Trust Score
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>",
"include_factors": true
}
'import requests
url = "https://api.truthlocks.com/v1/trust/compute"
payload = {
"agent_id": "<string>",
"include_factors": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>', include_factors: true})
};
fetch('https://api.truthlocks.com/v1/trust/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.truthlocks.com/v1/trust/compute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'include_factors' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}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 \"include_factors\": true\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))
}HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/trust/compute")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"include_factors\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/trust/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"include_factors\": true\n}"
response = http.request(request)
puts response.read_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
}Trust & Witness
Compute Trust Score
Recompute the trust score for a machine agent based on current behavioral signals
POST
/
v1
/
trust
/
compute
Recompute Trust Score
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>",
"include_factors": true
}
'import requests
url = "https://api.truthlocks.com/v1/trust/compute"
payload = {
"agent_id": "<string>",
"include_factors": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>', include_factors: true})
};
fetch('https://api.truthlocks.com/v1/trust/compute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.truthlocks.com/v1/trust/compute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'include_factors' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}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 \"include_factors\": true\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))
}HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/trust/compute")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"include_factors\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/trust/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"include_factors\": true\n}"
response = http.request(request)
puts response.read_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
}Triggers an on-demand recomputation of the trust score for a specific agent. The score is derived from multiple weighted factors including anomaly rate, uptime history, delegation depth, and receipt volume. Use this endpoint after a significant event (key rotation, policy violation, attestation burst) to ensure the score reflects the agent’s current posture.
Trust scores range from
0.0 (no trust) to 1.0 (full trust) and are used by policy engines, witness selection, and delegation gates across the platform.
Authentication
RequiresX-API-Key header or Bearer JWT token. Tenant-scoped via X-Tenant-ID.
Path Parameters
string
required
The unique identifier of the machine agent whose trust score should be
recomputed. Format:
maip-agent:ULID.Request Body
boolean
default:"false"
When
true, the response includes the full factor history used during
computation. Useful for debugging score changes but increases response size.Response
string
The agent identifier that was scored.
number
The computed trust score as a float between
0.0 and 1.0.object
Breakdown of the individual factors that contributed to the score.
Show Factor fields
Show Factor fields
number
Ratio of anomalous events to total events in the scoring window. Lower is better.
number
Agent availability ratio over the last 30 days.
1.0 means 100% uptime.integer
Current depth of the agent’s delegation chain. Deep chains reduce trust.
integer
Total number of valid receipts the agent has accumulated.
string
ISO 8601 timestamp of when the computation completed.
Score Factor Weights
| Factor | Weight | Description |
|---|---|---|
anomaly_rate | 30% | Penalizes agents with high anomaly ratios |
uptime | 25% | Rewards consistent availability |
delegation_depth | 20% | Deeper chains reduce trust proportionally |
receipt_count | 25% | More receipts indicate established history |
Authorizations
API key for machine-to-machine authentication
Body
application/json

