Last updated

/iblai-vibe-virtual-machine

Mirrored from iblai/vibe · skills/organizations/iblai-vibe-virtual-machine/SKILL.md. This page is generated — edit it in the repository, not here.

Agents on the Virtual Machine Shell sandbox kind run each chat in an isolated Linux VM with no network access by default. Two organization-wide records open it up, and both live in the organization settings' Integrations group:

  • Network — "Manage the networks available to agents' virtual machines." A network is a reusable, named list of the addresses a VM may reach (up to 100 each), picked for an agent under Custom Allowlist.
  • Secrets → Environment Variables — keys an agent's VM can use by name (ACME_API_KEY) but never read. Inside the machine the variable holds a placeholder; the real key is substituted only on TLS requests to the variable's allowed hosts.

Both are shared by every agent in the organization. Turning them on for one agent happens on its Sandbox tab — see /iblai-vibe-agent-virtual-machine.

Network — the organization's networks
Network — the organization's networks
Add Network dialog
Add Network dialog
Secrets — the Environment Variables tab
Secrets — the Environment Variables tab
Add Environment Variable dialog — the variable name is filled in from the name
Add Environment Variable dialog — the variable name is filled in from the name

Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.

  • /iblai-vibe-agent-virtual-machine — the agent's Sandbox → Network Access section that consumes these records. Its Add Network and Add Environment Variable buttons open the same dialogs in place, and Manage Networks opens the Network page in a popup.
  • /iblai-vibe-agent-sandbox — the Sandbox Type card that turns Virtual Machine Shell on in the first place.
  • /iblai-vibe-account — the settings page that hosts both, with the rest of Secrets (LLMs, Services) and the API page.
  • /iblai-vibe-credential — the RBAC that lets a token list and unmask the Services keys (integration credentials) an environment variable can read its value from.

Prerequisites

  • Auth must be set up first (/iblai-vibe-auth)
  • MCP server + skills configured (@iblai/mcp in .mcp.json)
  • @iblai/iblai-js@^2.73.1: earlier releases kept both records on one Virtual Machine tab with Network Policies / Secrets sub-tabs.
  • The viewer needs Ibl.Mentor/VirtualMachineNetworkPolicies/{list,write,delete} and Ibl.Mentor/VirtualMachineSecrets/{list,write,delete}. Organization admins hold them by default; they are not in the learner baseline. The Network page shows a permission notice on its list 403; the Environment Variables tab hides on its own.
  • Only agents on the Virtual Machine Shell kind consume these records. Nothing breaks without one, but nothing uses them either.

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/vibe/refs/heads/main/iblai.env"

Step 2: Mount them

In the settings page. Account lists both under Integrations: the Network page is the tab with id virtualMachine, and Environment Variables is the third sub-tab of secrets (Secrets opens on LLMs). In vibe-starter, give each its own admin route with AccountPanel, the way the other admin pages do — app/(app)/admin/network/page.tsx:

// app/(app)/admin/network/page.tsx
"use client";

import { AccountPanel } from "@/components/admin/account-panel";

export default function AdminNetworkPage() {
  return <AccountPanel tab="virtualMachine" />;
}

<AccountPanel tab="secrets" /> is the Secrets page the same way. Outside vibe-starter, pass targetTab="virtualMachine" or targetTab="secrets" to Account (see /iblai-vibe-account Step 3 for its wiring).

On their own, without the settings rail — how the ibl.ai OS opens them from its sidebar. Both are exported:

"use client";

import { SecretsTab, VirtualMachineAdminTab } from "@iblai/iblai-js/web-containers";

export function NetworkPage({ tenantKey, username }: { tenantKey: string; username: string }) {
  return <VirtualMachineAdminTab tenantKey={tenantKey} username={username} />;
}

export function SecretsPage({ tenantKey, username }: { tenantKey: string; username: string }) {
  return <SecretsTab tenantKey={tenantKey} username={username} />;
}

Step 3: Use MCP Tools for Customization

get_component_info("VirtualMachineAdminTab")
get_component_info("SecretsTab")
get_component_info("HostPortChipInput")
get_hook_info("useListVirtualMachineSecretsQuery")

Component Props

All from @iblai/iblai-js/web-containers.

ComponentPropTypeDescription
VirtualMachineAdminTabtenantKeystringOrganization key whose networks are managed
usernamestring?Signed-in admin. When present, a delete refused because agents still use the network lists them by name instead of by id
defaultTab—Deprecated and ignored; the page holds networks only
SecretsTabtenantKeystringOrganization key
usernamestring?Signed-in admin; the LLMs tab's Azure model picker needs it

