Try an action against the policies, or against unsaved policy text, without doing it
POST
/policies/check
const url = 'https://api.global.stillbox.example/v1/policies/check';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"action":"tool","resource":"example","input":{},"sandbox_id":"example","source":"example","history":{"sandbox":{"hour":1,"day":1},"sandbox_same":{"hour":1,"day":1},"org":{"hour":1,"day":1},"org_same":{"hour":1,"day":1},"approved_day":1,"sandbox_cents_day":1,"org_cents_day":1,"org_cents_month":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.global.stillbox.example/v1/policies/check \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "action": "tool", "resource": "example", "input": {}, "sandbox_id": "example", "source": "example", "history": { "sandbox": { "hour": 1, "day": 1 }, "sandbox_same": { "hour": 1, "day": 1 }, "org": { "hour": 1, "day": 1 }, "org_same": { "hour": 1, "day": 1 }, "approved_day": 1, "sandbox_cents_day": 1, "org_cents_day": 1, "org_cents_month": 1 } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
action
required
string
resource
required
The tool (Bash, Edit, WebFetch, …) or the model
string
input
The tool’s input, e.g. {“command”: “git push”}
object
key
additional properties
any
sandbox_id
Check as this sandbox
string
source
Unsaved policy text to try instead of the saved policies.
string
history
What a policy sees of the past, as context.history and context.spend.
object
sandbox
required
object
hour
required
integer format: int64
day
required
integer format: int64
sandbox_same
required
object
hour
required
integer format: int64
day
required
integer format: int64
org
required
object
hour
required
integer format: int64
day
required
integer format: int64
org_same
required
object
hour
required
integer format: int64
day
required
integer format: int64
approved_day
required
integer format: int64
sandbox_cents_day
required
integer format: int64
org_cents_day
required
integer format: int64
org_cents_month
required
integer format: int64
Responses
Section titled “Responses”What the policies would decide
Media typeapplication/json
object
decision
required
object
effect
required
string
policy
string
reason
string
four_eyes
boolean
history
required
What a policy sees of the past, as context.history and context.spend.
object
sandbox
required
object
hour
required
integer format: int64
day
required
integer format: int64
sandbox_same
required
object
hour
required
integer format: int64
day
required
integer format: int64
org
required
object
hour
required
integer format: int64
day
required
integer format: int64
org_same
required
object
hour
required
integer format: int64
day
required
integer format: int64
approved_day
required
integer format: int64
sandbox_cents_day
required
integer format: int64
org_cents_day
required
integer format: int64
org_cents_month
required
integer format: int64
Example
{ "decision": { "effect": "allow" }}The request is invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The API key is missing or invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}No such sandbox in your organization (or no such file)
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}