Documentation Index
Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Sandbox
Run isolated commands and file operations in ephemeral sandbox sessions. Use the sandbox when your app needs short-lived, isolated execution for tasks like code generation, repo inspection, file transformation, or script execution. The sandbox client talks to authenticated sandbox session APIs. In practice, that means you need either Veryfront Cloud credentials or your own compatible backing API/service layer for/sandbox-sessions.
Create a sandbox session
UseSandbox.create() with sandbox API credentials. In local development,
VERYFRONT_API_TOKEN plus a reachable VERYFRONT_API_URL is the default path.
In remote requests, request-scoped credentials can be used automatically.
getProjectId() so lazy exec and async job calls inherit the latest project reference automatically:
authToken
explicitly. This can be a JWT or a Studio-generated API key.
If you need project-scoped billing or isolation, pass projectId when creating the session.
Execute commands
Buffered execution:Read and write files
Lifecycle best practices
- Always call
await sandbox.close()infinallyblocks. - Prefer
Sandbox.createLazy()for agent-style workflows that may not need a session every run. - Use
sandbox.heartbeat()during long-running sessions to avoid idle timeouts. - Persist
sandbox.idonly when you need reconnect semantics. - Keep auth tokens and API keys server-side only. Do not expose them to browsers.
Example with cleanup
Next
- MCP Server — expose tools, prompts, and resources over MCP
- Agents — orchestrate sandbox-backed workflows with agents
Related
veryfront/sandbox— sandbox API reference