Skip to main content

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.
Context Mixing Risk: An agent reading your Gmail inbox and then navigating to a support ticket site could accidentally paste confidential email content into a public ticket.

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

Format: ["domain1.com", "domain2.com"]Behavior: If agent visits domain1.com, it cannot navigate to domain2.com (and vice versa)Example:
Use Case: Prevent email content from leaking into Slack messages

Implementation

chrome-extension/background.js
Blocking happens at two points:
chrome-extension/background.js
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
Governance Rules are experimental and may block legitimate agent behavior. Use with caution.

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

Scenario: Agent should not navigate from Gmail to any other siteRule:
Result: Agent can only operate within Gmail, cannot leak email content elsewhere
Scenario: Agent should not mix work Slack with personal GmailRule:
Result: Bidirectional block prevents context mixing between work and personal accounts
Scenario: Never allow agent mode on banking websiteRule:
Result: Agent mode immediately stops if agent attempts to navigate to banking site
Scenario: Prevent agent from clicking “Delete All” buttonRule:
Result: Click event is intercepted and blocked with red border flash

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