curl --request POST \
--url https://app.trustivan.com/api/v1/agents/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_token": "<string>",
"attributes": {}
}
'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/actions"
payload = {
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_token": "<string>",
"attributes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool: '<string>',
resource_type: '<string>',
resource_id: '<string>',
session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
approval_token: '<string>',
attributes: {}
})
};
fetch('https://app.trustivan.com/api/v1/agents/{id}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/agents/{id}/actions"
payload := strings.NewReader("{\n \"tool\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approval_token\": \"<string>\",\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Check whether this agent may invoke a tool
Runtime authorization of a tool invocation, and the append-only record of it. Answers about the CALLING agent only: an endpoint answering about an arbitrary principal would be an oracle for probing what other agents may do.
The DECISION comes from the same broker POST /authz/decide uses.
There is no second decision path: an agent invoking a tool and an
admission controller asking about the same action cannot get different
answers.
What this adds beyond the broker is the three checks a permission alone cannot express, and each produces a decision rather than an error so the caller still receives an obligation:
- an UNDECLARED tool returns
quarantine: an agent doing something its own inventory says it cannot is not making a routine mistake, it is a signal about the principal. - a DISABLED tool returns
deny. - a session that has ended or expired returns
deny; another agent’s session returnsquarantine.
A tool the agent declared irreversible, invoked with no human
present, returns step_up. This can only make the broker’s answer
STRICTER: a decision the broker refused stays refused, with its
reasoning intact.
A credential revoked between authentication and this call returns
revoke, which is how the kill switch reaches an in-flight agent.
A human is present only when the agent presents approval_token: a
single-use token a human issued at POST /agents/{id}/approvals for
exactly this agent, tool and resource, within the last five minutes.
The agent can no longer say so itself (human_present is not read),
so it cannot waive its own step-up. A token that does not fit (another
tool or resource, expired, already spent) is not an error: the action
simply has no human behind it.
200 for every decision including a refusal, for the reason
POST /authz/decide returns one: the decision IS the answer.
curl --request POST \
--url https://app.trustivan.com/api/v1/agents/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_token": "<string>",
"attributes": {}
}
'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/actions"
payload = {
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_token": "<string>",
"attributes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool: '<string>',
resource_type: '<string>',
resource_id: '<string>',
session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
approval_token: '<string>',
attributes: {}
})
};
fetch('https://app.trustivan.com/api/v1/agents/{id}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/agents/{id}/actions"
payload := strings.NewReader("{\n \"tool\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approval_token\": \"<string>\",\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
Response
The decision with its obligation, and the action record written for it.