Overview
Blocking Rules are ContextFort’s primary mechanism for preventing context mixing — the dangerous scenario where information from one website leaks into another website within the same agent session.Types of Blocking Rules
Domain Blocking
Block navigation between specific domains
URL Pair Blocking
Block specific URL combinations
Action Blocking
Block clicks/inputs on specific elements
Domain Blocking Rules
Rule Format
Domain blocking rules are stored as an array of domain pairs:Rule Types
- Bidirectional Block
- Isolation Block
- Restricted Access
Format: Use Case: Prevent email content from leaking into Slack messages
["domain1.com", "domain2.com"]Behavior: If agent visits domain1.com, it cannot navigate to domain2.com (and vice versa)Example:Implementation
chrome-extension/background.js
Navigation Blocking
Blocking happens at two points:After URL Change (tabs.onUpdated)
After URL Change (tabs.onUpdated)
chrome-extension/background.js
URL Pair Blocking
For more granular control, block specific URL combinations (not just domains):URL Pair Implementation
chrome-extension/background.js
URL Pair vs Domain Blocking: Use URL pairs when you need to block specific page combinations but allow general navigation between domains.
Action Blocking
Block agent clicks or inputs on specific elements:Blocked Action Format
Action Blocking Implementation
chrome-extension/content.js
Visual Feedback
chrome-extension/content.js
Why capture phase? Action blocking listeners run in the capture phase (
addEventListener(..., true)) to intercept events before the agent’s event listeners can process them.Governance Rules (Advanced)
Governance rules use Chrome’s Declarative Net Request (DNR) API for more powerful blocking:chrome-extension/background.js
User Notifications
When a blocking rule triggers, ContextFort shows an in-page notification:chrome-extension/background.js
Notification UI
chrome-extension/content.js
Managing Blocking Rules
All blocking rules can be managed through the Dashboard:Load Rules from Storage
chrome-extension/background.js
Update Rules via Dashboard
Example Use Cases
Prevent Email Leaks
Prevent Email Leaks
Scenario: Agent should not navigate from Gmail to any other siteRule:Result: Agent can only operate within Gmail, cannot leak email content elsewhere
Separate Work and Personal
Separate Work and Personal
Scenario: Agent should not mix work Slack with personal GmailRule:Result: Bidirectional block prevents context mixing between work and personal accounts
Disable Agent on Banking Site
Disable Agent on Banking Site
Scenario: Never allow agent mode on banking websiteRule:Result: Agent mode immediately stops if agent attempts to navigate to banking site
Next Steps
Visibility Dashboard
See blocking events in real-time
Session Isolation
Understand how cookie swapping works with blocking rules
Dashboard Controls
Configure blocking rules in the UI
Security Policy
Learn about ContextFort’s security model