Skip to main content
Many errors carry a category or a machine-readable code you can match on. Some carry a message only, and where a code arrives differs between REST and MCP.

Registering a target

create_target (POST /api/v1/model over REST) runs one live probe. On failure it returns a category and saves nothing, so fix what it names and call it again. Over MCP the tool error names it, as in Target probe failed (unreachable): …. Over REST a failed probe is a 422 whose detail object carries it as error_category; a URL refused before any probe (invalid_url, or a host that doesn’t resolve or resolves to a private address) is a 400 whose detail is the message alone.

MCP servers

Registering an MCP server reports the same categories, over MCP (create_target with an mcp object) and over REST (an mcp object in place of config). There, not_an_endpoint means the endpoint answered but not as an MCP server, or with an answer too large to read; no_reply that it stopped answering while listing what it offers; and auth_failed that it refused the credential, asked for one you did not send, or signs in with OAuth, which is not supported yet. Over MCP, a server that asks for sign-in is not an error: create_target returns status awaiting_user and a link where its key is added in the Enoki app (see Connect your MCP server), so there auth_failed means the server signs in with OAuth. Over MCP, these errors also say what to change:

Authentication errors

Over REST, every authentication refusal names its code in the X-Auth-Failure response header, beside a plain detail message. Over MCP, a request refused before any tool runs gets the status with the code in the body, as {"error": {"code": …, "message": …}}.

Signing in an app

When an app signs in, Enoki opens in your browser. If it can’t let the app in, the page says why:

Finishing a pending MCP target

When create_target returns status awaiting_user, the MCP server is added on the page its finish_url opens, and get_pending_target tells your agent where it stands (see Connect your MCP server): On the page itself:

Rate limits (429)

Each API key and each connected app is rate-limited per minute. Over MCP, every request counts against the Standard tier; the three expensive tools additionally count against the stricter Expensive tier. A Standard breach is refused before any tool runs, with an HTTP 429 and code rate_limited in the body. An Expensive breach is a tool error that says so, without a code. Because expensive tools spend both budgets, a burst of cheap calls can exhaust the Standard tier and 429 the next create_target. So check a pending MCP target with get_pending_target once, when it’s finished, rather than in a loop. Over REST, each endpoint has its own per-minute limit for each API key: A REST breach is a 429 with a Retry-After header and a plain detail message, without a code.

Validating a fix

validate_fix (POST /api/v1/findings/{finding_id}/validate) re-runs a finding at most 3 times in 24 hours, and a workspace re-runs at most 3 findings at once. Past either, REST answers 429 with a plain detail that names the limit and no Retry-After, and MCP returns that message as a tool error. A re-run already in progress for the same finding is a 409.

Per-caller limits

Two further limits apply to every request, keyed on the calling IP address rather than on your key or app. They exist to stop path scanning, and normal integration traffic does not come close to either. The client-error bucket is the one to know about, because a full bucket refuses every request from that IP for the rest of the minute — not just the ones that were erroring. Two habits fill it:
  • Retrying a 404. A 404 means the resource is not there; a retry returns the same 404 and spends another entry. Do not retry them.
  • Polling for a resource before it exists. Poll the parent listing, or the run’s status, rather than the not-yet-created child.
A repeated 403 for a missing scope counts too, so fix the scopes rather than looping on the failure. 429s from these two limits carry a Retry-After header and a plain detail message rather than a code field, so branch on the status and the header, not on a code, when handling them.

Daily assessment budget

Separately from the per-minute tiers above, each workspace has a budget of 20 assessment runs per rolling 24 hours. This one is not per API key and not per minute: it is shared across the dashboard, the external API, and MCP, because what it protects is the cost of running an assessment rather than request volume. Every run the workspace starts counts, whatever its outcome and whoever started it — including runs you did not trigger by hand, such as scheduled runs, safety assessments, policy assessments, assessments of an MCP server, and reporting top-ups started from the dashboard. So the budget can be spent before you have made 20 explicit trigger calls. The error message always reports the actual count, so read that number rather than assuming it matches your own triggers. The same budget refuses those creators too. A safety assessment, a policy assessment, an assessment of an MCP server or a reporting top-up started when the workspace has no slot left gets the same 429 with trigger_quota_exceeded and the same Retry-After; in the dashboard, every lens shows the same “Daily assessment budget reached” notice. A reporting top-up is a run you start in Reporting when a risk needs more testing before its report can be downloaded. It tests those risks and re-tests the fixes you reported. On breach you get a 429 with code trigger_quota_exceeded. A trigger can also be refused by a per-minute limit (see above), and the two mean different things: How the reset reaches you depends on the surface. On REST, both carry a Retry-After header, and trigger_quota_exceeded additionally carries retryAfterSeconds in the response body. On MCP, neither carries a Retry-After: the Standard tier’s 429 has none, and the other refusals are tool errors, so trigger_assessment puts the budget’s reset time in the message itself. Treat that time as the earliest a slot can open, not a guarantee: runs started while you wait push it later. If you are hitting this from a release hook that triggers an assessment on every deploy, a schedule is the supported way to get a recurring cadence, rather than spending the budget on hook volume: in the Enoki app, open Testing → Start testing and choose Run on a schedule. Schedules cover agents for now, not MCP servers.

