# Blocking policy (/browser-api/blocking-policy)

RunHBrowser is a full browser: pages, `goto`, `evaluate`, request interception (`page.route` or `Fetch.*`), the session's cookies, screenshots, and several tabs all work. The policy removes only what would let a script reach the host machine, other users, or private networks.

## How a block looks [#how-a-block-looks]

**A blocked CDP command** answers an error with code `-32000`, a message starting with `POLICY_BLOCKED:`, and data `POLICY_BLOCKED`. The WebSocket stays open, so the rest of the script keeps working.

```json
{
  "id": 7,
  "error": {
    "code": -32000,
    "message": "POLICY_BLOCKED: ...",
    "data": "POLICY_BLOCKED"
  }
}
```

In Puppeteer and Playwright this surfaces as a rejected promise whose message contains `POLICY_BLOCKED:`.

**A blocked network request** looks like a connection error to the page and appears as a `blocked` event in the session timeline. See [Network rules](#network-rules).

Some protocol violations close the socket instead: a frame that is not valid CDP, a message over 8 MB, or a session over the traffic ceiling closes it with code `1008`. See [Errors and close codes](/browser-api/errors).

## Blocked commands [#blocked-commands]

| Blocked | Why |
| --- | --- |
| Every `Browser.*` method except `Browser.getVersion`, `Browser.close` and `Browser.setDownloadBehavior` | Browser-wide control belongs to the platform. |
| `Target.exposeDevToolsProtocol` | The page must not get direct access to the protocol. |
| `IO.*`, `SystemInfo.*`, `Tracing.*` | They reach the host rather than the page. |
| `Target.attachToTarget` and `Target.setAutoAttach` without `flatten: true` | Only flattened sessions pass through the policy checks. |
| Navigation (`Page.navigate`, `Target.createTarget`) to anything except `http:`, `https:`, `data:`, `blob:`, `javascript:`, and `about:blank` | Blocks `file:`, `chrome:`, `devtools:`, `view-source:`, and every `about:` URL other than `about:blank`. |
| `DOM.setFileInputFiles` with file paths | The server cannot read your disk. Clearing the input is fine. |
| `Target.createBrowserContext` with `proxyServer` or `proxyBypassList` | A context cannot bring its own proxy. |
| `Storage.*` for origins other than `http` and `https` | Storage access stays on web origins. |

`Browser.getVersion` reports `RunHBrowser/<version>`.

`Browser.setDownloadBehavior` and `Page.setDownloadBehavior` are accepted so that Puppeteer and Playwright can connect, but they change nothing: downloads are always denied.

To upload files, use Playwright's `setInputFiles` with buffers instead of file paths:

```javascript
await page.setInputFiles("input[type=file]", {
  name: "report.txt",
  mimeType: "text/plain",
  buffer: Buffer.from("hello"),
});
```

## Downloads, WebRTC, and QUIC [#downloads-webrtc-and-quic]

- File downloads are denied entirely.
- WebRTC without a proxy and QUIC are disabled, so traffic cannot bypass the proxy.

## Network rules [#network-rules]

These rules apply to every request the browser makes.

- **Private networks.** Requests to private, loopback, and link-local addresses are refused.
- **Ports.** Only the default ports 80 and 443 are reachable. `https://example.com` works; `http://example.com:8080` does not.
- **Platform blocklist.** A platform-wide blocklist of site categories (government, banking, payments, crypto exchanges, adult content) is always enforced.
- **Your allow and deny lists.** Each browser account can have its own lists. Patterns are `example.com` and `*.example.com`. A non-empty allow list confines the account to those hosts. A deny entry beats an allow entry.

The platform blocklist beats everything; your deny list beats your allow list. Rules are enforced for all subdomains. A blocked request looks like a connection error to the page, and the session timeline records a `blocked` event with the host (never the path or query string).