Browser Extension
The Palyra Browser Extension is a Manifest V3 compliant component designed to provide thepalyra-daemon with high-fidelity DOM snapshots and relay capabilities. It operates with a loopback-only security posture, ensuring that it only communicates with a locally running or explicitly paired Palyra instance.
Core Architecture and Data Flow
The extension serves as a bridge between the browser’s internal state (DOM, tabs, cookies) and thepalyra-browserd service. It uses a relay dispatch mechanism to handle requests from the agent.
Implementation Details
- Manifest V3: Utilizes service workers for background processing and fine-grained permission scoping.
- DOM Snapshotting: Captures the current state of the active tab, including computed styles and accessibility trees, to provide context to the LLM.
- Relay Dispatch: Routes commands from the
BrowserServicegRPC interface to the specific browser tab.
Security Posture
The extension enforces a strict security model:- Loopback-Only: By default, the extension only accepts connections from
127.0.0.1to prevent cross-site request forgery (CSRF) or unauthorized remote control. - Pairing Flow: Remote instances must undergo a pairing handshake, involving a PIN or QR code, which is managed via the
AccessSectionin the Web Console apps/web/src/console/sections/AccessSection.tsx#65-167. - SSRF Protection: Integration with the daemon’s egress proxy ensures that the extension cannot be used as a proxy to scan internal networks.
Pairing and Trust
Devices, including browsers running the extension, must be enrolled in the Palyra Inventory. The pairing process is orchestrated through theuseSupportDomain hook apps/web/src/console/hooks/useSupportDomain.ts#26-121.
Browser Trust Lifecycle
- Discovery: The extension detects a Palyra daemon via a local handshake.
- Pairing Request: The user initiates pairing, creating a
NodePairingRequestViewapps/web/src/console/sections/AccessSection.tsx#73-73. - Approval: The operator approves the request in the Access section apps/web/src/console/sections/AccessSection.tsx#148-151.
- Active Session: The extension receives a certificate and enters the “trusted” state.
Code Entity Mapping: Browser Service
The following diagram bridges the logical browser service concepts to the implementation entities. Browser Extension Logic to Code Mapping Sources: apps/desktop/ui/src/components/QuickFactsCard.tsx#62-70, apps/web/src/console/hooks/useSupportDomain.ts#72-74Mobile Application Stubs
Palyra includes stubs for Android and iOS applications, located inapps/android/ and apps/ios/. These are currently designed as thin clients for the Web Console with native notification support.
Features and Capabilities
- A2UI Rendering: Mobile apps use the same Adaptive Agent UI (A2UI) renderer as the web console to display run streams and tool outputs.
- Push Notifications: Integration with the
ChannelRouterto receive alerts for “AskEachTime” tool approvals or high-priority routine completions. - Identity Integration: Mobile devices use the
palyra-identitycrate logic to maintain mTLS connections to the daemon, similar to the CLI pairing flow.
Implementation Status
| Feature | Android | iOS |
|---|---|---|
| gRPC Stubs | Generated (Kotlin) | Generated (Swift) |
| mTLS Auth | Supported | Supported |
| A2UI WebView | Functional | Functional |
| Background Relay | Experimental | Experimental |
Integration with Channel Connectors
The browser extension and mobile apps often interact with theChannelRouter when the agent requires human intervention (e.g., via Discord or Slack).
Discord Onboarding and Verification
The mobile and web interfaces provide specialized panels for managing these connections, such as theDiscordOnboardingPanel apps/web/src/features/channels/connectors/discord/components/DiscordOnboardingPanel.tsx. Operators can trigger test messages to verify that the mobile relay or browser notifications are correctly routed apps/web/src/features/channels/connectors/discord/components/DiscordConnectorActionsPanel.tsx#23-55.
Channel Dispatch Flow
Sources: apps/web/src/consoleApi/channels/discord.ts#10-29, apps/web/src/features/channels/connectors/discord/components/DiscordConnectorActionsPanel.tsx#78-84
Monitoring and Health
The health of the browser service and peripheral apps is monitored by the desktop supervisor and reported in theControlCenterSnapshot apps/desktop/ui/src/components/HealthStrip.tsx#97-117.
Key health metrics include:
- Browser Health: Indicates if the extension is connected and responsive apps/desktop/ui/src/components/QuickFactsCard.tsx#62-68.
- Last Error: Captures the last failure reported by the browser relay apps/desktop/ui/src/components/QuickFactsCard.tsx#72-77.
- Device Trust State: Tracks if the mobile or browser device is still considered “trusted” by the inventory apps/web/src/console/sections/AccessSection.tsx#98-100.