Workspace code execution policy
Read a workspace's code-execution policy.
Takes the same role as setting it (an organization owner/admin, or an owner/admin of this workspace), because the policy describes the workspace's security and billing posture rather than one member's allowance. A workspace with no policy answers with the unconfigured one (configured: false), which is the deployment's own behavior described in the same shape rather than a 404.
Enter your API key here (sent as Otari-Key header).
Successful Response
A workspace's policy, or the unconfigured policy it has without one.
Who runs the code a request's code-execution tool asks for.
Values are read without regard to case or surrounding whitespace.
Validation Error
GET /api/v1/workspaces/{workspace_id}/code-execution-policy HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"allowed_images": [
"text"
],
"available_tools": [
"text"
],
"configured": true,
"created_at": "text",
"default_enabled": true,
"default_purpose_hint": "text",
"enabled": true,
"exec_timeout_s": 1,
"executor": "auto",
"image": "text",
"max_iterations": 1,
"sandbox_configured": true,
"tools": [
"text"
],
"updated_at": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}Set a workspace's code-execution policy, replacing any existing one.
An organization owner/admin, or an owner/admin of this workspace, may write it. The policy can only narrow what the deployment permits: turning code execution off for the workspace, lowering the loop and execution ceilings, and removing tool kinds from what the sandbox backend serves. It never turns a sandbox the deployment has not configured on, and image may only name one the operator curated (allowed_images on the response reports the set); anything else is refused with 400.
Enter your API key here (sent as Otari-Key header).
The policy to store for a workspace, as a whole.
PUT semantics, ported from the hosted CodeExecutionConfigUpsert:
what is sent is what the workspace has afterwards, so an omitted limit is
cleared rather than left as it was.
Hint used when a request declares otari_code_execution without one of its own
False refuses code execution for this workspace
Ceiling on one execution's runtime in seconds; only ever lowers the effective limit, so at most 60
Who runs a provider-native code-execution declaration for this workspace: 'auto' (the provider when it runs the tool natively for the model, else this gateway's sandbox), 'otari' or 'provider'. Pins over the deployment default and over the request's Otari-Code-Execution header; null leaves both in charge
Sandbox image this workspace's code runs in. Must be one the operator curated into sandbox_allowed_session_images (or the deployment's own sandbox_session_image); null uses the deployment's
Ceiling on tool-loop iterations; only ever lowers the effective limit, so at most 25
Code-execution tool kinds this workspace may use, from code_execution, bash_code_execution, text_editor_code_execution. Only ever removes one the backend serves; null exposes whatever it serves
Successful Response
A workspace's policy, or the unconfigured policy it has without one.
Who runs the code a request's code-execution tool asks for.
Values are read without regard to case or surrounding whitespace.
Validation Error
PUT /api/v1/workspaces/{workspace_id}/code-execution-policy HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 134
{
"default_purpose_hint": "text",
"enabled": true,
"exec_timeout_s": 1,
"executor": "auto",
"image": "text",
"max_iterations": 1,
"tools": [
"text"
]
}{
"allowed_images": [
"text"
],
"available_tools": [
"text"
],
"configured": true,
"created_at": "text",
"default_enabled": true,
"default_purpose_hint": "text",
"enabled": true,
"exec_timeout_s": 1,
"executor": "auto",
"image": "text",
"max_iterations": 1,
"sandbox_configured": true,
"tools": [
"text"
],
"updated_at": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}Drop a workspace's policy, returning it to the deployment's behavior.
Idempotent: a workspace that has no policy is already in the state this asks for, so it answers with the unconfigured policy rather than a 404.
Enter your API key here (sent as Otari-Key header).
Successful Response
A workspace's policy, or the unconfigured policy it has without one.
Who runs the code a request's code-execution tool asks for.
Values are read without regard to case or surrounding whitespace.
Validation Error
DELETE /api/v1/workspaces/{workspace_id}/code-execution-policy HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"allowed_images": [
"text"
],
"available_tools": [
"text"
],
"configured": true,
"created_at": "text",
"default_enabled": true,
"default_purpose_hint": "text",
"enabled": true,
"exec_timeout_s": 1,
"executor": "auto",
"image": "text",
"max_iterations": 1,
"sandbox_configured": true,
"tools": [
"text"
],
"updated_at": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}Last updated
Was this helpful?
