Skip to content
Browse the documentation

Error Reference

HTTP status codes and runner errors returned by the AgentLock gateway, with causes and fixes.

HTTP 400 — Bad Request

Cause: The request body failed schema validation.

Common triggers:

  • Missing required field (action_type, tool, or payload)
  • Invalid action_type value (must be read, write, financial, or admin)
  • tool contains invalid characters (must match /^[a-zA-Z0-9._\-:]+$/)
  • payload exceeds 64 KB when serialized
  • idempotency_key exceeds 128 characters
  • cost_estimate is negative
  • x-agent-id is not a UUID ("Invalid agent ID format")
  • The body is not valid JSON ("Invalid JSON body")
  • credential_id is not a UUID, or names another credential than credential_name
  • An SSH credential stored without host and user: add the server again under Credentials and use the new credential
  • Missing content in message POST
  • thread_id is not a UUID ("thread_id must be a UUID")

Fix: The error field names the problem; for POST /api/gateway/messages the response also has a details field that lists the failing fields. Fix the indicated fields and retry.

HTTP 401 — Unauthorized

Variants and causes:

"Missing x-agent-id header or Authorization token"
You didn't provide any authentication. Include either:

  • Ed25519 headers: x-agent-id, x-timestamp, x-nonce, x-signature-version, x-signature
  • Bearer token: Authorization: Bearer <token>
    Some endpoints word this as "Missing x-agent-id" or "Missing Authorization header or x-agent-id".

"Invalid or expired token"
The Bearer token is unknown, expired or revoked. Create a new one under Agents → [agent] → Tokens.

