- OpenHands Enterprise 0.64.0 or later
- Custom images built and pushed as described in Building a Custom Image
How It Works
Custom sandbox images are registered through the Runtime API — a management interface built into OpenHands Enterprise. The process has three steps:- Set an admin password in the install admin UI. This secures the Runtime API so only authorized administrators can register or remove images.
- Register images via the API. Use the helper script below to give each image a name and tell OpenHands where to pull it from. OpenHands pulls the image from the registry you specify and keeps a pool of ready sandboxes for it. No restarts or redeployments are needed — new images become available within about a minute.
- Users choose their environment. Each registered image appears in the user’s Settings → Application → Default Sandbox dropdown. Users pick their default and all their new conversations start in that environment.
Step 1: Confirm the Admin Password
The Runtime API admin endpoints require an admin password.- VM Install
- Helm
The password is auto-generated at install (
{{repl RandomString 32}})
and stored in the admin-password Kubernetes secret. The helper script in
Step 2 reads it from the pod environment automatically — no action
required for a standard installation.To set a memorable password or rotate the generated one:- Open the Admin Console at
https://admin.<your-base-domain>:30000. - Navigate to Config → Sandbox Configuration → Runtime API Admin Password.
- Enter your new password and click Save config, then Deploy.
Step 2: Save the Helper Script
- VM Install
- Helm
The runtime-api is exposed externally at
After the first run, export the discovered values so subsequent runs need
no cluster access at all:
https://runtime-api.<your-base-domain>. All API calls go directly to
that URL — no cluster shell or kubectl exec needed for day-to-day
operations.Save the script below as warm-runtime-configs.sh. On first run it reads
credentials from Kubernetes secrets; export them afterward and you can run
the script entirely without cluster access.Listing authenticates with the regular API key (
X-API-Key). Saving and
deleting use the admin password via a PBKDF2 challenge-response login that
returns a 24-hour JWT. The script handles both flows automatically.Step 3: Save Your First Configuration
Do not write configurations from scratch. The default configuration contains install-specific values (callback URLs, CA bundles, workspace paths) that sandboxes need to function. Fetch it from the API and use it as your template:- VM Install
- Helm
The default
v1_current pool keeps running while you add configurations.
Derive your custom configuration from the template, changing only the image
and pool size, then save it:Configuration Format
The configuration name comes from the URL path (the
save <name> argument),
not the body. A source field appears in list responses (file for
installer-managed entries, db for API-managed entries) but must not be
included in saved configurations.
The application uses the image reference as the sandbox spec ID. Give every
selectable configuration a distinct image reference; configurations that share
an image reference cannot be selected independently.
Step 4: Verify
Confirm your configurations were saved:Updating and Deleting Configurations
Update by saving the same name again:./warm-runtime-configs.sh list — its source changes from db to file.
Keep superseded image tags available in your registry while conversations that
used them can still resume: a paused conversation resumes on its original
image. Delete old tags only after the conversations that used them are gone
(stopped sandboxes are cleaned up after 10 days by default).
After Upgrading OpenHands Enterprise
Returning an Entry to Installer Management
Delete a same-named database override to restore the installer-managed entry on the next reconciler cycle:Troubleshooting
API Reference
The endpoints below are served by the runtime-api service. Admin authentication (required for save and delete):GET /api/admin/challengereturns{challenge, salt, iterations}. Challenges are single-use and expire after 5 minutes.- Compute
PBKDF2-HMAC-SHA256(password, salt + challenge, iterations, dklen=32)and hex-encode the result. POST /api/admin/loginwith{"challenge": ..., "hash": ...}returns{"token": ...}, a JWT valid for 24 hours.- Send
Authorization: Bearer <token>on admin requests.
200 with the effective configuration set:
source: "file" — installer-managed entry. source: "db" — API-managed
entry. On Replicated installs (overlay mode), the list is the full effective
set: ConfigMap entries merged with same-named API entries overriding them. On
Helm installs without overlay mode, only API-saved entries appear while the
database contains any rows.
Create or update a configuration (admin):
200 with the saved configuration. Creates or overwrites; the name
in the URL is the identity.
Delete a configuration (admin):
200 with a confirmation message, or 404 if no database
configuration has that name. When the deleted name also exists in the
installer-managed ConfigMap, that ConfigMap entry becomes effective again.