Assessment allowance (403)

A workspace on a plan spends credits, and a workspace on an evaluation has a fixed number of assessments. Running out returns 403, and the code in the body tells the refusals apart.

Your credits are spent

A workspace on a plan pays for each test in credits. An assessment costs one credit, and so does a retest, which is free within 30 days of the agent’s last assessment. The plan’s credits renew every contract year. A test that ends in error, or that you cancel before it finds anything, costs nothing.
A cancelled run is not a passing run. get_assessment_status still returns a min_severity verdict once a run is terminal, and cancelled and error are both terminal — so a run stopped early reads pass simply because it never got far enough to find anything. If you gate a pipeline on the verdict, accept a pass only from a run whose status is completed and whose ingest_incomplete is false; for a run you scoped to categories, you can also compare categories_completed against categories_planned. The same applies to GET /api/v1/run/{run_id}.
When the credits left do not cover a test, the trigger returns 403 with code assessment_allowance_spent. The body names what the contract year spent, its credits, and the day they renew:
A plan that has ended or not yet started, and a workspace with no plan yet, are refused with the same code and a message that says which. Credits do come back on the date in resets_at, but the 403 carries no Retry-After, because that can be months away and is not a wait a client should sit through. Get in touch to add credits or set up a plan.

You are on an evaluation

Workspaces on an evaluation get a fixed number of security assessments of their agents for the life of the evaluation. Safety assessments, policy assessments, reporting top-ups and assessments of an MCP server are not part of an evaluation and are refused outright, so there are two more refusals here. When the security allowance is spent, the trigger returns 403 with code trial_lens_limit_reached, and the body names the count and the ceiling:
Asking for a safety assessment, a policy assessment, a reporting top-up or an assessment of an MCP server on an evaluation returns 403 with code trial_lens_not_included instead. That is not a spent allowance, so it carries no counts:
lens names what was refused: safety, policy, compliance for a reporting top-up, or mcp for an MCP server. Neither of the two evaluation refusals resets — do not retry them. Unlike credits, which renew, and the two 429s, no amount of waiting frees a slot; we lift the ceiling or add the lens, so get in touch. A run holds its slot from the moment it starts; one that ends in error, or that you cancel, gives it back, so a run that fails on our side does not cost you an assessment. All three refusals share one body shape, so branch on code and read the counts where they apply. The examples above show only the fields each refusal fills in; the rest are present and null — resets_at on both evaluation refusals, and used and limit on trial_lens_not_included, which short-circuits before anything is counted. One more refusal applies to an evaluation only. It runs full assessments, so a trigger that passes categories returns 403 with code trial_focus_not_included. Unlike the two above, you clear this one yourself: leave categories out and trigger again. Its body carries the code and the message and nothing else:
On MCP these refusals arrive as a trigger_assessment tool error carrying the message and nothing else — an MCP tool error has no body, so there is no code to branch on there. Use the REST trigger if your client needs to tell them apart.

Category list (403)

Listing the categories (GET /api/v1/category, or the list_categories MCP tool) is part of the platform plan. A trial workspace is refused it:
Over MCP, list_categories returns the same message as a tool error, without the code. Like the evaluation refusals above, it does not reset with time. A trial’s runs can’t be focused, so omit categories when you trigger one.

A run that could not start (502)

If Enoki accepts a trigger but cannot start the run, the trigger returns 502:
The run is recorded as failed and costs no credits, so trigger again. It does count as a start toward the daily assessment budget. Over MCP, trigger_assessment returns a tool error saying the run could not be started. Validating a fix can fail the same way: POST /api/v1/findings/{finding_id}/validate returns the same 502, and validate_fix returns a tool error saying the validation could not be started. The attempt counts toward the finding’s 3 re-runs a day, so wait a few minutes before you validate again.

A run already in progress (409)

A target runs one assessment at a time, whoever started it: a run from the dashboard, a schedule or another caller blocks the next trigger on that target until it ends. The trigger then returns 409:
Poll that run and trigger again once it has ended. runId is left out when the run in progress is one the API does not show, such as a policy assessment. Over MCP, trigger_assessment returns the message alone as a tool error.

”Not found” for something you expect to exist

A finding, run, target or pending MCP target in a different workspace returns not-found, not 403, so IDs can’t be probed across workspaces. If you get not-found for an ID you believe is valid, check your key or app is connected to the right workspace. A policy assessment’s run is not shown over the API or MCP, so its run id returns not-found as well.

Can’t connect at all

  • Endpoint: confirm the URL is exactly https://mcp.enokilabs.ai/mcp (streamable HTTP). A client set to the older SSE transport is refused with 405 method_not_allowed; switch it to streamable HTTP.
  • Auth header: the key goes in the Authorization: Bearer … header, not a query parameter.
  • Signing in: if your client never opens Enoki in your browser, it can’t sign in to Enoki; connect it with an API key.
  • Client support: for a client without native remote-MCP support, use the mcp-remote bridge (see Connect your agent).