# Sandbox concepts

A Sandbox Task runs a named package in a Sandbox, away from your app process. The app chooses the provider in Vite config. The task code stays portable. The provider supplies the isolation, filesystem, network, and process limits.

## A run has two sides

The app calls `runSandboxTask(name, payload, options)` and gets `[error, data]`. The task gets the payload in its entry point. Validate requests and authenticate users in the app. Pass only the data the task needs.

The result reports the run outcome. No `error` means the entry point returned. It does not give the Sandbox access to your app's filesystem or credentials.

## Provider choice changes the boundary

Cloudflare Sandbox and Vercel Sandbox run the same packages, but their limits and local development differ. Choose the provider in [Hosts](https://vitehub.dev/docs/sandbox/hosts). Check the generated output with the ViteHub CLI before you deploy.

Read [Sandbox Task configuration](https://vitehub.dev/docs/sandbox/configure) for package layout and options. Read [Limits and errors](https://vitehub.dev/docs/sandbox/limits-and-errors) before you accept untrusted input.

<!-- vitehub-docs:section-links -->
## In this section

- [Overview](https://vitehub.dev/raw/docs/sandbox.md)
- [Get started](https://vitehub.dev/raw/docs/sandbox/get-started.md)
- [Configure](https://vitehub.dev/raw/docs/sandbox/configure.md)
- [Server API](https://vitehub.dev/raw/docs/sandbox/server-api.md)
- [Agent capability](https://vitehub.dev/raw/docs/sandbox/agent-capability.md)
- [Hosts](https://vitehub.dev/raw/docs/sandbox/hosts.md)
- [Limits and errors](https://vitehub.dev/raw/docs/sandbox/limits-and-errors.md)
- [Concepts](https://vitehub.dev/raw/docs/sandbox/concepts.md) (this page)

Next: [SANDBOX_R0029](https://vitehub.dev/raw/docs/sandbox/diagnostics/sandbox_r0029.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
