Run a command in a session's sandbox
Runs one command as the sandbox’s agent user (never root) in /workspace or a directory under it, and returns its exit code and output (stdout capped at 64 KiB, stderr at 16 KiB). The command’s network traffic goes through the session’s egress rules like the agent’s. Allowed while the session is ready (409 during a run, while an approval is pending, or paused); at most 30 per minute per session (429). Recorded on the transcript as session.exec (argv and exit code, never env values).
curl --request POST \
--url https://api.veri.studio/v1/sessions/{session_id}/exec \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"argv": [
"<string>"
],
"cwd": "<string>",
"env": {},
"timeout_s": 1
}
'import requests
url = "https://api.veri.studio/v1/sessions/{session_id}/exec"
payload = {
"argv": ["<string>"],
"cwd": "<string>",
"env": {},
"timeout_s": 1
}
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({argv: ['<string>'], cwd: '<string>', env: {}, timeout_s: 1})
};
fetch('https://api.veri.studio/v1/sessions/{session_id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "<string>",
"exit_code": 123,
"stdout": "<string>",
"stderr": "<string>",
"truncated": true,
"timed_out": true,
"duration_ms": 123,
"env_dropped": [
"<string>"
]
}Authorizations
API key with the vk_ prefix. Create one from the dashboard.
Path Parameters
Session ID
Body
Unknown fields are refused (422): the runtime's operator-only switches
(root, harness_env) are not part of this API, and a body naming them
must fail loudly rather than run as the agent user without saying so.
The command and its arguments (no shell: use ["sh", "-c", "..."]
for pipes). 1..=256 entries.
Working directory, /workspace (default) or a path under it.
Extra environment variables, on top of the session's own (what the
agent sees, model credentials excluded). ANTHROPIC_*, OPENAI_*,
VERI_*, PATH and LD_* are dropped (listed in env_dropped).
Show child attributes
Show child attributes
Seconds before the command is killed, 1..=300 (default 60).
x >= 0Response
The command ran (any exit code)
At most 64 KiB (truncated when cut).
At most 16 KiB (truncated when cut).
The command ran past timeout_s and was killed.
env keys that were dropped (reserved names).
curl --request POST \
--url https://api.veri.studio/v1/sessions/{session_id}/exec \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"argv": [
"<string>"
],
"cwd": "<string>",
"env": {},
"timeout_s": 1
}
'import requests
url = "https://api.veri.studio/v1/sessions/{session_id}/exec"
payload = {
"argv": ["<string>"],
"cwd": "<string>",
"env": {},
"timeout_s": 1
}
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({argv: ['<string>'], cwd: '<string>', env: {}, timeout_s: 1})
};
fetch('https://api.veri.studio/v1/sessions/{session_id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "<string>",
"exit_code": 123,
"stdout": "<string>",
"stderr": "<string>",
"truncated": true,
"timed_out": true,
"duration_ms": 123,
"env_dropped": [
"<string>"
]
}
