Docs/Provisioning
OPERATE

Provisioning

Provision the workspace before asking agents to act like a fleet.

Provisioning overview

A working Midfleet runtime has a workspace, project/team routing, repository credentials, console routing, and live agent processes. Relay is additionally required when Hub or Control launches agents remotely.

Provisioning inventory

ItemRequired valueOwner
Workspace slugThe workspace used by the UI, API, CLI, runtime config, and agent JWT scope.Workspace admin
Hub URLhttps://app.midfleet.ai for production or the documented dev hub for dev testing.Operator
Runtime hostHost where the runtime account runs the console router and routable agents. It also runs Relay when Hub or Control spawn is enabled.Infrastructure operator
Cloudflare tunnelPublic console hostname route, plus a private Relay route when Hub or Control spawn is enabled.Infrastructure operator
Workspace API keyAutomation credential returned in runtime config. Store locally and never paste unredacted.Workspace admin
Relay tokenSecret used only to authorize Hub or Control spawn requests to Relay. Direct CLI starts do not use it.Infrastructure operator

Generate and start the workspace runtime

Login stores the participant session and pulls current runtime configuration. On a new host, runtime up reconciles workspace infrastructure, downloads the generated secret-bearing bundle, installs it under the workspace runtime root, registers the host, and starts the runtime services.

bash
midfleet login \
  --hub-url https://app.midfleet.ai \
  --workspace <workspace> \
  --pull-runtime

midfleet config show
midfleet config doctor
midfleet config redact --json

midfleet runtime up --expected-workspace <workspace>

Bootstrap automation without an existing config

Automation can bootstrap the pull without an existing config when these environment variables are present:

bash
export MIDFLEET_API_KEY=<workspace-api-key>
export MIDFLEET_HUB_URL=https://app.midfleet.ai
export MIDFLEET_WORKSPACE=<workspace>
midfleet config pull-runtime

Provisioning sequence

  • Create the workspace and invite admins. Confirm the admin can save workspace settings and Concierge policy.
  • Create the project and team. Link the project to the team before spawning implementation agents.
  • Wire repository access. Add a repo source and participant-managed PAT or deploy key where required.
  • Install the CLI on the runtime host. Run midfleet version, midfleet update-check, and midfleet doctor.
  • Generate and start the runtime bundle. Run midfleet runtime up --expected-workspace ...; it reconciles infrastructure, downloads and installs the generated bundle, registers the host, and supervises runtime services.
  • Inspect redacted runtime config. Confirm console router public URL, route prefix, local router port, and relay port with midfleet config show and midfleet config redact --json.
  • Enable Hub or Control spawn if needed. Start Relay and map its private tunnel route. Skip Relay for direct CLI-only launch.
  • Start routable agents. On the runtime host, select the participant profile explicitly and use unique ports, model names, project, team, and workflow capabilities.
  • Verify externally. Check the public console health route and send a nudge or handoff to an agent.
bash
# Run as the runtime account on the target runtime host.
midfleet --profile <profile> start \
  --name <agent-name> \
  --command <agent-command> \
  --model <supported-provider/model> \
  --capabilities <comma-separated-capabilities> \
  --project <project-code> \
  --team-id <team-id> \
  --serve \
  --serve-port <unique-port> \
  --serve-public-base-url <console-url-from-runtime-config> \
  --worker

Do not stop at localhost

bash
midfleet internal relay status
midfleet internal relay health
midfleet list
midfleet internal inbox --name <agent-name> --json
midfleet --profile <profile> ask <agent-name> "Reply exactly: SPAWN-OK" --timeout-seconds 120
curl -i https://console-<workspace>.midfleet.io/<workspace>/agents/<agent-id>/global/health

# Use the exact host printed by:
midfleet config show
# Runtime -> console / consoleRouter.publicBaseUrl