Error Codes
Every user-facing B4.run failure carries a stable B4_Exxxx code. You'll see
the code wherever the failure shows up (CLI stderr, HTTP/SSE error bodies and
permission-denial tool results), so you can search for it and link to it.
Codes are grouped by range: E1xxx config / b4 check, E2xxx sandbox,
E3xxx permissions, E4xxx model / provider, and E5xxx runtime / import.
A code without a docs link is still a stable identifier you can search for.
| Code | Meaning | Docs |
|---|---|---|
B4_E1001 | Invalid tool scope | /docs/tools#scoping-a-routes-tools |
B4_E1002 | Invalid sandbox config | /docs/configuration#sandbox |
B4_E1003 | Unknown build target | /docs/deployment |
B4_E1004 | Invalid delegation policy | /docs/subagents#delegation-policy |
B4_E1005 | Feature unsupported by the build target or runtime | /docs/deployment |
B4_E1006 | App root package.json is not an ES module | /docs/cli#b4-check |
B4_E1007 | Route entry has no recognisable export | /docs/cli#b4-check |
B4_E1008 | Route entry exports more than one route kind | /docs/cli#b4-check |
B4_E1009 | Invalid memory config | /docs/configuration#memory |
B4_E1010 | Invalid agentsMd config | /docs/configuration#agentsmd |
B4_E2001 | Sandbox unavailable | /docs/sandbox#what-it-is--and-isnt |
B4_E2002 | Sandbox preflight failed | /docs/sandbox#quickstart |
B4_E3001 | Permission denied | /docs/permissions |
B4_E3002 | Subagent dispatch denied | /docs/subagents#delegation-policy |
B4_E3003 | Thread access policy failed to load | /docs/thread-access#load-failures |
B4_E3004 | Middleware failed to load | /docs/middleware#when-middleware-fails-to-load |
B4_E4001 | Model provider package missing | /docs/agents#model-providers |
B4_E4002 | Unknown model id | /docs/agents#model-providers |
B4_E5001 | Import or export mismatch | None |
B4_E5002 | Tool file has the wrong shape | /docs/tools |
B4_E5003 | Subagent unavailable or dispatch failed | /docs/subagents#dispatch-failures |
B4_E5101 | Node version below the supported floor | None |
B4_E5201 | Inspector server failed | /docs/inspector |
B4_E5301 | Runtime store not provided | /docs/deployment |
B4_E5401 | Invalid AG-UI run envelope | /docs/ag-ui#envelope-validation |
B4_E5402 | AG-UI response schema rejected | /docs/ag-ui#response-schema |