v1
Preview Effective Policy
Compute effective policy from rules without persisting a snapshot.
Useful for UIs that need to show the merged workspace/agent/task ceiling before the user commits a task creation.
POST
/
v1
/
governance
/
effective-policy
/
preview
Preview Effective Policy
curl --request POST \
--url https://api.example.com/v1/governance/effective-policy/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_policy": {
"approval": {
"approvers": [
"<string>"
],
"approvers_by_tool": {},
"escalation_rules": [
"<string>"
],
"requires_human_approval": true
},
"budget": {
"monthly_spend_cap_usd": 123,
"run_budget_usd": 123,
"service_budget_usd": 123
},
"content_safety": {
"output_sanitizer_enabled": true,
"prompt_injection_detection_enabled": true
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": [
"<string>"
],
"denied": [
"<string>"
]
}
}
}
'import requests
url = "https://api.example.com/v1/governance/effective-policy/preview"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_policy": {
"approval": {
"approvers": ["<string>"],
"approvers_by_tool": {},
"escalation_rules": ["<string>"],
"requires_human_approval": True
},
"budget": {
"monthly_spend_cap_usd": 123,
"run_budget_usd": 123,
"service_budget_usd": 123
},
"content_safety": {
"output_sanitizer_enabled": True,
"prompt_injection_detection_enabled": True
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": ["<string>"],
"denied": ["<string>"]
}
}
}
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({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
task_policy: {
approval: {
approvers: ['<string>'],
approvers_by_tool: {},
escalation_rules: ['<string>'],
requires_human_approval: true
},
budget: {monthly_spend_cap_usd: 123, run_budget_usd: 123, service_budget_usd: 123},
content_safety: {output_sanitizer_enabled: true, prompt_injection_detection_enabled: true},
execution: {max_model_turns: 1, max_tool_calls_per_turn: 1, max_tool_calls_total: 1},
tokens: {max_tokens: 1, max_tokens_per_call: 1},
tools: {allowed: ['<string>'], denied: ['<string>']}
}
})
};
fetch('https://api.example.com/v1/governance/effective-policy/preview', 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.example.com/v1/governance/effective-policy/preview",
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' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'task_policy' => [
'approval' => [
'approvers' => [
'<string>'
],
'approvers_by_tool' => [
],
'escalation_rules' => [
'<string>'
],
'requires_human_approval' => true
],
'budget' => [
'monthly_spend_cap_usd' => 123,
'run_budget_usd' => 123,
'service_budget_usd' => 123
],
'content_safety' => [
'output_sanitizer_enabled' => true,
'prompt_injection_detection_enabled' => true
],
'execution' => [
'max_model_turns' => 1,
'max_tool_calls_per_turn' => 1,
'max_tool_calls_total' => 1
],
'tokens' => [
'max_tokens' => 1,
'max_tokens_per_call' => 1
],
'tools' => [
'allowed' => [
'<string>'
],
'denied' => [
'<string>'
]
]
]
]),
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://api.example.com/v1/governance/effective-policy/preview"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\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://api.example.com/v1/governance/effective-policy/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/governance/effective-policy/preview")
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 \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"effective_policy": {
"approval": {
"approvers": [
"<string>"
],
"approvers_by_tool": {},
"escalation_rules": [
"<string>"
],
"requires_human_approval": true
},
"budget": {
"monthly_spend_cap_usd": "<string>",
"run_budget_usd": "<string>",
"service_budget_usd": "<string>"
},
"content_safety": {
"output_sanitizer_enabled": true,
"prompt_injection_detection_enabled": true
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"resolver_version": "policy-resolver-v1",
"source_policy_ids": [
"<string>"
],
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": [
"<string>"
],
"denied": [
"<string>"
]
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful Response
Resolved immutable policy snapshot.
Show child attributes
Show child attributes
⌘I
Preview Effective Policy
curl --request POST \
--url https://api.example.com/v1/governance/effective-policy/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_policy": {
"approval": {
"approvers": [
"<string>"
],
"approvers_by_tool": {},
"escalation_rules": [
"<string>"
],
"requires_human_approval": true
},
"budget": {
"monthly_spend_cap_usd": 123,
"run_budget_usd": 123,
"service_budget_usd": 123
},
"content_safety": {
"output_sanitizer_enabled": true,
"prompt_injection_detection_enabled": true
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": [
"<string>"
],
"denied": [
"<string>"
]
}
}
}
'import requests
url = "https://api.example.com/v1/governance/effective-policy/preview"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_policy": {
"approval": {
"approvers": ["<string>"],
"approvers_by_tool": {},
"escalation_rules": ["<string>"],
"requires_human_approval": True
},
"budget": {
"monthly_spend_cap_usd": 123,
"run_budget_usd": 123,
"service_budget_usd": 123
},
"content_safety": {
"output_sanitizer_enabled": True,
"prompt_injection_detection_enabled": True
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": ["<string>"],
"denied": ["<string>"]
}
}
}
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({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
task_policy: {
approval: {
approvers: ['<string>'],
approvers_by_tool: {},
escalation_rules: ['<string>'],
requires_human_approval: true
},
budget: {monthly_spend_cap_usd: 123, run_budget_usd: 123, service_budget_usd: 123},
content_safety: {output_sanitizer_enabled: true, prompt_injection_detection_enabled: true},
execution: {max_model_turns: 1, max_tool_calls_per_turn: 1, max_tool_calls_total: 1},
tokens: {max_tokens: 1, max_tokens_per_call: 1},
tools: {allowed: ['<string>'], denied: ['<string>']}
}
})
};
fetch('https://api.example.com/v1/governance/effective-policy/preview', 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.example.com/v1/governance/effective-policy/preview",
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' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'task_policy' => [
'approval' => [
'approvers' => [
'<string>'
],
'approvers_by_tool' => [
],
'escalation_rules' => [
'<string>'
],
'requires_human_approval' => true
],
'budget' => [
'monthly_spend_cap_usd' => 123,
'run_budget_usd' => 123,
'service_budget_usd' => 123
],
'content_safety' => [
'output_sanitizer_enabled' => true,
'prompt_injection_detection_enabled' => true
],
'execution' => [
'max_model_turns' => 1,
'max_tool_calls_per_turn' => 1,
'max_tool_calls_total' => 1
],
'tokens' => [
'max_tokens' => 1,
'max_tokens_per_call' => 1
],
'tools' => [
'allowed' => [
'<string>'
],
'denied' => [
'<string>'
]
]
]
]),
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://api.example.com/v1/governance/effective-policy/preview"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\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://api.example.com/v1/governance/effective-policy/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/governance/effective-policy/preview")
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 \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task_policy\": {\n \"approval\": {\n \"approvers\": [\n \"<string>\"\n ],\n \"approvers_by_tool\": {},\n \"escalation_rules\": [\n \"<string>\"\n ],\n \"requires_human_approval\": true\n },\n \"budget\": {\n \"monthly_spend_cap_usd\": 123,\n \"run_budget_usd\": 123,\n \"service_budget_usd\": 123\n },\n \"content_safety\": {\n \"output_sanitizer_enabled\": true,\n \"prompt_injection_detection_enabled\": true\n },\n \"execution\": {\n \"max_model_turns\": 1,\n \"max_tool_calls_per_turn\": 1,\n \"max_tool_calls_total\": 1\n },\n \"tokens\": {\n \"max_tokens\": 1,\n \"max_tokens_per_call\": 1\n },\n \"tools\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"denied\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"effective_policy": {
"approval": {
"approvers": [
"<string>"
],
"approvers_by_tool": {},
"escalation_rules": [
"<string>"
],
"requires_human_approval": true
},
"budget": {
"monthly_spend_cap_usd": "<string>",
"run_budget_usd": "<string>",
"service_budget_usd": "<string>"
},
"content_safety": {
"output_sanitizer_enabled": true,
"prompt_injection_detection_enabled": true
},
"execution": {
"max_model_turns": 1,
"max_tool_calls_per_turn": 1,
"max_tool_calls_total": 1
},
"resolver_version": "policy-resolver-v1",
"source_policy_ids": [
"<string>"
],
"tokens": {
"max_tokens": 1,
"max_tokens_per_call": 1
},
"tools": {
"allowed": [
"<string>"
],
"denied": [
"<string>"
]
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}