Leo for agents

Errors

Stable codes: an agent can act on the code; the message is for the person reading it.

AUTH_REQUIRED (401)

No credential was sent.

What to do: Send Authorization: Bearer <token>, or sign in through OAuth.

TOKEN_INVALID (401)

The token is not a Leo token, is unknown, or was issued for a different resource.

What to do: Create a new token or sign in again for this address.

TOKEN_EXPIRED (401)

The token has expired.

What to do: Refresh it through OAuth, or create a new personal token.

TOKEN_REVOKED (401)

The token, or the app holding it, was revoked.

What to do: Ask the person to connect the agent again.

WRONG_STAGE (401)

The token belongs to a different Leo (Staging, WMCo or Public).

What to do: Use a token issued by this Leo.

PRINCIPAL_REMOVED (403)

The person the token acts for can no longer use this workspace.

What to do: Someone with access has to authorise the agent again.

SCOPE_DENIED (403)

The credential does not hold the scope this needs.

What to do: Authorise again with the scopes in requiredScopes. A scope never exceeds what the person can do.

RESOURCE_DENIED (403)

The person does not hold the permission this needs here.

What to do: Ask someone who does, or a workspace admin.

HUMAN_ONLY (403)

Only a person can do this in Leo (for example deciding an approval).

What to do: Request it with request_task_approval; a person decides it in Leo.

NOT_ENABLED (403)

This part of the Agent Platform is not available on this Leo.

What to do: Check the address, or try again after the release reaches this Leo.

RESOURCE_NOT_FOUND (404)

It does not exist, or this credential cannot see it. The two are deliberately indistinguishable.

What to do: Check the id, and whether the credential is confined to particular projects.

INVALID_INPUT (400)

The input does not match what the operation accepts.

What to do: Read details.issues: each names the field and the problem.

APPROVAL_REQUIRED (409)

A person must approve this first.

What to do: Request the approval and wait; do not retry until it is decided.

INVALID_STATE_TRANSITION (409)

The record is not in a state that allows this (a finished run, a done task, unmet dependencies).

What to do: Read the message; fetch the record to see its current state.

IDEMPOTENCY_CONFLICT (409)

This idempotency key was used for a different request, or the first request with it is still running.

What to do: Use a new key for a new request; retry the same request with the same key after retryAfterSeconds.

CONFLICT (409)

Something else holds this (another agent's run, an existing record).

What to do: Read the message; coordinate through the task's context, or take over a quiet run.

PAYLOAD_TOO_LARGE (413)

The request body is too large.

What to do: Send less at once; publish long documents as artifacts.

RATE_LIMITED (429)

Too many requests from this credential.

What to do: Wait retryAfterSeconds (also the Retry-After header), then continue.

PROVIDER_UNAVAILABLE (503)

A service Leo depends on is unavailable.

What to do: Retry later with the same idempotency key.

CREDITS_REQUIRED (402)

The workspace does not have the plan or the credits this spends. Nothing was spent.

What to do: A person tops up or upgrades in Leo; quote again afterwards.

ABOVE_CEILING (409)

It would cost more than the max_credits you set, or than the daily limit the person set for this connection. Nothing was spent.

What to do: Ask the person before raising max_credits, or quote a cheaper request. A daily limit is changed in Leo, under Settings, Connections.

WORKSPACE_REQUIRED (400)

This connection can use more than one workspace, and the request did not say which.

What to do: Call list_workspaces and pass workspace_id. Nothing was done.

WORKSPACE_NOT_AUTHORISED (403)

The workspace named is not one this connection may use, or the person is no longer a member of it.

What to do: Call list_workspaces for the ones it may use. The person can add a workspace in Leo, under Settings, Connections.

INTERNAL (500)

Leo could not complete the request.

What to do: Retry with the same idempotency key. If it persists, quote the requestId to support.

Leo agent errors | Leo