# Sprites Overview Source: https://docs.sprites.dev/ Persistent, hardware-isolated execution environments for arbitrary code ![Floating islands enclosed in bubbles, each containing its own isolated world with a server, mountains, and palm trees](https://docs.sprites.dev/images/sprites.png) Running arbitrary code safely is hard. You need strong isolation, persistent state between runs, and fast startup times—without the complexity of managing infrastructure yourself. Sprites are persistent, hardware-isolated Linux environments for running arbitrary code. It's like having a small, stateful computer you can spin up on demand. Unlike serverless functions, Sprites keep their filesystem and memory between runs. They're useful for things like AI agents, persistent development environments, or user-submitted code.
*Watch: A 3-minute introduction to Sprites—see how to create, execute commands, and manage persistent environments.* ## What makes Sprites different? | Feature | Serverless Functions | Sprites | |---------|----------------------|---------| | **State** | Ephemeral | **Persistent** ✓ | | **Filesystem** | Read-only or temporary | **Full ext4** ✓ — persists between runs | | **Startup** | Cold starts (100ms–seconds) | **Instant** ✓ — wake from hibernation | | **Billing** | Per-invocation | **Per-second** ✓ — compute free when idle | | **Environment** | Fixed container image | **Full Linux** ✓ — install any tools | | **Isolation** | Container-level | **Hardware-level** ✓ — dedicated microVM | ## Use Cases Sprites are ideal for: - **AI Code Execution** - Running code generated by language models (like Claude Code) in isolated, secure environments - **Untrusted Code** - Isolating and executing user-submitted code safely without risking the rest of your system - **Development Environments** - Building persistent development environments that maintain state between sessions - **Long-lived Services** - Hosting services that go idle automatically and resume on request - **CI/CD Tasks** - Testing code against live git repositories with full environment access ## Core Concepts ### Persistence Every Sprite has a persistent, standard ext4 filesystem. During execution, data is written to fast NVMe storage. When the Sprite goes idle, that data is backed up to durable object storage and automatically restored when it wakes up. ### Automatic Idle Behavior Sprites become `warm` immediately when idle, and may eventually go `cold`. While idle, there are no compute charges and your full filesystem is preserved. The Sprite wakes on the next request—`warm` Sprites resume quickly, `cold` Sprites take a bit longer. ### HTTP Access Every Sprite gets a unique URL, making it easy to expose web services or APIs running inside, without a lot of extra setup. ## Next Steps - [Quickstart](https://docs.sprites.dev/quickstart) - Install the CLI, create your first Sprite, and explore the features - [CLI Reference](https://docs.sprites.dev/cli/commands) - Review the complete command documentation