Skip to main content
This page is for self-hosted platform operators and Space administrators. The recommended path prepares one command in the web UI. Run it on the AI Vision deployment host to install a dedicated OpenShell gateway and plugin, then save the current Space connection. The default flow asks for no images, gateway addresses, paths, endpoints or service tokens. Manual installation against an existing gateway remains an advanced path below.
Use the matching CLI that explicitly supports aiv plugin setup openshell, and a deployment that provides the OpenShell artifact catalog. Missing catalog or deployment identity produces an actionable explanation. Source or local QA images are not proof of published packages or acceptance on another architecture/host. OpenShell remains optional and outside the default five services.

1. Check the host and copy the command

Switch to the target Space and open Integrations → Plugins → Sandbox → OpenShell → Install OpenShell. There is no technical configuration form. Confirm terminal and Docker management access on the deployment host, then choose Copy install command in the footer. This prepares and copies the complete command without image, gateway, path, endpoint or token inputs. The actual Docker Engine must be 28.0 or newer. The actual Linux execution environment must have Landlock ABI 3 or newer enabled (normally Linux 6.2+, but distribution backports and configuration affect support). Installation checks real capability; an OS or kernel version alone is insufficient. Default setup uses the deployment host’s local Docker Unix socket, not a remote Docker context. Use the CLI included with this deployment version. Update older CLIs first; check the capability with read-only help:
Current English install drawer shows host requirements and compact footer without technical inputs

Current installation drawer · Running frontend with API demonstration data · Click to enlarge

2. Run it on the actual deployment host

Paste and run the complete copied command in a terminal on the host running this AI Vision deployment. Copying does not start installation. Do not run it on an arbitrary laptop or another Docker daemon. The browser and backend execute neither Docker nor a remote shell. The command carries three separate short-lived capabilities for the pinned plan, progress and connection enrollment. Uppercase names in the preview mask them; the copied command already includes their values. Refreshing cannot retrieve them again. Do not publish the complete command, tokens or host-private files.
Current English command preview uses uppercase names for hidden capabilities

Current command preview · API demonstration data; capabilities masked · Click to enlarge

3. Check progress and the reason for stopping

Closing, reopening or reloading the drawer resumes reads only. One request failure or 20 seconds without an update does not prove host failure. If you ran the previous command, keep waiting; otherwise regenerate explicitly. A new record retains the old record and does not stop its host command. The CLI reuses only resources matching the exact owned plan.

4. Set the Space default explicitly, then test a rule

After Space connection saved, the compact footer places Close beside Set as Space default. The server retests and confirms the binding. Once Space default set appears, the footer contains only Done. Closing during installation does not stop the host command. Low-frequency actions for rechecking a repaired host or ending progress reporting stay in collapsed sections of the scrollable body.
Current English saved installation has adjacent Close and Set as Space default actions

Current saved connection and compact actions · API demonstration data · Click to enlarge

Installation and enrollment do not automatically change the default or enable “Require sandbox execution for custom rules.” Follow Run custom rules in a sandbox to select execution and try a reviewed Trace. For a formal Task, also inspect its individual diagnosis Record and execution status; Task completion alone is insufficient. Verify cleanup independently. A new default does not rewrite frozen targets of existing Tasks.
Actual English read-only view of the existing Linux AMD64 installation; compact footer contains only Done

Actual Linux AMD64 VM: confirmed default, only Done remains · Read-only English view · Click to enlarge

Automatic setup prints Owned state: ...; failures also retain and report existing state. Keep that path. Later status, logs and remove use its installation subdirectory as --state-dir. Plugin removal retains the dedicated gateway and private files. An operator must handle the gateway separately after confirming no leases remain. Do not clear state or journals to retry.

Confirm enhancement support and effective limits

