On this page

Build a virtual-device product

A virtual-device product gives users and agents a shared machine that keeps state between conversations. It can hold files, run code, keep browser context, execute jobs, connect to apps, and produce artifacts.

This is the MIOSA pattern behind Nebula-style devices, always-on operators, agent workspaces, browser automation products, and AI company workrooms.


Product promise

"Give each workspace a persistent device where agents can work, remember files,
run apps, use a browser, and continue later."

The user should experience:

  • a workspace device that does not disappear after a short timeout
  • visible files and generated artifacts
  • a browser or preview panel
  • resumable agent sessions
  • jobs that can run in the background
  • connected tools and credentials
  • clear usage and credits
  • safe approval prompts

MIOSA mapping

Virtual-device conceptMIOSA primitive
DeviceSandbox or computer
Files between sessionsPersistent /workspace, computer storage, snapshots
BrowserComputer browser or browser-capable runtime
CodeSandbox exec and files
Live serverSandbox preview ports
JobsScheduled agent runs that resume a device
Shared workspaceWorkspace-scoped device policy
Connected appsManaged connectors and secrets
OutputsArtifacts, previews, deployments
BillingCredit ledger by run/device/tool/storage

Architecture

The product owns device assignment and policy. MIOSA owns the execution layer.


Data model

workspaces
  id
  primary_device_type
  primary_device_id
  credit_budget

workspace_devices
  id
  workspace_id
  miosa_device_type
  miosa_device_id
  name
  role
  status
  persistent
  latest_snapshot_id
  created_at
  updated_at

agent_sessions
  id
  workspace_id
  device_id
  runtime
  status
  last_prompt
  created_at
  updated_at

workspace_artifacts
  id
  workspace_id
  session_id
  path
  content_type
  preview_url
  download_url
  version

Device lifecycle

Use persistent devices by default for interactive work.

create workspace
  -> create primary sandbox
  -> install starter runtime/tools
  -> save first snapshot
  -> mark device ready

user sends prompt
  -> resume primary device
  -> start agent run
  -> stream events
  -> snapshot stable checkpoint

idle timeout
  -> stop compute
  -> preserve filesystem
  -> device remains resumable

Destroy should be explicit. Timeout should stop compute and preserve state for normal workspaces.


UI layout

Recommended panes:

PaneShows
Chat/taskUser prompts and assistant messages
ActivityTool calls, command output, browser actions
FilesWorkspace file tree and changed files
Preview/browserLive server or computer stream
ArtifactsDownloadable outputs and versions
JobsScheduled and running background work
CreditsCurrent balance and run cost
ApprovalsRisky actions waiting for user confirmation

The activity pane should show the work as it happens. If the agent writes code, the user should see file changes and commands. If it uses a browser, the user should see screenshots or stream events.


CLI shape

Developers should be able to operate the same product from CLI:

miosa devices list
miosa devices create --type sandbox --name company-workspace --persistent
miosa devices set-primary <workspace-id> sandbox:<id>

miosa agent start 
  --device sandbox:<id> 
  --runtime codex 
  --prompt "Build the first version of this app." 
  --detach

miosa agent events <session-id> --follow
miosa agent task <session-id> "Add auth and save screenshots."
miosa artifacts list --session <session-id>

For browser work:

miosa devices create --type computer --name browser-qa
miosa agent start 
  --device computer:<id> 
  --runtime osa 
  --prompt "Open the preview, test signup, and capture screenshots." 
  --detach

Jobs and schedules

Virtual-device products become powerful when agents can keep working.

Examples:

  • daily competitor research
  • weekly app QA
  • CRM enrichment
  • support inbox triage
  • website uptime checks
  • automated report generation
  • recurring content drafts

Job model:

agent_jobs
  id
  workspace_id
  agent_id
  device_id
  schedule
  prompt_template
  status
  next_run_at
  budget_limit

Jobs should resume the assigned device, run the prompt, stream events, save artifacts, and stop the device when idle.


Connected tools

Connectors turn the device into a useful worker:

ConnectorUse
GitHubIssues, PRs, repo context, code review
SlackNotifications, summaries, approval requests
Google DriveSource docs and generated files
GmailDrafts and inbox triage with approval
ReferoDesign research and product UI references
Custom API keyCustomer’s own provider or SaaS API

Connector tokens should be scoped to the workspace and action. The agent should not receive tenant admin keys unless that is explicitly allowed.


Safety defaults

Require approval for:

  • external messages
  • production deploys
  • high-cost device creation
  • large fleet runs
  • deleting files, snapshots, devices, or deployments
  • using admin credentials
  • buying domains or paid resources

Always log:

  • who asked
  • which agent acted
  • which device executed
  • which connector was used
  • what changed
  • what credits were charged

Build checklist

  1. Create a workspace record.
  2. Create a persistent primary sandbox.
  3. Store the MIOSA sandbox id.
  4. Add a visible files/artifacts pane.
  5. Add a run event stream.
  6. Add agent start, agent task, and agent events paths.
  7. Add connector settings.
  8. Add approval gates.
  9. Add credit metering.
  10. Add snapshots and resume.
  11. Add optional computer for browser work.
  12. Add deploy/publish path.

See also

Was this helpful?