Terminate an agent and close its sessions
curl --request DELETE \
--url https://app.trustivan.com/api/v1/agents/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/agents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/agents/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Terminate an agent and close its sessions
The kill switch, and it is the SAME revocation DELETE /workloads/{id}
performs, not a second mechanism. What this adds is closing the
agent’s open sessions, so a stopped agent leaves nothing live-looking
behind it.
The revocation is what stops the agent. Every subsequent authorization
re-reads the workload row on the request that authenticates the
credential, so the agent is stopped on its very next action whether or
not its sessions were closed, and a caller holding a Scope minted
before the revocation gets revoke rather than a permit.
sessions_ended reports how many runs were stopped with it: “we killed
the agent and closed three sessions” is the sentence an incident review
needs.
DELETE
/
agents
/
{id}
Terminate an agent and close its sessions
curl --request DELETE \
--url https://app.trustivan.com/api/v1/agents/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/agents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/agents/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The revoked agent, and how many sessions were ended.