The matching installation provides one enhanced Python environment with importable pytest, NumPy, pandas, Pydantic, jsonschema and openpyxl, reference-test execution and JSON/CSV/XLSX materials. Rule authors load examples in the editor without entering images, Python paths or package-install commands. Available libraries reports the actual environment; ordinary connection readiness alone does not qualify the enhanced runtime. New automatic installations use recommended connection limits of 1 CPU, 1 GiB and 30 seconds. Existing connections keep their configured limits. Actual execution uses the smaller of the enhanced service ceiling and the connection limit. Apply recommended limits raises only insufficient values for a compatible, manage-authorized connection; it cannot raise the service ceiling or upgrade an old plugin. If the editor says Plugin update required, check the matching platform, Task workers, plugin and enhanced workload versions. Early manual or prototype installations have no automatic in-place upgrade guarantee. Follow Safe removal and upgrades for the original installation, then install the matching delivery. A budget edit alone is not an upgrade. Use the starter and advanced rule examples to check imports, reference tests and data comparison, then independently confirm cleanup. Source/local QA, readiness and historical screenshots do not replace execution on the current image or establish publication, another architecture or native-private delivery qualification.
Actual Linux AMD64 VM rule editor shows sandbox execution, 30-second budget and six library versions in Chinese

Actual Linux AMD64 VM: saved rule, enhanced Python and six libraries · Chinese interface · Click to enlarge

Advanced: manual deployment with an existing gateway

The following steps are only for operators who already manage an independent OpenShell gateway. Manual aiv plugin install openshell does not install that gateway; it manages the separate plugin service. The recommended automatic flow does not ask for these fields or require manually generated private files.

Prerequisites

Source-selfhost: Dockerfile.sandbox-plugin.selfhost requires both AGENTLENS_SOURCE_IMAGE and RULE_WORKER_IMAGE; it copies the qualified runtime inventory from the worker image. Native-private: Dockerfile.sandbox-plugin requires a native base that already contains the compiled plugin modules. That native-base requirement applies to this recipe, and native-private artifacts require separate qualification; source QA does not establish it. The plugin independently verifies cleanup with read-only Docker requests. Mounting a socket read-only does not restrict Docker API permissions; this is a trusted operator service. Do not expose the socket to workloads or the platform web service. Use a dedicated execution host or Docker daemon where possible. OpenShell 0.1.6 deletes resources by name. Its API has no atomic immutable-ID/version precondition for deletion. The plugin checks observed identities, but cannot prevent a gateway administrator from replacing a resource with the same name between requests. Exclusive workspace operation and trusted gateway administration are therefore deployment prerequisites.

1. Check the actual CLI capability

Run on the Docker host that will run the plugin container:
docker info must reach the intended daemon. If the CLI does not recognize plugin or openshell, follow Install the CLI to obtain a matching build that explicitly includes this capability. Do not infer support from a dev tag or reuse flags from other aiv subcommands.

2. Prepare private files and the execution policy

The following example generates a random plugin HTTP token in a configuration directory. For an existing installation, reuse its original directory and lease journal; do not overwrite the token or clear the journal. Run this only for a first installation after confirming the directory is unused:
In the same terminal, create a fixed nonroot policy with mandatory Landlock and no network access. This command refuses to overwrite an existing file; check the original policy if one is present:
Check UID/GID, directories, Landlock support and the worker against the actual image. This example is not a compatibility guarantee for arbitrary images. Rules operate on the supplied Trace input; do not assume they can install packages or call external services over the network. The plugin container runs with the token file owner’s numeric UID/GID. The journal directory must have the same owner. That user must be able to read the policy, gateway credentials and optional TLS files. Use 0700 for configuration and journal directories and 0600 for tokens and private keys.

3. Install the separate plugin service

In the same terminal, replace the image, gateway, workspace and socket placeholders with the actual prepared values:
--image has no default. If absent locally, the CLI pulls only that explicit reference; it does not infer a repository or replace an existing installation. Add --gateway-token-file when the gateway needs authentication. For TLS, use --gateway-ca-file; supply a client certificate and private key together through --gateway-cert-file and --gateway-key-file. These credentials are separate from the plugin HTTP token. The CLI mounts token and gateway files into the container. Token values do not enter command arguments or installation state. installation.json under --state-dir stores file paths and nonsensitive configuration; reuse that state directory for subsequent commands. The default is ~/.aivision/plugins/openshell, or under the configuration root set by AIVISION_CONFIG_DIR. When Docker runs in a VM or remote daemon, the mounted socket group inside the container may differ from the host group. The default uses the host-observed group. If an override is needed, inspect the mounted socket using the trusted plugin image, then add --docker-socket-gid N (0..2147483647, including 0) to the install command. It sets only the supplementary group; the plugin still runs as the token-file owner and primary group. Existing and pending installations retain their original options.

