Early access. Cloud sessions and managed agent runs are not open to every account yet: we are
letting accounts in gradually while we test. They run in a cloud sandbox operated by Mutagent, so
there is nothing to host. A sandbox with nothing to do for 15 minutes stops; send an interactive
session a message and it wakes up, delivers your message and carries on in the same conversation.
A
-p task run cannot be woken; run it again.client.environments. The token exchange, sandbox provider and preset calls
are on client.sandbox. Request bodies and responses are typed
models from mutagent.models; read response fields as attributes. These pages require
mutagent-sdk 0.4.1.
Get a sandbox token
Environment and sandbox provider calls take a short-lived sandbox token, not your API key. Exchange the API key for a token withcreate_sandbox_token. Pass the token
as bearer_token to a second client. A client takes either api_key or bearer_token, not both.
workspace_id is the workspace’s ID; platform.workspaces.list_workspaces() returns it as
workspaces[].id_. The API key must be allowed to create resources in that workspace, and a key limited
to one workspace or organization can only get a token inside it. Refusals: 401, 403, 422, 429.
List Environments
list_environments returns every Environment in the workspace.
A fingerprint is 8 hex characters the server computes from the value with a key only the server
holds. Two equal fingerprints mean the same value; a changed fingerprint means the value changed. You
cannot compute a fingerprint yourself, so hashing your local value will not match it. To be sure a
stored value is right, set it again.
Describe one Environment
get_environment returns one Environment in the same shape.
Create an Environment or set entries
update_environment creates the Environment when it does not exist, and otherwise
changes only the entries you name. A string value sets an entry. None removes it. Entries you do not
name are kept.
get_environment does.
Replace an Environment
replace_environment sets the whole Environment. Entries the body does not name are
deleted, secrets included.
Rules for both calls
Delete an Environment
delete_environment deletes the Environment and its secrets.
{"deleted": True, "name": ...}. 404 when there is no Environment with that name, including
a delete you retry. Sessions already running keep the values they started with. A later launch that
names the deleted Environment is refused with 404.
List sandbox providers
list_sandbox_providers lists the sandbox providers a launch can name, and the default.
Pass a name as
sandbox_provider when you launch a session.
The SDK has no call that adds or configures a sandbox provider. See
Sandbox providers.
List presets
list_sandbox_presets lists the presets a launch can name as preset, and the default.
Errors
A refused call raisesSDKError. status_code is the HTTP status and body is the JSON the server
returned, as text, with error and message.
Async
AsyncMutagent has the same calls on client.environments and client.sandbox; await each one.
The same Environments from the command line: mutagent env.