Skip to content

Workspace spec

microagent.yaml records the inputs needed to recreate a workspace from source control. It is consumed by microagent create.

name: research
image: docker.io/library/ubuntu:24.04
profile: medium
restart: on-failure
entrypoint: /app/start.sh
shell: /bin/bash
hostname: research
setup:
- mkdir -p /workspace
- echo ready > /workspace/status
files:
- src: ./body.py
dst: /app/body.py
mode: "0644"
env:
MICROAGENT_NAME: research
resources:
memoryMiB: 2048
cpuCount: 2
sizeMiB: 8192
mediation:
enabled: true
required: true
port: 2048
target: 127.0.0.1:9900
failClosed: true
disks:
- name: workspace
path: /tmp/workspace.ext4
mountpoint: /workspace
mode: rw
bundles:
- name: config
path: ./config.tar
mountpoint: /config
mode: ro
outputs:
- name: report
path: /workspace/report.json
Terminal window
microagent create --file microagent.yaml

If microagent.yaml or microagent.yml exists in the current directory, microagent create reads it automatically.

CLI flags override spec fields, so this is valid:

Terminal window
microagent create --file microagent.yaml --name research-2 --profile large
FieldDescription
nameWorkspace name
imageOCI image reference
profileResource profile: tiny, small, medium, or large
restartRestart policy: never, on-failure, or always
entrypointCommand to run when the workspace starts
shellInteractive console shell path. Defaults to /bin/sh; the path must exist inside the guest
hostnameGuest hostname. Defaults to the workspace name sanitized as a Linux hostname
setupCommands to run before first start
filesSource files to copy into the workspace rootfs
files[].srcHost path, relative to the spec file or absolute
files[].dstAbsolute guest path to write
files[].modeOptional octal file mode string, such as "0755"
envGuest environment variables
resources.memoryMiBMemory override
resources.cpuCountCPU override
resources.sizeMiBRootfs disk size override
mediationGuest-to-host vsock mediation channel contract
mediation.enabledEnables the mediation declaration
mediation.requiredRequires the channel for workspace startup
mediation.portGuest vsock port used by the Body
mediation.targetHost address and port for the enforcer/orchestrator
mediation.failClosedTreats a required channel break as closed by default
disksExisting ext4 disks to attach
bundlesTar bundles to build into ext4 disks and attach
outputsDeclared output artifact paths inside the workspace