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

# browser_policy

> Restrict where a tab (or every tab the agent opens from now on) may navigate and load from: allow lists domains that are permitted (everything else is blocked),

Restrict where a tab (or every tab the agent opens from now on) may navigate and load from: allow lists domains that are permitted (everything else is blocked), block lists domains that are denied. Subdomains match. Non-http schemes always pass. Blocked navigations fail with ERR\_BLOCKED\_BY\_CLIENT.

## Parameters

<ParamField body="action" type="enum" required>
  One of: `set`, `clear`, `status`.
</ParamField>

<ParamField body="tabId" type="integer">
  Target tab id from browser\_tabs, which lists tabs across all windows. Defaults to the agent's most recently opened usable tab, or the only usable tab. Otherwise select a listed tabId.
</ParamField>

<ParamField body="allow" type="string[]">
   
</ParamField>

<ParamField body="block" type="string[]">
   
</ParamField>

<ParamField body="default" type="boolean">
  set/clear: also make this the policy for tabs the agent opens later
</ParamField>

## Example

```json Allow-list for one tab theme={null}
{
  "action": "set",
  "tabId": 1234,
  "allow": [
    "example.com",
    "cdn.example.net"
  ]
}
```

```json Block trackers on every tab the agent opens from now on theme={null}
{
  "action": "set",
  "default": true,
  "block": [
    "doubleclick.net",
    "google-analytics.com"
  ]
}
```
