Evaluate an agent tool call
curl --request POST \
--url https://gateway.inviolet.ai/v1/intent/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_call": {
"name": "lookup_customer",
"arguments": {}
},
"user_id": "<string>",
"session_id": "<string>",
"conversation_id": "<string>",
"data_source_id": "<string>",
"shadow_mode": false
}
'import requests
url = "https://gateway.inviolet.ai/v1/intent/evaluate"
payload = {
"tool_call": {
"name": "lookup_customer",
"arguments": {}
},
"user_id": "<string>",
"session_id": "<string>",
"conversation_id": "<string>",
"data_source_id": "<string>",
"shadow_mode": False
}
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_call: {name: 'lookup_customer', arguments: {}},
user_id: '<string>',
session_id: '<string>',
conversation_id: '<string>',
data_source_id: '<string>',
shadow_mode: false
})
};
fetch('https://gateway.inviolet.ai/v1/intent/evaluate', 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://gateway.inviolet.ai/v1/intent/evaluate",
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([
'tool_call' => [
'name' => 'lookup_customer',
'arguments' => [
]
],
'user_id' => '<string>',
'session_id' => '<string>',
'conversation_id' => '<string>',
'data_source_id' => '<string>',
'shadow_mode' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.inviolet.ai/v1/intent/evaluate"
payload := strings.NewReader("{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\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))
}HttpResponse<String> response = Unirest.post("https://gateway.inviolet.ai/v1/intent/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.inviolet.ai/v1/intent/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\n}"
response = http.request(request)
puts response.read_body{
"outcome": "allowed",
"intent_label": "customer_support_lookup",
"intent_event_id": "<string>",
"intent_class": "reporting",
"confidence": 0.5,
"data_elements": [
"<string>"
],
"shadow_mode": true,
"processing_time_ms": 123,
"approval_request_id": "<string>"
}{
"code": "invalid_request",
"message": "<string>"
}Intent
Evaluate an agent tool call
Extracts the intent, matches against published intentions, evaluates policies, and returns the access decision plus (when allowed) a short-lived grant.
POST
/
v1
/
intent
/
evaluate
Evaluate an agent tool call
curl --request POST \
--url https://gateway.inviolet.ai/v1/intent/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_call": {
"name": "lookup_customer",
"arguments": {}
},
"user_id": "<string>",
"session_id": "<string>",
"conversation_id": "<string>",
"data_source_id": "<string>",
"shadow_mode": false
}
'import requests
url = "https://gateway.inviolet.ai/v1/intent/evaluate"
payload = {
"tool_call": {
"name": "lookup_customer",
"arguments": {}
},
"user_id": "<string>",
"session_id": "<string>",
"conversation_id": "<string>",
"data_source_id": "<string>",
"shadow_mode": False
}
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_call: {name: 'lookup_customer', arguments: {}},
user_id: '<string>',
session_id: '<string>',
conversation_id: '<string>',
data_source_id: '<string>',
shadow_mode: false
})
};
fetch('https://gateway.inviolet.ai/v1/intent/evaluate', 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://gateway.inviolet.ai/v1/intent/evaluate",
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([
'tool_call' => [
'name' => 'lookup_customer',
'arguments' => [
]
],
'user_id' => '<string>',
'session_id' => '<string>',
'conversation_id' => '<string>',
'data_source_id' => '<string>',
'shadow_mode' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.inviolet.ai/v1/intent/evaluate"
payload := strings.NewReader("{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\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))
}HttpResponse<String> response = Unirest.post("https://gateway.inviolet.ai/v1/intent/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.inviolet.ai/v1/intent/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_call\": {\n \"name\": \"lookup_customer\",\n \"arguments\": {}\n },\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"data_source_id\": \"<string>\",\n \"shadow_mode\": false\n}"
response = http.request(request)
puts response.read_body{
"outcome": "allowed",
"intent_label": "customer_support_lookup",
"intent_event_id": "<string>",
"intent_class": "reporting",
"confidence": 0.5,
"data_elements": [
"<string>"
],
"shadow_mode": true,
"processing_time_ms": 123,
"approval_request_id": "<string>"
}{
"code": "invalid_request",
"message": "<string>"
}Authorizations
API key minted at /developer/api-keys. Three scopes: read_only,
policy_write, admin.
Body
application/json
Response
Evaluation result.
Available options:
allowed, denied, pending_approval, approved, shadow_denied Example:
"customer_support_lookup"
Available options:
reporting, export, admin, lookup, analysis, write, other Required range:
0 <= x <= 1