What each page renders

Network

  • A blue banner ("Agents with Virtual Machine Shell run code on their own computer, with no internet access unless you allow it…") beside Add Network; each row has a pencil (edit) and a bin (delete).
  • Columns: Name, Allowed Hosts (the first three as chips, then "+N more"), Description, Updated (time ago), Actions.
  • Empty: "No networks yet. Add one to let an agent's virtual machine reach specific addresses."
  • Add / Edit Network dialog — Name (unique in the organization, ≤ 255 characters), Allowed Hosts (1–100 addresses; IP addresses allowed), Description (optional). Each field has an info icon. Editing sends only the fields that changed, and removing an address raises an amber warning that an environment variable sent to it will stop working — the backend allows the edit anyway.
  • Delete asks to confirm. If an agent still uses the network the backend refuses: the dialog lists the agents (by name when username resolves them, else by id) and hides Delete until they move off it.

Secrets → Environment Variables

  • A blue banner ("Give an agent a key it can use by name, like ACME_API_KEY, without ever seeing it…") beside Add Environment Variable; pencil and bin per row.
  • Columns: Name, Variable Name (a code chip), Allowed Hosts (the first three, then "+N more"), Actions. Every environment variable is listed, including one that reads a key from the Services tab (STRIPE_KEY above).
  • Empty: "No environment variables found".
  • Add / Edit Environment Variable dialog:
    • Name — how the key is listed here and on each agent's Sandbox tab.
    • Key — a password box. On edit it starts blank and blank keeps the current key; a masked copy (***) is refused.
    • Allowed Hosts — host names only, no IP addresses. These are the only addresses the real key is ever sent to, so keep them narrow.
    • Variable Name — filled in from the name ("Maps API key" → MAPS_API_KEY, with _2 added when the name is taken). Typing your own stops that; emptying the box starts it again. Read-only once created: delete and add again to rename.
    • A variable that reads a Services key shows a read-only Key line, "Read from the {name} key you already added.", in place of the Key box; its name and addresses can still change.
  • Delete warns that the variable is also removed from every agent that uses it. Deleting one that reads a Services key leaves that key in place.

REST API

For custom UI. Both records live under ${dmUrl}/api/ai-account/orgs/{org}/ where dmUrl is NEXT_PUBLIC_API_BASE_URL. Auth: Authorization: Token <token>. Records are keyed in the body, never in the URL.

Networks — virtual-machine-network-policy/

MethodBody / notes
GET[{ id, name, allowed_hosts, description, created_at, updated_at }]
POST{ "name": "Acme APIs", "allowed_hosts": ["api.acme.com:443"], "description": "" } → 201
PATCH{ "id": 12, … } — any of name, allowed_hosts (replaces the whole list), description
DELETE{ "id": 12 } → 204; 400 while an agent still uses it, and the message names the agents

Environment variables — virtual-machine-secret/

MethodBody / notes
GET[{ id, name, env_var, allow_hosts, source_credential_id, source_field, created_at, updated_at }] — never a value
POST{ "name", "env_var": "ACME_API_KEY", "allow_hosts": ["api.acme.com:443"], "value": "…" } or { …, "source_credential_id": 7, "source_field": "key" } to read a Services key — exactly one form
PATCHkeyed by { "env_var": "ACME_API_KEY" }; send only what changes. env_var itself cannot change
DELETE{ "env_var": "ACME_API_KEY" } → 204; also turns it off for every agent

The Services keys for the second form are GET /api/ai-account/orgs/{org}/integration-credential/ — [{ id, name, value }], masked for an admin. Only the ids, names and the keys of value are used. The field to read is the service's one sensitive field (key for Stripe, ElevenLabs and HeyGen); a service signed in with client_id / client_secret has none, and only ibl.ai can use its key. The rest of the Services REST surface is in /iblai-api-integration.

Validation the UI mirrors

