Files
Alex Ezell 46a56dcb8c Add Sprites integration (#1945)
* Add Sprites integration

Adds the Sprites integration page and catalog icon. Sprites (https://sprites.dev)
are persistent, stateful Linux sandboxes from Fly.io with checkpoint/restore,
via the sprites-adk plugin (pip install sprites-adk).

* Refine Sprites page: benefit-forward use cases, precise wording

* Address review: functional heading + runner registration in example

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2026-07-10 16:17:43 -05:00

3.1 KiB

catalog_title, catalog_description, catalog_icon, catalog_tags
catalog_title catalog_description catalog_icon catalog_tags
Sprites Persistent, stateful Linux sandboxes with checkpoint and restore for agent code execution /integrations/assets/sprites.png
code

Sprites plugin for ADK

Supported in ADKPython

The Sprites ADK plugin connects your ADK agent to Sprites — persistent, stateful Linux sandboxes from Fly.io. Unlike ephemeral sandboxes, a Sprite keeps its filesystem, installed packages, and running processes between sessions, and it can checkpoint and restore its entire state — so your agent can snapshot the environment before a risky change and roll back if it goes wrong.

Use cases

  • Persistent development environments: A named Sprite is reused across sessions — packages and files from earlier runs are still there, so long-running projects don't rebuild the environment from scratch each time.

  • Secure code execution: Run agent-generated Python, JavaScript, or bash in an isolated microVM instead of on the host machine.

  • Safe experimentation: Checkpoint the whole environment before package upgrades, migrations, or bulk edits, then restore it if the change breaks things.

  • File workflows: Write scripts and data into the sandbox, run them, and read the results back.

Prerequisites

  • A Sprites account
  • A Sprites API token (set as the SPRITES_TOKEN environment variable)

Installation

pip install sprites-adk

Use with agent

from sprites_adk import SpritesPlugin
from google.adk.agents import Agent
from google.adk.runners import InMemoryRunner

# SpritesPlugin() gives each run a fresh sandbox; SpritesPlugin(sprite_name="my-project")
# reuses one persistent environment across sessions.
plugin = SpritesPlugin(
  # token="your-sprites-token"  # Or set the SPRITES_TOKEN environment variable
)

root_agent = Agent(
    model="gemini-flash-latest",
    name="sandbox_agent",
    instruction="Run code and commands in the Sprite sandbox, not locally.",
    tools=plugin.get_tools(),
)

# Register the plugin on the runner so its lifecycle callbacks and cleanup run.
runner = InMemoryRunner(agent=root_agent, plugins=[plugin])

Available tools

Tool Description
execute_command_in_sprite Run a shell command in the sandbox
execute_code_in_sprite Execute Python, JavaScript, or bash code
write_file_to_sprite Write a text file into the sandbox
read_file_from_sprite Read a text file from the sandbox
create_sprite_checkpoint Snapshot the entire environment (filesystem, packages, processes)
list_sprite_checkpoints List available checkpoints
restore_sprite_checkpoint Roll back to a checkpoint (destructive; requires confirmation)

Additional resources