- โจ Features
- ๐ Quick Start
- ๐ Documentation
- ๐๏ธ Architecture
- โ๏ธ Configuration
- ๐งช Development
- ๐บ๏ธ Roadmap
- ๐ค Contributing
- ๐ License
| Feature | Description | Status |
|---|---|---|
| ๐ง Pega-Aware Intelligence | Auto-detects Pega apps, extracts case context, understands domain | โ Stable |
| ๐ Privacy-First PII Protection | 8 categories, field-level masking, tokenization before transmission | โ Stable |
| ๐ฌ Natural Language Commands | 11 supported intents, local & AI-powered | โ Stable |
| ๐ Case Summarization | Auto-generated 4-part summaries with risk signals | โ Stable |
| ๐ฏ Action Planning | 14 action types with smart waiting & confirmation | โ Stable |
| ๐๏ธ Visual Understanding | Screenshot capture & visual analysis | โ Stable |
| ๐ Workflow Automation | Multi-step workflows with self-healing | โ Stable |
| ๐ MCP Server | Full Model Context Protocol implementation | โ Stable |
Advanced browser automation with self-healing capabilities
Inspired by industry-leading tools like Playwright and Stagehand, the extension includes powerful headless browser automation features:
Unlike traditional scripts that use fixed delays, we use intelligent waiting:
| Strategy | Use Case | Example |
|---|---|---|
WAIT_FOR_ELEMENT |
Wait for element to exist | Wait for submit button to appear |
WAIT_FOR_VISIBLE |
Wait for element to be visible | Wait for modal to fade in |
WAIT_FOR_ENABLED |
Wait for element to be clickable | Wait for disabled input to become enabled |
WAIT_FOR_HIDDEN |
Wait for element to disappear | Wait for loading spinner to vanish |
WAIT_FOR_TEXT |
Wait for text content | Wait for "Success" message |
Benefits:
- โก Faster execution - No arbitrary delays
- ๐ More reliable - Waits exactly as long as needed
- ๐ก๏ธ Flakiness resistant - Adapts to network conditions
When an action fails, the system automatically tries alternative strategies:
graph TD
A[Action Fails] --> B{Try Alternative}
B --> C[Test ID Selector]
B --> D[Test Data Attribute]
B --> E[ARIA Label]
B --> F[Text Content]
B --> G[CSS Selector]
C --> H{Success?}
D --> H
E --> H
F --> H
G --> H
H -->|Yes| I[Continue]
H -->|No| J[Retry with Fallback]
Fallback Hierarchy:
- Test ID -
data-test-id="submit-btn" - Data Attribute -
data-pega-action="submit" - ARIA Label -
aria-label="Submit case" - Text Content - Button text matches
- CSS Selector - Structural selector
- Visual Position - Element coordinates (via screenshot analysis)
Capture and analyze screenshots to verify action results:
// Example: Verify form submission
await executeAction('CLICK', { selector: '#submit-btn' });
await executeAction('WAIT_FOR_HIDDEN', { selector: '#loading-spinner' });
await takeScreenshot();
await executeAction('VERIFY_VISIBLE', { selector: '.success-message' });Visual Capabilities:
- ๐ธ Screenshot capture - Full page or element-specific
- ๐ Visual analysis - Detect elements by appearance
- โ๏ธ Visual diffing - Compare before/after states
- ๐ฏ Element detection - Find elements without selectors
Complex workflows with state management and conditional logic:
workflow:
name: "Loan Application Intake"
steps:
- action: NAVIGATE
url: "/cases/create/loan"
- action: TYPE
selector: "#applicant-name"
value: "{NAME_1}" # PII token
- action: SELECT
selector: "#loan-type"
value: "Mortgage"
- action: CONDITION
condition: "amount > 100000"
then: ESCALATE
else: SAVEWorkflow Features:
- ๐ Declarative syntax - YAML-based workflow definitions
- ๐ Loops - Batch process multiple cases
- ๐ Conditionals - If/then/else logic
- โธ๏ธ Pause/Resume - Control execution
- ๐ State persistence - Share data between steps
- ๐ง Error recovery - Automatic retries with fallback
Execute complex actions with built-in intelligence:
// Example: Smart form fill
await executeAction('TYPE', {
selector: '#status',
value: 'Pending Documentation',
waitFor: 'enabled', // Wait for input to be enabled
validate: true, // Verify value was set
screenshotAfter: true // Take screenshot after action
});Action Options:
- โฑ๏ธ Smart waiting - Automatic wait conditions
- โ๏ธ Validation - Verify action succeeded
- ๐ธ Screenshots - Capture before/after
- ๐ Retry - Automatic retry with fallback
- ๐ Logging - Complete audit trail
Detect UI changes automatically:
| Feature | Description |
|---|---|
| Baseline Capture | Store screenshots as baseline |
| Visual Diff | Compare current vs baseline |
| Change Detection | Highlight differences |
| Regression Alert | Flag unexpected changes |
graph LR
A[Pega App] --> B[Detector]
B --> C{Framework?}
C -->|Constellation| D[React]
C -->|Cosmos| E[Angular]
C -->|Classic| F[JSP]
D --> G[Case Context]
E --> G
F --> G
G --> H[Domain Knowledge]
Capabilities:
- ๐ฏ Automatic Detection - Recognizes Pega by domain, UI patterns, DOM structure
- ๐ผ๏ธ Framework Support - Constellation (React), Cosmos (Angular), Classic UI
- ๐ฆ Domain Knowledge - Financial Lending, Insurance Claims, Healthcare, Service Management
- ๐ Case Context - Extracts ID, type, status, stage, assignee, urgency automatically
| PII Category | Pattern Examples | Mask Format |
|---|---|---|
| NAME | First Name, Last Name, Full Name | {NAME_1} |
| SSN | Social Security, Tax ID, EIN | {SSN_1} |
| DOB | Date of Birth, Birth Date | {DOB_1} |
| Email, E-Mail Address | {EMAIL_1} |
|
| PHONE | Phone, Mobile, Cell, Telephone | {PHONE_1} |
| ACCOUNT | Account Number, Card Number, Policy # | {ACCOUNT_1} |
| ADDRESS | Address, Street, City, State, ZIP | {ADDRESS_1} |
| INCOME | Income, Salary, Annual Income | {INCOME_1} |
Security Guarantees:
- โ Field-level masking before ANY external transmission
- โ Session-scoped token isolation
- โ Complete audit trail with masked tokens only
- โ Never accesses Pega authentication tokens
- โ Local-first processing with user control
Local Intents (No LLM Required)
| Command | Action | Confidence |
|---|---|---|
Summarize this case |
Generate 4-part case summary | 95% |
Submit/Complete |
Submit case (requires confirmation) | 90% |
Save |
Persist changes | 95% |
Next |
Proceed to next step | 92% |
My queue |
Show assigned cases | 88% |
AI-Powered Intents
| Command | Action | Requires |
|---|---|---|
Update the status to [value] |
Field updates | LLM |
Escalate to supervisor |
Transfer case | LLM |
Create a new case |
Start new case | LLM |
Open case ABC-123 |
Navigate to case | LLM |
Find cases with... |
Search & filter | LLM |
Explain why... |
Get explanations | LLM |
Auto-generated 4-part summaries when cases open:
## Situation
Brief description of what the case is about and why it was created.
## History
- 2025-03-01: Case created
- 2025-03-05: Initial review completed
- 2025-03-07: Documentation requested
## Current State
Status: Pending Documentation
Stage: Processing
Assignee: John Doe
Urgency: High
## Risk Signals
โ ๏ธ SLA at risk (3 days remaining)
โ ๏ธ Required field missing: .Description
โ ๏ธ No updates in 48 hours14 Action Types:
CLICK- Click buttons, links, checkboxesTYPE- Enter text in input fieldsSELECT- Choose dropdown optionsCLEAR- Clear field valuesNAVIGATE- Navigate to URLsWAIT_FOR_ELEMENT- Wait until element existsWAIT_FOR_VISIBLE- Wait until element is visibleWAIT_FOR_ENABLED- Wait until element is enabledWAIT_FOR_HIDDEN- Wait until element is hiddenWAIT_FOR_TEXT- Wait for text to appearVERIFY_VISIBLE- Confirm element is visibleASSERT_TEXT- Validate text contentSCROLL- Scroll page or elementWAIT- Fixed time delay (use sparingly)
Model Context Protocol for external integrations:
| Tool | Description |
|---|---|
pega_get_case_summary |
Generate case summary |
pega_execute_action_plan |
Execute action plan |
pega_get_dom_snapshot |
Get current DOM state |
pega_detect_framework |
Detect Pega framework |
pega_update_field |
Update field value |
pega_click_action |
Click action button |
pega_navigate_case |
Navigate to case |
pega_wait_for |
Smart wait condition |
Resources:
case_context- Current case informationdom_snapshot- Current DOM statecase_summary- Generated case summaryaudit_log- Action audit trail
- Node.js 18+
- Chrome/Edge (Manifest V3 support)
- LLM API Key (Anthropic, OpenAI, or Azure)
# Clone the repository
git clone https://github.com/skc-learn/pega-agent-plugin.git
cd pega-agent-plugin/pega-browser-agent
# Install dependencies
npm install
# Build the extension
npm run buildflowchart LR
A[Open chrome://extensions/] --> B[Enable Developer Mode]
B --> C[Click Load Unpacked]
C --> D[Select pega-browser-agent Folder]
D --> E[Extension Loaded!]
Steps:
- Navigate to
chrome://extensions/ - Toggle Developer mode (top right)
- Click Load unpacked
- Select the
pega-browser-agentfolder
// Via browser console
chrome.storage.session.set({ 'llm-api-key': 'your-api-key' });
// Or via extension settings
chrome://extensions/ โ Pega Agent Plugin โ Details โ Extension settingssequenceDiagram
participant User
participant Extension
participant Pega
participant LLM
User->>Extension: Navigate to Pega app
Extension->>Pega: Detect Pega & Extract context
Extension->>Extension: Generate case summary
Extension->>User: Display summary in side panel
User->>Extension: "Update status to Pending"
Extension->>LLM: Plan action
LLM->>Extension: Return action plan
Extension->>User: Show confirmation
User->>Extension: Approve
Extension->>Pega: Execute action
- Navigate to any Pega Infinity application
- Click the extension icon or press
Ctrl+Shift+P - Use natural language commands in the side panel
| Document | Description | Link |
|---|---|---|
| ๐๏ธ Architecture | System design, components, data flow | View |
| ๐ API Reference | Complete API documentation | View |
| ๐จโ๐ป Developer Guide | Setup, development, testing | View |
| ๐ Security | Security model, PII protection, compliance | View |
| ๐บ๏ธ Roadmap | 5-rung integration ladder | View |
| ๐ก Usage Examples | Practical examples & troubleshooting | View |
graph TB
subgraph "Browser Extension"
SW[Service Worker]
CS[Content Scripts]
SP[Side Panel]
end
subgraph "Content Scripts"
PD[Pega Detector]
DP[DOM Parser]
PM[PII Masker]
AE[Action Executor]
end
subgraph "Service Worker"
PL[Planner]
LA[LLM Adapter]
SG[Summary Generator]
MC[MCP Server]
end
SW <--> CS
SW <--> SP
PD --> DP
DP --> PM
PM --> PL
PL --> LA
LA --> SG
PL --> AE
MC --> PL
MC --> DP
Component Overview:
| Component | Responsibility |
|---|---|
| Service Worker | Central message router, orchestrator, LLM adapter |
| Content Scripts | DOM interaction, PII masking, action execution |
| Side Panel | Chat-style UI controller |
| PII Masker | Field classification & tokenization |
| DOM Parser | Semantic DOM extraction |
| Planner | Intent-to-action transformation |
| MCP Server | External integration protocol |
{
"security": {
"piiMaskingEnabled": true,
"piiCategoriesToMask": [
"NAME", "SSN", "DOB", "EMAIL",
"PHONE", "ACCOUNT", "ADDRESS", "INCOME"
],
"auditLoggingEnabled": true
},
"llm": {
"provider": "anthropic",
"model": "claude-sonnet-4-20250514",
"maxTokens": 1500,
"temperature": 0.1
},
"pega": {
"autoDetect": true,
"allowedDomains": ["*.pegacloud.io", "*.pega.com"]
},
"roleRestrictions": {
"caseWorker": [
"SUMMARIZE_CASE", "UPDATE_FIELD",
"NEXT_STEP", "SAVE_CASE", "SHOW_QUEUE"
],
"supervisor": ["*"],
"readOnly": [
"SUMMARIZE_CASE", "SHOW_QUEUE", "EXPLAIN"
]
}
}{
"llm": {
"provider": "multi",
"providers": [
{
"name": "anthropic",
"apiKey": "sk-ant-...",
"models": ["claude-sonnet-4-20250514"]
},
{
"name": "azure-openai",
"endpoint": "https://your-resource.openai.azure.com/",
"apiKey": "your-key",
"models": ["gpt-4"]
}
],
"fallback": true
}
}# Clone the repository
git clone https://github.com/skc-learn/pega-agent-plugin.git
cd pega-agent-plugin/pega-browser-agent
# Install dependencies
npm install
# Development mode with hot reload
npm run dev
# Run tests
npm test
# Type checking
npm run type-check
# Linting
npm run lint
# Build for production
npm run build
# Package for distribution
npm run packagepega-browser-agent/
โโโ src/
โ โโโ content-scripts/ # DOM interaction
โ โ โโโ pega-detector.ts
โ โ โโโ dom-parser.ts
โ โ โโโ pii-masker.ts
โ โ โโโ action-executor.ts
โ โโโ service-worker/ # Background processing
โ โ โโโ sw.ts
โ โ โโโ planner.ts
โ โ โโโ llm-adapter.ts
โ โ โโโ mcp-server.ts
โ โโโ side-panel/ # UI panel
โ โ โโโ panel.ts
โ โโโ shared/ # Common utilities
โ โ โโโ types.ts
โ โ โโโ message-types.ts
โ โ โโโ pega-heuristics.ts
โ โโโ config/ # Configuration
โ โโโ default-config.ts
โโโ tests/ # Unit tests
โ โโโ unit/
โ โโโ fixtures/
โโโ public/ # HTML/CSS assets
โโโ manifest.json # Extension manifest
โโโ package.json
โโโ tsconfig.json
โโโ webpack.config.cjs
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests with coverage
npm test -- --coverage
# Run specific test file
npm test -- pii-masker.test.tsTest Coverage:
- โ PII Masker: 8 categories ร 100+ test cases
- โ Intent Classifier: 11 intents ร positive/negative examples
- โ Session isolation tests
- โ Token resolution tests
timeline
title Pega Agent Plugin Roadmap
section Rung 1 (Now)
Browser Extension : DOM parsing & LLM : โ
Complete
section Rung 2 (Q2 2025)
Pega API Integration : Direct REST API : ๐ In Progress
section Rung 3 (Q3 2025)
CDH Integration : Prediction Studio : โณ Planned
section Rung 4 (Q4 2025)
Constellation Native : Component-based : โณ Planned
section Rung 5 (Q1 2026)
Platform Integration : Data Fabric : โณ Planned
5-Rung Integration Ladder:
| Rung | Capability | Status | Timeline |
|---|---|---|---|
| 1 | Browser Extension with DOM parsing | โ Complete | Now |
| 2 | Direct Pega API integration | ๐ Beta | Q2 2025 |
| 3 | CDH and Prediction Studio | โณ Alpha | Q3 2025 |
| 4 | Constellation-native component | โณ Design | Q4 2025 |
| 5 | Platform Rules & Data Fabric | โณ Research | Q1 2026 |
We welcome contributions! Here's how to get started:
flowchart LR
A[Fork Repository] --> B[Create Feature Branch]
B --> C[Make Changes]
C --> D[Add Tests]
D --> E[Run Tests]
E --> F{Tests Pass?}
F -->|No| C
F -->|Yes| G[Submit Pull Request]
G --> H[Code Review]
H --> I{Approved?}
I -->|No| C
I -->|Yes| J[Merged!]
- ๐ด Fork the repository
- ๐ Create a feature branch (
git checkout -b feature/amazing-feature) - ๐พ Commit your changes (
git commit -m 'Add amazing feature') - ๐ค Push to the branch (
git push origin feature/amazing-feature) - ๐ Open a Pull Request
- TypeScript with strict typing (no
anytypes) - CamelCase for variables and functions
- PascalCase for classes and interfaces
- kebab-case for file names
- JSDoc comments for all public APIs
- Tests added/updated
- All tests passing
- Documentation updated
- Code follows style guidelines
- Commit messages are clear
- No merge conflicts
graph LR
A[MIT License] --> B[โ
Free to use]
A --> C[โ
Free to modify]
A --> D[โ
Free to distribute]
A --> E[โ No warranty]
MIT License - See LICENSE file for details.
This project is free to use, modify, and distribute. No warranty is provided.
This project is:
- โ NOT affiliated with Pegasystems Inc.
- โ NOT endorsed by Pegasystems Inc.
- โ NOT sponsored by Pegasystems Inc.
- โ NOT supported by Pegasystems Inc.
Pegaยฎ, Pega Infinityยฎ, Pega Infinity '23, Pega PLATFORMยฎ, Pega Cosmosยฎ, Pega Constellationยฎ, and all related marks are trademarks of Pegasystems Inc.
These trademarks are used only for descriptive purposes to indicate compatibility with Pega applications.
- โ Test thoroughly in non-production environments
- โ Ensure compliance with your organization's security policies
- โ Review code and configuration before production use
- โ Authors are NOT liable for any damage to data or systems
| Resource | Link |
|---|---|
| Issues | GitHub Issues |
| Discussions | GitHub Discussions |
| Documentation | Full Docs |
| Pega Support | Pega Community |
If you find this project helpful, please consider giving it a star โญ
This project is an independent community effort and is not officially affiliated with Pegasystems Inc.
๐ Back to Home โข ๐ Documentation โข ๐ Report Issue โข ๐ก Feature Request