/iblai-vibe-agent-sandbox
Mirrored from
iblai/baseΒ·skills/agents/iblai-vibe-agent-sandbox/SKILL.md. This page is generated β edit it in the repository, not here.
Add the agent Sandbox tab -- choose where the agent runs code and, for a Permanent Virtual Machine, manage its Claw workspace. A Sandbox Type card ("Choose where this agent runs code. The options differ in how long they last and what they cost, and only one can be on at a time.") picks one of three kinds:
- Calculator β the cheapest option. Quick math, dates and small data tasks while the agent replies; nothing is kept once the reply is done.
- Ephemeral Virtual Machine β a private Linux computer that starts when the agent runs a command and is deleted once the reply is done. It runs real programs and makes files, and costs extra each time it is used.
- Permanent Virtual Machine β a Claw computer that stays on between chats and keeps its own skills and plugins; you are billed for the chats it handles. It works once the agent is connected to a Claw instance, and selecting it reveals the instance management sections below the card.
Before @iblai/web-containers 2.0.0 they were called Computing Runtime,
Virtual Machine Shell and Claw; the enable_* flags keep their names.
With Permanent Virtual Machine selected, the tab connects the agent to an OpenClaw instance and edits the agent-workspace prompt files (Identity, Soul, User Context, Tools, Agents, Bootstrap, Heartbeat, Memory) backing the agent's runtime behaviour. Push pulls the current configuration onto the connected sandbox; Auto Push on Save pushes after every edit.
With Ephemeral Virtual Machine selected, a Network Access section
appears under the card β the VM's egress profile, its network and its
environment variables. That section has its own skill:
/iblai-vibe-agent-virtual-machine (and
/iblai-vibe-virtual-machine for the organization-wide networks and
environment variables it draws on).
Agent Skills are managed independently of the sandbox β see
/iblai-vibe-agent-skills for the Skills surface (skills catalog,
per-agent assignment, skill resources, and the chat / picker).










Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.
OpenClaw workspace & sandbox runtime
- Post-installation setup β install this repo's skills into the OpenClaw
agent and swap the workspace
AGENTS.md:references/openclaw-post-installation-setup.md. - NemoClaw sandbox hardening β running the agent inside a NemoClaw /
OpenShell sandbox:
references/nemoclaw-sandbox.md.
Prerequisites
- Auth must be set up first (
/iblai-vibe-auth) - MCP server + skills configured (
@iblai/mcpin.mcp.json) - Ask the user for a real
mentorId(agent UUID). Do NOT invent one. - Only for Permanent Virtual Machine: a reachable OpenClaw instance URL plus a Gateway Token to register the first instance. Without one, the Sandbox section sits empty ("Add Instance") and the Prompts section is gated until a config is connected. Calculator and Ephemeral Virtual Machine need no external instance β they are single toggles.
Step 1: Check Environment
Before proceeding, check for an iblai.env in the project root. Look for
PLATFORM, DOMAIN, and TOKEN variables. If the file does not exist or
is missing these variables, tell the user:
"You need an iblai.env with your platform configuration. Download the
template and fill in your values:
curl -o iblai.env https://raw.githubusercontent.com/iblai/base/refs/heads/main/iblai.env"
Step 2: Mount the two sections
SandboxConfig and AgentConfigPrompts are independent
components β neither reads from AgentSettingsProvider. They each
take platformKey and mentorUniqueId as required props. Compose them
on a single page so the user sees Sandbox β Prompts, top to
bottom.
// app/(app)/agents/[mentorId]/sandbox/page.tsx
"use client";
import { useEffect, useState } from "react";
import { useParams } from "next/navigation";
import {
SandboxConfig,
AgentConfigPrompts,
} from "@iblai/iblai-js/web-containers";
export default function AgentSandboxPage() {
const { mentorId } = useParams<{ mentorId: string }>();
const [platformKey, setPlatformKey] = useState("");
const [username, setUsername] = useState("");
useEffect(() => {
try {
const raw = localStorage.getItem("userData");
if (raw) {
const parsed = JSON.parse(raw);
setUsername(parsed.user_nicename ?? parsed.username ?? "");
}
const resolvedTenant =
localStorage.getItem("app_tenant") ??
(() => {
try {
return JSON.parse(localStorage.getItem("current_tenant") ?? "{}").key;
} catch { return undefined; }
})() ??
localStorage.getItem("tenant") ??
"";
setPlatformKey(resolvedTenant);
} catch {}
}, []);
if (!platformKey) return null;
return (
<div className="flex flex-1 flex-col gap-8 bg-white p-6">
<SandboxConfig
platformKey={platformKey}
mentorUniqueId={mentorId}
username={username}
/>
<AgentConfigPrompts
platformKey={platformKey}
mentorUniqueId={mentorId}
/>
</div>
);
}
AgentConfigPrompts self-gates on the connected sandbox config β it
calls useGetClawMentorConfigQuery and short-circuits when no config
exists, so it is safe (and intended) to mount both together. The
Prompts section appears only after the user connects an instance.
SandboxConfig's username prop is optional β if omitted, the
component falls back to getUserName() (which reads from
localStorage.userData). Pass it explicitly when you already have it
to avoid the extra read.
Step 2.5: Sandbox types (enable_computational_runtime / enable_virtual_machine / enable_claw)
The Sandbox Type card at the top of SandboxConfig selects how
the agent runs code. Three boolean flags back it, all read from the
agent's settings and written through the standard agent-settings
update endpoint:
| Kind | Flag | How long it lasts, what it costs |
|---|---|---|
| Calculator | enable_computational_runtime | Small JavaScript snippets with strict memory and time limits; no programs, internet or files. Nothing outlives the reply; the cheapest option |
| Ephemeral Virtual Machine | enable_virtual_machine | A private Linux computer, created when the agent runs a command and deleted when that reply is done. Small files in /workspace come back for later replies in the same chat; installed programs do not. No internet unless Network Access allows it. Costs extra each time it is used |
| Permanent Virtual Machine | enable_claw | A Claw computer that stays on and handles the agent's chats instead of the built-in agent, keeping what it knows between chats. Its chats are billed against your credits. The built-in tools (document search, Calculator, Ephemeral Virtual Machine) don't apply while it is on. Unlocks the OpenClaw sections below |
The kinds are mutually exclusive β only one can be enabled at a
time. The component enforces this client-side: enabling one kind
turns the other two off in the same PUT, and toggling the
active kind off leaves none enabled. Switches flip optimistically and
revert with an error toast if the save fails.
SandboxConfig handles all of this itself (via
useGetMentorSettingsQuery + useEditMentorMutation), so the host
app no longer needs to gate the Sandbox tab on enable_claw β mount
the tab and let users pick a type. Custom UI toggling the flags
directly should mirror the exclusivity:
import { useEditMentorMutation } from "@iblai/iblai-js/data-layer";
const [editMentor] = useEditMentorMutation();
// Select Ephemeral Virtual Machine (turning the other kinds off):
await editMentor({
mentor: mentorUniqueId,
org: platformKey,
userId: username,
formData: {
enable_claw: false,
enable_computational_runtime: false,
enable_virtual_machine: true,
},
}).unwrap();
Pre-existing Claw instances and bound configs are preserved when switching kinds β the flags only affect which sandbox the agent uses and which sections render, not the stored data.
Step 3: Use MCP Tools for Customization
get_component_info("SandboxConfig")
get_component_info("AgentConfigPrompts")
get_component_info("LLMProviderModal")
Component Props
Both components import from @iblai/iblai-js/web-containers.
<SandboxConfig>
| Prop | Type | Required | Description |
|---|---|---|---|
platformKey | string | Yes | Organization key (org slug) |
mentorUniqueId | string | Yes | Agent UUID |
username | string | null | No | Current user. Falls back to getUserName() from localStorage when omitted |
<AgentConfigPrompts>
| Prop | Type | Required | Description |
|---|---|---|---|
platformKey | string | Yes | Organization key (org slug) |
mentorUniqueId | string | Yes | Agent UUID |
What each section renders
Sandbox Type (kind selection)
- Three switch rows β Calculator, Ephemeral Virtual Machine,
Permanent Virtual Machine β each with a sentence on how long it lasts
and what it costs, and an info tooltip with the longer explanation.
Only one can be on at a time: enabling one turns the others off in the
same save; switches update optimistically and revert on failure. A
switch's accessible name is the kind and its state ("Calculator on");
its test id is
sandbox-kind-computational-runtime,sandbox-kind-virtual-machineorsandbox-kind-claw. - Everything below the card (instances, connected card, Auto Push, Push, Model) renders only while Permanent Virtual Machine is on β the claw-config query is skipped entirely for the other kinds.
Sandbox (instance management + connection β Permanent Virtual Machine only)
- Instances table β searchable, paginated (5 per page). Columns: Name, URL, Type, Status (Active / Error), Health (Healthy / Unhealthy with full error in tooltip), Version, Last Check.
- Add Instance β opens a "New Instance" dialog: Name, Type (OpenClaw or IronClaw), Server URL, Gateway Token. The token is write-only β never read back from the API.
- Connect β an outline button beside each row's kebab menu that binds the instance to the current agent; disabled while the row's Status reads Error (tooltip "This instance is unhealthy. β¦") and while a connect is in progress.
- Per-row actions (kebab menu): Run Checks (health + connectivity ping), Edit (Name, Type, Server URL, Gateway Token; Save stays disabled until the token is entered again), Delete.
- Connected Instance card β once an agent is bound, the table collapses into a card showing Name, URL, Status, Health, Last Check, with Run Checks and Disconnect actions.
- Auto Push on Save β when on, every prompt edit pushes to the sandbox. When off, the user pushes manually.
- Push Configuration β manual Push button + "Last pushed" / "Never pushed" indicator. Disabled when the agent has no populated prompt fields (the API rejects empty pushes server-side and we mirror that locally).
- Model β opens the
LLMProviderModalto pick a provider / model ({provider}/{name}). Writes to the agent config'smodelfield.
Prompts (agent workspace files)
Eight rows, each with a (i) info tooltip and an Edit button
that opens a RichTextEditor modal:
| Field | Backed by | Purpose |
|---|---|---|
| Identity | IDENTITY.md | Agent persona, name, creature type, visual description |
| Soul | SOUL.md | Behavioural guidelines, personality, communication style |
| User Context | USER.md | Deployment context, SSH hosts, device names, TTS voices |
| Tools | TOOLS.md | Tool usage notes, device names, API aliases |
| Agents | AGENTS.md | Multi-agent routing, agent ids, workspaces |
| Bootstrap | BOOTSTRAP.md | One-time first-run instructions |
| Heartbeat | HEARTBEAT.md | Periodic task definitions |
| Memory | MEMORY.md | Seed memory, curated long-term facts |
Updates are upserts β the first PATCH bootstraps the row.
Related Exports
From @iblai/iblai-js/web-containers:
SandboxConfig,AgentConfigPromptsβ the two section components.useLlmProviderCatalogueβ resolves a provider key to its display name and logo, for custom UI that shows the chosen model (see/iblai-vibe-agent-llm).
From @iblai/iblai-js/web-containers/next:
LLMProviderModalβ the LLM tab's provider/model picker (/iblai-vibe-agent-llm), mountable standalone (e.g. for an "override default model" flow outside the sandbox). The Model row's own picker is internal and not exported.LLMProvider,LLMProviderTypeβ types for the picker (LLMProviderTypeis the{ name, chat_models }provider row;LLMProviderthe full row withdisplay_nameandlogo).
From @iblai/data-layer:
useGetClawMentorConfigQuery,useCreateClawMentorConfigMutation,useDeleteClawMentorConfigMutation,usePushClawConfigMutationβ connect / disconnect / push.useGetClawInstancesQuery,useCreateClawInstanceMutation,useUpdateClawInstanceMutation,useDeleteClawInstanceMutation,useHealthCheckClawInstanceMutation,useTestConnectivityClawInstanceMutationβ instance CRUD + checks.useGetAgentConfigQuery,useUpdateAgentConfigMutationβ prompt fields + model.
Skills hooks and types (useGetAgentSkillsQuery, AgentSkill, β¦)
are documented in /iblai-vibe-agent-skills.
Step 4: Verify
Run /iblai-vibe-ops-test before telling the user the work is ready, and give
every page, control and state this skill added its own checkpoint β one Playwright
test titled <ID> Β· β¦ in e2e/journeys/, listed in e2e/coverage.json;
pnpm e2e:coverage must pass:
pnpm build-- must pass with zero errorspnpm test-- vitest must pass- Touch test
/agents/<id>/sandboxin the browser as/iblai-vibe-ops-testsays: open it, use every control this skill added, read the console, check the phone width.
Important Notes
- Redux store: Must include
mentorReducerandmentorMiddleware initializeDataLayer(): 5 args (v1.2+)@reduxjs/toolkit: Deduplicated via webpack aliases innext.config.ts- Peer deps:
sonnerand@iblai/iblai-web-mentormust be installed (pnpm add sonner @iblai/iblai-web-mentor) - No
AgentSettingsProvider: Both components take raw props. If your app already mountsAgentSettingsProviderfor sibling tabs, read its values viauseAgentSettings()in the page wrapper and forward them. mentorUniqueIdvsmentorId: The sandbox endpoints key on the agent's UUID (calledmentorUniqueIdin the SDK), not the integer pk. Pass the same UUID you use everywhere else in the agent-* family.- Gateway token write-only: The API never returns the token. Both
instance dialogs require it, so every edit means entering it again.
useUpdateClawInstanceMutationitself sends aPATCHthat leaves out an emptygateway_token, which keeps the stored token. - Push gating:
usePushClawConfigMutationreturns400 No configuration to pushwhen every agent-config field is empty. The component mirrors that gate locally β the manual Push button is disabled until the user has saved at least one prompt. - 404 β error:
useGetClawMentorConfigQuery404s when no agent has been bound to a sandbox β that's the "not connected" state, not a failure. The component treatsisErrorasnullhere. Custom consumers should do the same. - Sandbox kinds are mutually exclusive:
SandboxConfigowns the three flags (enable_computational_runtime,enable_virtual_machine,enable_claw) and enforces the one-at-a-time rule in eachPUT(see Step 2.5) β host-side tab gating onenable_clawis no longer required. Custom UI writing the flags directly must clear the other two when enabling one. Existing Claw instances and configs are preserved across kind switches. - Flag homes:
enable_clawandenable_virtual_machinelive onMentorSettings;enable_computational_runtimelives onMentorβ all three are readable from the settings response and writable through the same agent-settings update (useEditMentorMutation). - Brand guidelines: BRAND.md
Sandbox REST API
For custom UI beyond these three components. All endpoints are
prefixed with ${dmUrl}/api/ai-mentor/orgs/{org}/ where dmUrl is
NEXT_PUBLIC_API_BASE_URL. Auth: Authorization: Token <token>.
Sandbox type flags (agent settings)
| Method | Path | Body |
|---|---|---|
| GET | users/{username}/mentors/{mentor_unique_id}/settings/ | Returns the full settings object, including enable_claw, enable_virtual_machine, and enable_computational_runtime (booleans) |
| PUT | users/{username}/mentors/{mentor_unique_id}/settings/ | e.g. { "enable_virtual_machine": true, "enable_claw": false, "enable_computational_runtime": false } |
The kinds are mutually exclusive by convention, enforced client-side:
when enabling one flag, send the other two as false in the same
request. Only enable_claw unlocks the OpenClaw endpoints below.
Instances (organization-scoped)
| Method | Path | Purpose |
|---|---|---|
| GET | claw/instances/ | List instances |
| POST | claw/instances/ | Register a new instance |
| PATCH | claw/instances/{id}/ | Update name / URL / type / token |
| DELETE | claw/instances/{id}/ | Delete |
| POST | claw/instances/{id}/health-check/ | Run a health probe |
| POST | claw/instances/{id}/test-connectivity/ | Run a connectivity probe |
Create / update body:
{
"name": "acme-support-vm",
"server_url": "https://vm-1.acme-demo.example",
"claw_type": "openclaw",
"gateway_token": "<gateway token>"
}
gateway_token is write-only. Omit on update to keep the existing value.
Sandbox binding (binds an instance to an agent)
| Method | Path | Purpose |
|---|---|---|
| GET | mentors/{mentor_unique_id}/claw-config/ | Read current binding (404 = not connected) |
| POST | mentors/{mentor_unique_id}/claw-config/ | Connect β body { "server": <instanceId>, "enabled": true } |
| DELETE | mentors/{mentor_unique_id}/claw-config/ | Disconnect |
| POST | mentors/{mentor_unique_id}/claw-config/push-config/ | Push current agent config to the sandbox |
push-config/ returns 400 No configuration to push when every agent-config
field is empty. Pre-flight by checking the agent config locally.
Agent configuration (prompts + model)
| Method | Path | Purpose |
|---|---|---|
| GET | mentors/{mentor_unique_id}/agent-config/ | Read prompts + model |
| PATCH | mentors/{mentor_unique_id}/agent-config/ | Upsert β first write bootstraps the row |
Body fields: identity, soul, user_context, tools,
agents, bootstrap, heartbeat, memory (each is the markdown
body of the corresponding *.md workspace file), plus model
("{provider}/{name}").
Agent Skills endpoints (catalog, resources, per-agent assignments)
are documented in /iblai-vibe-agent-skills.
Virtual machine networks & environment variables
The Ephemeral Virtual Machine kind runs code in a private Linux
computer, created when the agent runs a command and deleted when that reply
is done, with no network by default. What it may reach is chosen per agent through
three settings fields β virtual_machine_egress
(none | registries | public | custom),
virtual_machine_network_policy_id and virtual_machine_secret_ids β and
the organization-wide networks and environment variables they point at
live under /api/ai-account/orgs/{org}/ (virtual-machine-network-policy/,
virtual-machine-secret/).
That whole surface has its own skills:
/iblai-vibe-agent-virtual-machineβ the Sandbox tab's Network Access section: egress profile, network picker, environment variables, the rules the UI enforces before saving, and the agent settings fields./iblai-vibe-virtual-machineβ organization settings β Network and Secrets β Environment Variables: the tables, their dialogs, validation limits, RBAC verbs and the REST endpoints.
Billing: VM lifetime is charged to the chatting user's credits,
$1 per 10 minutes by default (an organization can have its own rate),
prorated per second.
Common errors
404 Not Foundonclaw-config/β the agent isn't connected. Treat as the "not connected" state, not a failure.400 No configuration to pushβ at least one prompt field must be populated before pushing.400 Gateway token requiredβ required on instance create; on edit only when rotating.