Error Codes

Every user-facing B4.run failure carries a stable B4_Exxxx code. The code is printed on the surface where the failure appears — CLI stderr, HTTP/SSE error bodies, and permission-denial tool results — so a failure is searchable and linkable regardless of how you hit it.

Codes are grouped by range: E1xxx config / b4 check, E2xxx sandbox, E3xxx permissions, E4xxx model / provider, and E5xxx runtime / import. A code may omit a docs link and still be a valid, searchable identifier.

CodeMeaningDocs
B4_E1001Invalid tool scope/docs/tools#scoping-a-routes-tools
B4_E1002Invalid sandbox config/docs/configuration#sandbox
B4_E1003Unknown build target/docs/deployment
B4_E1004Invalid delegation policy/docs/subagents#delegation-policy
B4_E1005Feature unsupported by the build target or runtime/docs/deployment
B4_E2001Sandbox unavailable/docs/sandbox#what-it-is--and-isnt
B4_E2002Sandbox preflight failed/docs/sandbox#quickstart
B4_E3001Permission denied/docs/permissions
B4_E3002Subagent dispatch denied/docs/subagents#delegation-policy
B4_E3003Thread access policy failed to load/docs/thread-access#load-failures
B4_E3004Middleware failed to load/docs/middleware#when-middleware-fails-to-load
B4_E4001Model provider package missing/docs/configuration
B4_E4002Unknown model id/docs/configuration
B4_E5001Import or export mismatch
B4_E5002Tool file has the wrong shape/docs/tools
B4_E5003Subagent unavailable or dispatch failed/docs/subagents#dispatch-failures
B4_E5101Node version below the supported floor
B4_E5201Inspector server failed/docs/inspector
B4_E5301Runtime store not provided/docs/deployment