Environment
TheMSB_BACKEND environment variable forces a backend for a single command or shell:
MSB_API_KEY does not select cloud by itself. MSB_API_URL only overrides the cloud endpoint and does not select cloud either.
SDK selection
Programmatic selection wins over environment and profile resolution. Use it when the application should decide regardless of where it is launched:Profiles
Profiles are named backend configurations in~/.microsandbox/config.json. Use them when you switch regularly or want a shared default for an environment:
active_profile sets the default. MSB_PROFILE=<name> selects another profile for one command:
api_key_ref. The optional url field defaults to https://api.microsandbox.dev; set it only for a development, self-hosted, or on-premises control plane. See the profiles schema for every field and credential-reference format.
Resolution order
Backend resolution uses this order:- Programmatic backend set by the SDK
MSB_BACKEND=local|cloudMSB_PROFILE=<name>active_profile- Local runtime
MSB_PROFILE or active_profile is explicit cloud intent when that profile has "backend": "cloud". MSB_BACKEND=cloud without a usable API key or cloud profile returns a configuration error; it never falls back to local execution.
Inspect the resolved backend
Usemsb context to inspect the backend kind, selection source, profile, and cloud API URL without exposing the API key: