You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for a list of prohibited domains.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a prohibited_domains option to block navigation to specific domains
and URL patterns in the SecurityWatchdog. Allowlist still takes
precedence, and internal new-tab/blank pages remain allowed.
- New Features
- BrowserProfile: new prohibited_domains list.
- SecurityWatchdog: uses allowlist if present; otherwise applies
prohibitlist; defaults to allow when neither is set.
- Pattern support: exact domains (case-insensitive, also blocks www),
wildcard subdomains (*.domain.com for http/https), and full URL/prefix
patterns (e.g., https://host, brave://*). Ignores credentials in the URL
when matching the host. Always allows about:blank and Chrome new-tab
pages.
- Refactors
- Extracted _is_url_match for shared pattern matching.
- Added tests for precedence (allowlist over prohibitlist), wildcard and
scheme rules, internal URL exceptions, and credential edge cases.
<!-- End of auto-generated description by cubic. -->
Copy file name to clipboardExpand all lines: browser_use/browser/profile.py
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -559,6 +559,10 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Bro
559
559
default=None,
560
560
description='List of allowed domains for navigation e.g. ["*.google.com", "https://example.com", "chrome-extension://*"]',
561
561
)
562
+
prohibited_domains: list[str] |None=Field(
563
+
default=None,
564
+
description='List of prohibited domains for navigation e.g. ["*.google.com", "https://example.com", "chrome-extension://*"]. Allowed domains take precedence over prohibited domains.',
565
+
)
562
566
keep_alive: bool|None=Field(default=None, description='Keep browser alive after agent run.')
0 commit comments