RuleFrom @iblai/iblai-js/data-layer
An address typed without a port gets :443; a pasted URL keeps its host and the port its scheme implies (https://api.acme.com/v1 → api.acme.com:443). Stored as host:port, shown without :443normalizeHostInput, VIRTUAL_MACHINE_DEFAULT_HOST_PORT
host:port, no wildcard; port 1–65535validateHostPort, VIRTUAL_MACHINE_HOST_PORT_PATTERN
localhost, metadata*, instance-data* and .local / .internal / .localhost hosts refused; reserved IP ranges refusedVIRTUAL_MACHINE_REJECTED_HOSTS, VIRTUAL_MACHINE_REJECTED_HOST_SUFFIXES
Networks accept IP addresses, environment variables do notHostPortChipInput's allowIpAddresses
≤ 100 addresses per networkVIRTUAL_MACHINE_MAX_POLICY_HOSTS
≤ 20 environment variables per agentVIRTUAL_MACHINE_MAX_SECRETS_PER_MENTOR
Variable name: letters, digits and underscores, not starting with a digit, ≤ 128 characters, unused in the organizationvalidateSecretEnvVar, VIRTUAL_MACHINE_ENV_VAR_PATTERN, VIRTUAL_MACHINE_ENV_VAR_MAX_LENGTH
Not a name the VM relies on (PATH, HOME, LD_PRELOAD, the proxy variables, …) and not starting MSB_ or IBLAI_isReservedEnvVar, VIRTUAL_MACHINE_RESERVED_ENV_VARS, VIRTUAL_MACHINE_RESERVED_ENV_VAR_PREFIXES

Every 400 comes back as { error } — either a plain message or { field: ["…"] }; the dialogs show it under the field it names.

From @iblai/iblai-js/web-containers:

  • VirtualMachineAdminTab, VirtualMachineAdminTabProps — the Network page.
  • SecretsTab, SecretsTabProps — the Secrets page.
  • HostPortChipInput, HostPortChipInputProps — the address chip input (defaultPort, allowIpAddresses, maxEntries), reusable for any allowlist field.
  • VirtualMachineNetworkSection — the agent's Network Access section (/iblai-vibe-agent-virtual-machine).

From @iblai/iblai-js/web-containers/next: Account — the settings page hosting both (targetTab="virtualMachine", targetTab="secrets").

From @iblai/iblai-js/data-layer:

  • Networks: useListVirtualMachineNetworkPoliciesQuery, useCreateVirtualMachineNetworkPolicyMutation, useUpdateVirtualMachineNetworkPolicyMutation, useDeleteVirtualMachineNetworkPolicyMutation
  • Environment variables: useListVirtualMachineSecretsQuery, useCreateVirtualMachineSecretMutation, useUpdateVirtualMachineSecretMutation, useDeleteVirtualMachineSecretMutation
  • The Services keys a variable can read: useGetIntegrationCredentialsQuery, useGetIntegrationCredentialsSchemaQuery
  • Helpers: normalizeHostInput, splitHostPortInput, formatHostPort, validateHostPort, deriveSecretEnvVar, validateSecretEnvVar, isReservedEnvVar, getVirtualMachineApiError, getVirtualMachineErrorStatus, extractBoundMentorIds
  • Constants and types: VIRTUAL_MACHINE_ENDPOINTS, VIRTUAL_MACHINE_PERMISSIONS, the limits above, VirtualMachineNetworkPolicy, VirtualMachineSecret, SecretEnvVarIssue

SDK source: packages/web-containers/src/components/profile/virtual-machine-admin/ (Network), components/profile/secrets/ (Secrets), components/virtual-machine/ (both dialogs, the chip input), and packages/data-layer/src/features/virtual-machine/.

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:

  1. pnpm build -- must pass with zero errors
  2. pnpm test -- vitest must pass
  3. Touch test /admin/network and the Secrets page's Environment Variables tab in the browser as /iblai-vibe-ops-test says: open them, use every control this skill added, read the console, check the phone width.

Important Notes

  • Redux store: Must include mentorReducer and mentorMiddleware — they register virtualMachineApiSlice, which these hooks live on.
  • initializeDataLayer(): 5 args (v1.2+)
  • @reduxjs/toolkit: Deduplicated via webpack aliases in next.config.ts
  • Peer deps: sonner and @iblai/iblai-web-mentor must be installed (pnpm add sonner @iblai/iblai-web-mentor)
  • A key is never returned. No endpoint hands back an environment variable's value and the edit form starts blank. Never build UI that tries to display one.
  • env_var is immutable. Deleting and adding again is the rename path — and the delete turns the variable off for every agent first.
  • Two independent 403s. An admin may see networks but not environment variables, or the reverse.
  • Deleting a network an agent uses is refused, deliberately, so an agent on Custom Allowlist never points at a network that vanished. Move those agents to another network or profile first.
  • Scope is one organization. Networks and environment variables are never shared across organizations.
  • Billing: VM lifetime is charged to the chatting user's credits — $1 per 10 minutes by default, prorated per second and overridable per organization. The agent-side section states this next to the controls.
  • Brand guidelines: BRAND.md

Copyright © ibl.ai | support@iblai.zendesk.com