Skip to content

OS Sandbox Connector

The OS Sandbox connector provides Agentcy with the ability to provision and interact with isolated operating system environments. It supports multiple sandbox providers and offers 5 live tools for provisioning, command execution, and file operations.

Authentication

Configuration depends on the sandbox provider. Local sandboxes may not require credentials, while cloud providers need API keys.

json
{
  "name": "OS Sandbox",
  "source_type": "os",
  "config": {
    "provider": "docker_host",
    "server_url": "unix:///var/run/docker.sock",
    "timeout_secs": 30
  }
}
VariableRequiredDescription
providerYesSandbox provider: local, opensandbox, vercel_sandbox, docker_host, kubernetes
server_urlDependsServer URL for remote providers
api_keyDependsAPI key for cloud providers (OpenSandbox, Vercel)
worker_idNoSpecific worker/node to target
timeout_secsNoCommand execution timeout in seconds (default: 30)

WARNING

The local provider runs commands directly on the host machine. Use docker_host or kubernetes for proper isolation in production.

Live Tools (5)

ToolDescriptionArguments
os_provision_sandboxProvision a new sandbox environmentimage?, cpu?, memory?, env?
os_execute_commandExecute a shell command in a sandboxsandbox_id, command, timeout?
os_read_fileRead a file from the sandbox filesystemsandbox_id, path
os_write_fileWrite a file to the sandbox filesystemsandbox_id, path, content
os_terminate_sandboxTerminate and clean up a sandboxsandbox_id

Example: Agent Using OS Sandbox Tools

User: "Create a sandbox and test if this Python script works"

Agent: I'll provision a sandbox and run the script.
→ Calls os_provision_sandbox(image: "python:3.12-slim")
→ Returns sandbox_id: "sbx-xyz789"
→ Calls os_write_file(sandbox_id: "sbx-xyz789", path: "/app/script.py", content: "...")
→ Calls os_execute_command(sandbox_id: "sbx-xyz789", command: "python /app/script.py")
→ Returns: "Script executed successfully. Output: ..."
User: "Clean up the sandbox"

Agent: I'll terminate it.
→ Calls os_terminate_sandbox(sandbox_id: "sbx-xyz789")
→ Returns: "Sandbox sbx-xyz789 terminated."

ETL Ingestion

This connector does not support ETL ingestion. All tools operate as live interactions with sandbox environments.

Configuration Reference

json
{
  "name": "OS Sandbox",
  "source_type": "os",
  "config": {
    "provider": "docker_host",
    "server_url": "unix:///var/run/docker.sock",
    "api_key": null,
    "worker_id": null,
    "timeout_secs": 30
  }
}
FieldTypeDefaultDescription
providerstringrequiredSandbox provider
server_urlstring--Server URL for remote providers
api_keystring--API key for cloud providers
worker_idstring--Specific worker/node to target
timeout_secsnumber30Command execution timeout in seconds

Troubleshooting

ErrorCauseFix
Connection refusedDocker daemon or remote server unreachableVerify server_url and that the service is running
Permission deniedInsufficient permissions for Docker socketAdd the user to the docker group or adjust socket permissions
Image not foundRequested container image does not existPull the image first or use a valid image name
Sandbox not foundSandbox was already terminated or expiredProvision a new sandbox
Command timeoutCommand exceeded timeout_secsIncrease timeout_secs or optimize the command
Resource limit exceededSandbox hit CPU or memory limitsProvision with higher cpu or memory values

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.