Overview
When Blocks agents work on your code, they execute in a secure sandbox environment. Each sandbox is based on the Blocks base image, which comes pre-installed with common development tools, programming languages, and CLI utilities. This ensures agents can immediately start working without waiting for basic dependencies.What’s Included
The Blocks base image includes a comprehensive set of tools organized by category:Build Tools & Compilers
Essential tools for compiling and building code:- build-essential - Meta-package including GCC, G++, Make, and other build tools
- gcc - GNU C Compiler
- g++ - GNU C++ Compiler
- make - Build automation tool
- pkg-config - Library compilation helper
- libssl-dev - SSL development libraries
Programming Languages & Runtimes
Pre-installed language toolchains:- Node.js - JavaScript runtime with npm package manager
- Rust - Stable toolchain via rustup (includes cargo, rustc, rustfmt)
Version Control & Collaboration
Tools for working with repositories:- git - Distributed version control system
- gh - Official GitHub CLI for managing issues, PRs, and repositories
- glab (v1.80.4) - GitLab CLI for GitLab workflows
CLI Utilities
Common command-line tools:- curl - Data transfer tool
- jq - JSON processor
- unzip - Archive extraction
- procps - Process monitoring utilities (ps, top, etc.)
- sudo - Privilege escalation
- ripgrep - Fast recursive search tool (rg)
- vim - Text editor
- direnv - Environment variable manager
Database Tools
- postgresql-client - PostgreSQL client tools (psql, pg_dump, etc.)
Cloud & Infrastructure
Tools for cloud services and infrastructure:- AWS CLI - Amazon Web Services command-line interface (via pip)
- Pulumi ESC CLI - Pulumi Environments, Secrets, and Configuration
Networking & Remote Access
- openssh-client - SSH client for secure remote connections
- tailscale - Zero-config VPN for secure networking
- frpc (v0.65.0) - Fast Reverse Proxy client for tunneling
- ttyd (v1.7.7) - Terminal sharing over web
System Libraries
Required libraries for graphical and system operations:- ca-certificates - Common CA certificates for SSL/TLS
- libxcb1 - X11 protocol C-language binding
- libx11-6 - X11 client library
- libx11-xcb1 - X11/XCB interop library
When You Need Additional Tools
While the base image includes many common tools, your project may require additional dependencies:- Language-specific tools - Python (pip packages), Ruby (gems), Go binaries
- Database clients - MySQL, MongoDB, Redis clients
- Build tools - Gradle, Maven, CMake
- Testing frameworks - pytest, Jest, RSpec
- Custom binaries - Project-specific CLI tools
- Cloud provider tools - Google Cloud SDK, Azure CLI, Terraform
Using Post-Clone Scripts
To add custom binaries or install additional tools, use post-clone scripts. These scripts run automatically after Blocks clones your repository and before the agent starts working.Creating a Post-Clone Script
-
Create a
.blocksdirectory in your repository root: -
Create a script file named
post-cloneorpost-clone.sh: - Add your installation commands:
- Basic Example
- Install Custom Binary
- Multiple Languages
- Database Tools
Best Practices
Use set -e for error handling
Use set -e for error handling
Always start your script with This prevents the agent from starting work with incomplete dependencies.
set -e to exit immediately if any command fails:Make scripts idempotent
Make scripts idempotent
Design scripts to run safely multiple times:
Cache dependencies when possible
Cache dependencies when possible
Use lock files to speed up installation:
Log progress clearly
Log progress clearly
Add echo statements to help debug issues:
Keep scripts fast
Keep scripts fast
Only install what you need:
Common Use Cases
Installing Language Runtimes
Installing Build Tools
Setting Up Environment Variables
Troubleshooting
Script fails silently
Script fails silently
Ensure you’re using
set -e at the start of your script. Without it, errors are ignored and the agent continues with incomplete setup.Tool not found during agent execution
Tool not found during agent execution
Make sure binaries are installed in a directory on the PATH (
/usr/local/bin, /usr/bin) or export PATH in your script:Permission denied errors
Permission denied errors
Ensure scripts and binaries have execute permissions:
Script takes too long
Script takes too long
Optimize installation steps:
- Use
apt-get install -yto skip prompts - Use
npm ciinstead ofnpm install - Cache downloads when possible
- Only install required dependencies
Limitations
Root Access: Post-clone scripts run with sudo privileges, allowing installation of system packages. Use this power responsibly and only install trusted software.

