Back to docs
Provisioning

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

A working Midfleet runtime has a workspace, project/team routing, repository credentials, a console router, a relay, and tunnel routes that point to the right host.

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 that runs the console router, relay, and serve-backed agents.Infrastructure operator
Cloudflare tunnelPublic hostname routes for https://console-<workspace>.midfleet.io and https://relay-<workspace>.midfleet.io/spawn.Infrastructure operator
Workspace API keyAutomation credential returned in runtime config. Store locally and never paste unredacted.Workspace admin
Relay tokenSecret used by the hub to authorize spawn requests to the relay with x-midfleet-relay-token.Infrastructure operator

Pull and validate runtime config

The runtime bundle is the source of truth for console router URL, local bind ports, relay settings, workspace API key, and relay token naming. Pull it before starting or respawning agents.

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

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

midfleet runtime install \
  --bundle ./<workspace>-midfleet-runtime-bundle.json \
  --expected-workspace <workspace>

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

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

  1. Create the workspace and invite admins. Confirm the admin can save workspace settings and Concierge policy.
  2. Create the project and team. Link the project to the team before spawning implementation agents.
  3. Wire repository access. Add a repo source and participant-managed PAT or deploy key where required.
  4. Install the CLI on the runtime host. Run midfleet version, midfleet update-check, and midfleet doctor.
  5. Download and install the runtime bundle. Run midfleet runtime install --bundle ... --expected-workspace ...; it installs files and registers the host. Use --dry-run to validate without writing.
  6. Pull runtime config. Confirm console router public URL, route prefix, local router port, and relay port.
  7. Start relay and console routing. Keep host and port values aligned with the runtime bundle.
  8. Configure tunnels. Map public hostnames to the local router and relay services.
  9. Spawn serve-backed agents. Use unique ports, workdirs, model names, project, and team identifiers.
  10. Verify externally. Check the public console health route and send a nudge or handoff to an agent.

Do not stop at localhost

midfleet internal relay status
midfleet internal relay health
midfleet list
midfleet internal inbox --name <agent-name> --json
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
If the public route fails, do not respawn agents first.

Check the tunnel hostname, Cloudflare Access policy, console router bind port, route prefix, and runtime config freshness.