Execution Model
When you callrun, Contree:
- Spins up an isolated microVM (~2-5 seconds)
- Mounts the specified image as the filesystem
- Injects any files from
directory_state_idorfiles - Executes your command as root
- Captures stdout, stderr, exit code
- Optionally saves the resulting filesystem as a new image
rm -rf /, kernel exploits) are completely safe.
The disposable Flag
| Setting | Behavior | Use Case |
|---|---|---|
true (default) | Changes discarded | Tests, read-only operations |
false | New image created | Installing packages, building |
- When
true,result_imageis a new UUID (changes were saved) - When
false,result_imageequals input image (no snapshot created)
Images
Every image is:- Immutable: Once created, it never changes
- Identified by UUID:
abc123-def456-789012 - Optionally tagged: Human-readable names like
python:3.11
| Aspect | UUID | Tag |
|---|---|---|
| Immutable | Yes | Points to different UUIDs over time |
| When to use | Chaining, one-off operations | Frequently reused base images |
Lineage
When you run withdisposable=false and filesystem changes, Contree creates a parent-child relationship:
Timeouts and Output
- Default timeout: 30 seconds (use
timeoutparameter for longer) - Default output limit: 8000 bytes (~2000 tokens)
- Adjust with:
truncate_output_atparameter