Follow installation progress

The CLI reports six phases on stderr: configuration, Docker, image, saved state, container startup and readiness. Each phase shows elapsed time; a long phase reports that it is still waiting every five seconds. The image phase distinguishes a cached plugin image from a download and displays recognized Docker layer progress when available. It does not estimate an overall percentage or print unfiltered Docker output. Configuration checks cover required inputs, file access and permissions. The plugin checks policy contents at startup. The installer only fetches the explicit plugin image; it does not install the gateway or download the workload image. The installation has a 15-minute total budget, including image download. Add --timeout 30m to the install command for a slower connection. This does not extend the separate initialization window after container startup. If a phase fails, use the printed status/logs commands with the original --state-dir. Preserve pending installation state and the journal instead of deleting them to bypass ownership checks. Running: true with Readiness: false means the container started but the provider is not ready. The installation command can exit successfully in this state. Check the service before configuring a connection; container startup is not confirmation of provider readiness.

Give AgentLens the correct HTTP endpoint

By default, the CLI maps plugin container port 8091 only to 127.0.0.1:8092 on the Docker host. This is not a publicly reachable address. For remote or containerized AgentLens, provide a separate authenticated private-network / TLS proxy or tunnel route.
  • Plugin to gateway: check that gateway.example:30051 is reachable inside the plugin container.
  • AgentLens to plugin: check that the HTTP(S) endpoint you will hand over is reachable from the AgentLens service network.
  • 127.0.0.1 inside the AgentLens container points to that container, not to the plugin on the Docker host.

4. Check the service, then configure the Space connection

Check installation, running state, authenticated readiness, draining state and the active / cleanup-pending lease count separately. An existing or running container does not establish that all checks are complete. Use your team’s private credential handover process to give a Space administrator the reachable plugin HTTP(S) endpoint, plugin HTTP token and approved workload image. Follow Run custom rules in a sandbox to add the connection, check readiness, save the Space default and run a trial. First execute a real rule using approved synthetic input, check the metrics, then independently verify workload cleanup. Readiness does not create a sandbox; an HTTP 200 or a screenshot cannot replace execution and cleanup acceptance. Record the actual image, architecture, gateway, policy and daemon combination before using it for team tasks. With additional reverse proxies or application servers, allow at least 630 seconds for /api/v1/spaces/{spaceId}/diagnose/diagnosers/rule/trial. The built-in nginx uses 630 seconds for this route, while the backend HTTP phase budget is 600 seconds. Neither extends the execution limit for an individual rule.

Safe removal and upgrades

Use the original state directory:
Removal first authenticates and drains the service, stopping admission of new leases. The CLI removes its owned container only after active and cleanup-pending leases reach zero, container identity and process generation remain unchanged, and the service shuts down cleanly.
  • Leases remain: the service stays draining. Wait for execution and cleanup, check status, then retry removal.
  • Service stopped, unhealthy or restarted during drain: inspect the original container and operator configuration. Restore the owned service and let it reconcile cleanup from the durable journal, then repeat the full removal process.
  • Cleanup cannot be verified: check the gateway’s actual Docker daemon, socket and resource identities. Preserve journals and leases; do not delete records, ownership labels or installation state to bypass checks.
Removal preserves the gateway, lease journal, token and policy files. There is no force-purge option. To upgrade an image, drain and remove safely, then reinstall with the preserved journal. Use the same sequence to rotate the plugin token, then update each Space connection’s write-only token and check readiness again. In a new terminal, first set AIV_SANDBOX_CONFIG to the original configuration directory and reuse the same --state-dir. Deleting a connection in the UI does not uninstall the service; uninstalling the service does not remove its Space connection references.

Troubleshoot installation and cleanup

For source builds and lifecycle boundaries, see the product operator guide. Only the OpenShell Docker provider described here is currently supported. E2B, Runloop, CubeSandbox and Kubernetes plugin orchestration are not provided.