AIO Hooks
AIO Hooks let you run startup commands at defined points in the container lifecycle. They are useful for installing lightweight dependencies, preparing files, or starting companion processes.
Startup Order
Hooks
Example
For heavier customization, prefer a custom Docker image so startup remains fast and reproducible.
Runtime Shutdown Hooks
You can also register shutdown hooks while the sandbox is running. These hooks are useful for flushing state or writing a marker before the sandbox exits. The runtime API currently supports the shutdown event.
List registered hooks:
Remove an API-registered hook:
Guidelines
- Keep hook commands idempotent.
- Keep secrets out of hook values and image layers.
- Use custom images for large dependencies.
- Use Workspace for mounted project files.