> ## Documentation Index
> Fetch the complete documentation index at: https://docs-preview.webcompute.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Handle browser-agent, SDK, CLI, MCP, and runtime errors with status, evidence, and next actions.

Treat errors as workflow states with evidence. Store enough context to decide whether to retry, ask for review, or stop.

## Agent result statuses

| Status               | Meaning                              | Common next action                          |
| -------------------- | ------------------------------------ | ------------------------------------------- |
| `completed`          | The agent returned a final result.   | Validate output and persist.                |
| `blocked`            | The site or policy blocked progress. | Review status, page evidence, and Debug UI. |
| `needs_confirmation` | The run requires host approval.      | Ask a human or policy service.              |
| `failed`             | The harness or runtime failed.       | Inspect error details and retry if safe.    |
| `cancelled`          | The run was aborted.                 | Store partial state and stop.               |

## SDK pattern

```ts theme={null}
const result = await agent.run({
  startUrl: "https://www.sec.gov/edgar/search/",
  goal: "Find Apple's latest 10-Q filings.",
});

switch (result.status) {
  case "completed":
    await persistResult(result);
    break;
  case "blocked":
  case "needs_confirmation":
    await queueReview(result);
    break;
  default:
    throw new Error(result.error?.message ?? `Agent ended with ${result.status}`);
}
```

## Debug checklist

* Check the final status.
* Check page URLs and titles in `result.steps`.
* Check blocker or CAPTCHA status.
* Open Debug UI only in a trusted context.
* Review artifacts and downloads.
* Tighten the prompt, domain policy, schema, or deterministic checks.

Reference: [error codes](/reference/error-codes), [limits](/reference/limits), and [SDK error reference](/reference/sdk-reference#errors).