"Unauthorized"
Until the caller is authenticated, every failure gets this same answer so it can't be used to probe agents: unknown agent ID, missing x-nonce, invalid signature, timestamp more than 5 minutes off, unsupported signature version. Common causes of an invalid signature:

  • Wrong private key (doesn't match the registered public key)
  • Signed for a different method or path than the request uses (version 2 signs both)
  • Wrong signed body, or the body was modified after signing (proxy or middleware interference)
  • Clock skew of more than 5 minutes (sync via NTP)
  • Wrong key encoding (must be base64)

The result and SSH-sessions endpoints also answer this way for a suspended or revoked agent.

HTTP 403 — Forbidden

Variants and causes:

"Agent inactive"
The agent is revoked or suspended. Restore it under Agents. (The result and SSH-sessions endpoints answer 401 instead; the credentials endpoint says "Agent not found or inactive", permission routing "Agent inactive or not found".)

"Tool '<tool>' not permitted for this agent"
The agent has a tool allowlist that does not contain this tool. Add the tool to the agent's allowed tools or use a permitted one.

"Agent is not authorized to use credential "<name>""
The credential is assigned to other agents only. Assign it to this agent as well, or remove the assignments so every agent may use it. If the assignment could not be checked, the answer is HTTP 503 "Could not check which agents may use …"; retry.

"Browser sessions are not available on your plan. Upgrade to Pro or Team."
Browser sessions need Pro or Team. Persistent SSH sessions too: "Persistent SSH sessions are not available on your plan. Use one-shot ssh.run, or upgrade to Pro or Team." One-shot ssh.run works on every plan.

In-session browser action refused
Inside an open browser session an action runs only when the policy allows it. An action the policy blocks (status: "BLOCKED") or would send for approval (status: "DENIED") is refused with 403, and so is every action while Safe Mode is on. The error field gives the reason. Add Allow rules for the browser tools the agent uses.

"SSH session does not belong to this agent"
Also "Session does not belong to this agent" for browser sessions. Use the session IDs this agent opened.

"Monthly message limit reached" / "Thread limit per agent reached"
The workspace message quota or the per-agent thread limit is used up. Upgrade the plan, reply in an existing thread, or wait for the quota to reset.

Not a 403:

  • A policy BLOCK and Safe Mode return HTTP 200 with status: "BLOCKED" and a message (Safe Mode: "Safe mode active: all agent activity is blocked"). Only an Owner or Admin can turn Safe Mode off.
  • The kill switch returns HTTP 423.
  • Plan quotas return HTTP 429: "Action limit reached" for the monthly actions (Free 100, Pro 2,000, Team 10,000) and "Concurrent browser session limit reached" or "Concurrent SSH session limit reached (…)" for concurrent sessions (Pro 2, Team 5).

HTTP 404 — Not Found

"Conversation not found."
The thread_id doesn't exist or belongs to another agent. Start a new thread.

"Request not found"
The request_id in GET /api/gateway/result/{id} doesn't exist or belongs to a different agent. Blocked requests are never stored, so their request_id always gets this answer.

"Credential "<name>" not found in this workspace"
No credential has that credential_name; for a credential_id the answer is "Credential <id> not found in this workspace". Check Credentials in the dashboard; GET /api/gateway/credentials lists the names this agent may use.

"SSH credential not found", "SSH session not found", "Browser session not found"
The credential_id or session_id doesn't exist in this workspace. A session that exists but is closed or expired answers HTTP 410 instead; open a new one.

HTTP 409 — Conflict (Replay detected)

Cause: A request with the same nonce+timestamp combination has already been processed. This is the replay protection mechanism.

Common triggers:

  • Retrying a request without generating a new nonce
  • Network retry middleware re-sending the same signed request
  • Copying curl commands and re-running them
  • A retry after HTTP 429 or 5xx by an older SDK version (agentlock-sdk-node before 0.6.0, agentlock-sdk before 0.5.0, agentlock-mcp-server before 0.5.0), which resends the same signed request: call the method again, or update. The newer versions sign every retry anew

Fix: Generate a fresh nonce for every request. The SDK does this automatically. If making raw HTTP calls, use 16 random bytes, base64-encoded, as the nonce, and sign every retry again with a new timestamp, nonce and signature.

Note: Nonces are stored with a 10-minute TTL. After 10 minutes, the same nonce could technically be reused, but the timestamp would then fail the 5-minute skew check.

HTTP 429 — Rate Limit Exceeded

Cause: Too many requests in the current window, or a quota is used up.

Rate limits per minute:

  • POST /api/gateway/request: 60 per agent, 60 per source IP, and per workspace 120 (Free), 600 (Pro) or 2,400 (Team)
  • Result polling, credentials, messages (GET and POST combined) and SSH sessions: 60 per agent each
  • Permission routing: 120 per agent
  • Hosted MCP endpoint: 60 per agent

Response includes:

json
{ "error": "Rate limit exceeded", "retry_after": 60 }

Plus a Retry-After: 60 header.

Other 429 answers:

  • "Hourly action limit exceeded" — the policy's maximum actions per hour for this agent (default 100)
  • "Action limit reached" — the plan's monthly action quota
  • "Concurrent browser session limit reached" or "Concurrent SSH session limit reached (…)" — close a session first

Fix:

  • Reduce request frequency
  • Use awaitResult() with poll intervals of 2 to 5 seconds instead of rapid polling
  • For messages, increase the onMessage() poll interval
  • Batch operations where possible
  • The SDKs retry 429 automatically. With an older SDK version, a 409 "Replay detected" right after a 429 means the retry reused the nonce: wait and call the method again

HTTP 500 — Internal Server Error

Cause: An unexpected error on the server.

What to do:

  1. Check the response body for an error message
  2. Retry after a brief delay with new signing headers (a new timestamp, nonce and signature)
  3. If persistent, check the AgentLock status page
  4. Contact support with the request_id, or the x-request-id response header if present

Note: 500 errors never expose internal details — they return a generic message. An in-session browser action that fails returns 500 with "Browser action failed" or a specific browser error. Temporary failures use HTTP 503 instead, for example "Unable to schedule action. Please retry."

Runner execution errors

When an action fails after it was accepted, the result endpoint reports status FAILED with an error message, and the timeline shows the details. Common messages:

"Action execution could not be completed. Check the timeline before retrying."
No cause was recorded for the failure. The timeline entry has the details; check it before retrying.

"HTTP method <METHOD> is not supported; use GET, POST, PUT, PATCH, DELETE"
AgentLock runs only these five methods; HEAD, OPTIONS and others are refused. The gateway usually blocks such a request before it runs (status BLOCKED).

"Cannot send credentials over non-HTTPS connection"
An API key is only sent over HTTPS. Use an https:// URL. Redirects follow the same rule ("Cannot follow redirect to non-HTTPS URL when credentials are present").

"MCP server credentials not found"
The server name doesn't match an MCP Server credential this agent may use. GET /api/gateway/credentials lists them.

"MCP server returned <status>" / "MCP tool call failed: …"
The remote MCP server refused the call or returned an error.

Large responses
HTTP response bodies above 1 MB are cut off. That is not an error.

MCP tool errors
A tool that reports its own error still completes as an action. Check is_error: true in the result and read content for details.

Error Reference | AgentLock Docs