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 the session a
message and it wakes up, delivers your message and carries on in the same conversation.
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 the first 8 hex characters of the SHA-256 of the value. Compare fingerprints to check
that a stored value is the one you hold.
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.