Safe AI Workbench Developer Docs

Browser Extension

Use AI tasks directly from any webpage with the Guardian Health browser extension

Overview

The Guardian Health browser extension brings AI-powered tasks to your browser, allowing you to process selected text on any webpage with context-aware AI assistance. Perfect for summarizing articles, translating content, analyzing data, or drafting responses without leaving your current workflow.

Key Features

  • Right-click context menu integration
  • Process selected text with any enabled AI task
  • Automatic PHI detection and policy enforcement
  • Copy results to clipboard or insert into page
  • Secure authentication with your Guardian Health account
  • Works on any website

Installation

Coming Soon: The Guardian Health browser extension will be available on the Chrome Web Store. Until then, you can sideload the extension in developer mode.

Chrome / Edge (Developer Mode)

  1. Download the extension package from your organization's admin
  2. Navigate to chrome://extensions or edge://extensions
  3. Enable "Developer mode" in the top-right corner
  4. Click "Load unpacked" and select the extension folder
  5. Grant required permissions (activeTab, contextMenus, storage)
  6. Click the extension icon and sign in with your Guardian Health account

Authentication

The extension supports two authentication methods:

  • Sign in with Guardian Health (Recommended) - OAuth flow that securely authenticates with your organization account. This is the primary method for regular users.
  • API Key - Useful for demos and testing. Admins can generate temporary API keys to distribute for evaluation purposes without requiring full account setup.

Using the Extension

Basic Usage

  1. Select text on any webpage (email, article, document, etc.)
  2. Right-click the selected text
  3. Choose "Guardian Health" from the context menu
  4. Select an AI task from the submenu (only enabled tasks appear)
  5. Review the result in the popup window
  6. Copy to clipboard or click "Insert" to paste at cursor position

Example Workflows

Summarizing Articles

Select article content → Right-click → Guardian Health → Summarize Document → Get concise summary with key points

Translating Content

Select foreign text → Right-click → Guardian Health → Translate Text → Receive translation in your preferred language

Drafting Email Replies

Select email content → Right-click → Guardian Health → Draft Email → Generate professional response based on context

Enabling Tasks for Extension

By default, AI tasks are not visible in the browser extension. Administrators must explicitly enable tasks for extension use.

Enable a Task (Admin)

  1. Navigate to Dashboard → AI Tasks
  2. Click on the task you want to enable
  3. Check the "Show in browser extension" checkbox
  4. Click Save

Example: Enabling via API

PUT /api/ai/tasks/:taskId
{
  "showInExtension": true
}

Recommended Tasks for Extension

  • Summarize Document - Quick summaries of articles and reports
  • Translate Text - Translate selected text
  • Draft Email - Generate email responses
  • Analyze Sentiment - Understand tone of customer feedback
  • Simplify Text - Make complex content more readable
  • Extract Key Points - Pull out main ideas from long text

PHI Detection & Policies

The browser extension fully integrates with Guardian Health's PHI detection and policy enforcement system. All selected text is scanned before processing.

How It Works

  1. User selects text and chooses a task
  2. Extension sends text to API with task context
  3. Presidio scans for PHI (names, SSNs, phone numbers, etc.)
  4. Policies are evaluated based on organization, group, and user settings
  5. Action taken based on policy:
    • Block - Request rejected, error shown to user
    • Warn - Warning shown, user can proceed
    • Redact - PHI replaced with placeholders, task proceeds
    • Allow - Task proceeds with audit log entry

⚠️ Security Best Practices

  • Never process patient records or medical charts via extension
  • Review organization policies before enabling tasks
  • Use "block" policy for high-sensitivity departments
  • Regularly audit extension usage via Analytics dashboard
  • Revoke API keys immediately if compromised

Permissions

The extension requires the following permissions:

activeTab

Access to read selected text on the current tab when you trigger the extension

contextMenus

Add "Guardian Health" option to right-click context menu

storage

Store your API key and extension preferences locally

Privacy: The extension only sends text to Guardian Health APIs when you explicitly select a task. No data is collected or shared with third parties.

Troubleshooting

No tasks appear in context menu

  • Verify tasks are enabled with "Show in browser extension" checkbox
  • Check that you're signed in with a valid Guardian Health account
  • Ensure tasks are assigned to your user or group
  • Try signing out and signing back in

"Unauthorized" error

  • Sign out and sign back in to refresh your session
  • If using an API key, it may be expired - generate a new one
  • Check that your account is active and has proper permissions
  • Verify organization subscription is current

"PHI detected" blocking requests

  • Review organization policies in Dashboard → Policies
  • Contact admin to adjust policy for your group or user
  • Use redaction policy to process content with PHI removed

Extension not responding

  • Refresh the page and try again
  • Disable and re-enable the extension
  • Check browser console for errors (F12 → Console)
  • Reinstall extension if issues persist

Related API Endpoints

The browser extension uses these API endpoints:

GET /api/ai/tasks

Fetch available tasks (filtered by showInExtension flag)

POST /api/ai/chat

Execute task with selected text as input

GET /api/policies

Fetch active policies for PHI enforcement