They work in every browser mode.
[] means no restriction. about:blank, the new tab page, data: and blob: URLs are always allowed; URLs without a host (file:, javascript:) are blocked.
Patterns
Hosts compare case-insensitively, and international domains match in either form (
münchen.de = xn--mnchen-3ya.de).
How it is enforced
- Helpers refuse.
goto_url,new_tab,http_get(and each redirect it follows) and the agent’s rawPage.navigate/Target.createTargetrefuse a disallowed URL. The model seesPermissionError: blocked: wikipedia.org is not in allowed_domains (example.com). - The browser blocks. browser-use holds its own CDP connection that fails every main-frame navigation to a disallowed host, whoever starts it: link clicks, redirects, popups, JavaScript. The request never leaves the browser.
- Tabs are reset. After each cell, any tab still on a disallowed page goes to
about:blank.
Browser('chrome') skips layer 2 because a second debugging connection would make Chrome ask you to allow it again.
Not blocked
It is a guard for an aligned model, not a sandbox:- Subresources:
fetch()/XHR, images, scripts, iframes and websockets that an allowed page loads from other hosts. - An iframe of a disallowed site inside an allowed page.
- The agent’s own Python networking other than
http_get(requests, sockets,subprocess). - Speculative prefetches a page makes. If the agent then opens one, layer 2 resets the tab.
- Code that goes around browser-use on purpose, such as opening its own CDP connection.
Notes
Agent(web_search=True)together withallowed_domainsraises aValueErrorwhen the run starts, before any browser: search would reach sites the browser may not open.- The 0.x
BROWSER_USE_ALLOWED_DOMAINSenvironment variable is not read;Browser()raises while it is set. - Domain-scoped secrets limit where each secret is typed, independently of these lists.