Overview
ContextFort supports two types of URL blocking:- Domain Blocking Rules - Block navigation between domains (e.g., prevent gmail.com → slack.com)
- URL Pair Blocking Rules - Block navigation between specific full URLs
Storage Structure
Domain Blocking Rules
Stored as an array of domain pairs inchrome.storage.local under urlBlockingRules:
["domainA", "domainB"]- Blocks bidirectional navigation between domainA and domainB["domain", ""]- Blocks navigation FROM domain to ANY other domain["", "domain"]- Blocks agent mode entirely on domain (no agent access allowed)
URL Pair Blocking Rules
Stored as an array of full URL pairs inchrome.storage.local under urlPairBlockingRules:
How It Works
Domain Matching
Domain matching supports subdomains:background.js:1174-1177
- Pattern
"example.com"matches:example.com✓www.example.com✓api.example.com✓app.staging.example.com✓
Navigation Blocking Logic
The extension checks navigation rules in three scenarios:1
Agent Mode Disabled
When pattern is
["", "domain.com"], agent mode is completely blocked on that domain.2
No Outbound Navigation
When pattern is
["domain.com", ""], agents can’t navigate away from domain.com to any other site.3
Bidirectional Blocking
When pattern is
["domainA", "domainB"], agents can’t navigate between these domains in either direction.Implementation
background.js:1179-1239
Navigation Listeners
URL blocking is enforced at three points:1. Agent Detection
When agent mode starts:background.js:730-740
2. Before Navigation
Intercepts navigation before it happens:background.js:1241-1268
3. Tab Updates
Monitors URL changes from tab updates:background.js:1271-1312
Loading Rules
Rules are loaded on extension startup and updated via messages:background.js:360-368
User Notifications
When navigation is blocked, users see:- Badge notification - Red ⛔ icon on extension badge
- In-page notification - Toast notification explaining why navigation was blocked
- Agent stops - The stop button is automatically clicked to halt the agent
Example Configurations
Prevent Email-to-Slack Context Leakage
Block Agents on Admin Panels
Isolate Internal Tools
Best Practices
- Start Broad: Use domain rules for general restrictions
- Be Specific: Use URL pair rules for page-level granularity
- Test Scenarios: Verify rules work for common agent workflows
- Document Rules: Keep notes on why each rule exists
- Monitor Sessions: Check visibility logs to see when rules trigger
Related
- Governance Rules - Network-level compliance policies
- Action Blocking - Element-level interaction controls
- Session Isolation - Understanding context isolation