Klick
About the project
Viewed README.md:1-100
Viewed architecture.md:1-60
BrowserPilot AI: Project Description ππ€
A local-first, privacy-respecting autonomous browser agent powered by local LLMs (Ollama / Gemma), Playwright, FastAPI, and Streamlit.
π Executive Summary
BrowserPilot AI is an autonomous web agent designed to plan, reason, and execute browser interactions directly on a userβs machine. Unlike cloud-dependent alternatives, BrowserPilot AI executes 100% locally:
- Zero cloud API lock-in: Powered by local model weights via Ollama (Google Gemma 3 / 4).
- Absolute data privacy: Credentials, internal corporate intranets, and browser telemetry never leave the local environment.
- Deterministic control & safety: Hardened by multi-layer safety guardrails that detect indirect prompt injections in webpage text and block destructive actions before execution.
π― Core Capabilities
| Capability | Description |
|---|---|
| π§ Local Cognitive Loop | Uses local LLMs to interpret high-level natural language goals, analyze page observations, generate cognitive thoughts, and emit strict JSON browser actions. |
| ποΈ Semantic DOM Observer | Extracts page structure, titles, active URLs, and visible interactive elements mapped via semantic CSS selectors and data-agent-id tags. |
| β‘ Playwright Automation | Direct, deterministic browser automation (clicks, keyboard input, scrolls, navigation, and modal interactions) in visible Chrome or headless mode. |
| π‘οΈ Proactive Safety & Guardrails | Intercepts destructive actions (e.g., purge, delete, drop table), scans untrusted web content for adversarial prompt injections, and redacts sensitive credentials. |
| βΉοΈ Instant Stop Control | Mid-flight interruption mechanism allowing users to halt agent execution instantly and abort pending browser actions. |
| ποΈ Dual Control Interfaces | Streamlit Control Center with an Ollama Playground and privacy redaction, alongside an HTML/JS Live Dashboard with preset benchmark workflows. |
ποΈ System Architecture
flowchart TD
User([User / Operator]) --> UI["Frontends:<br/>β’ Streamlit Control Center (Port 8501)<br/>β’ HTML5 Telemetry Dashboard (Port 8000)"]
subgraph Backend ["FastAPI Backend (Port 8000)"]
API["REST Endpoints & WebSockets<br/>/api/agent/start β’ /execute β’ /stop β’ /events"]
Loop["AgentLoop Coordinator"]
Safety["SafetyGuard<br/>(Destructive Gate & Injection Scanner)"]
Events["EventManager (WebSocket Pub/Sub)"]
end
subgraph LLM ["Local Intelligence Engine (Port 11434)"]
Ollama["Ollama Runtime<br/>(gemma3:4b / gemma4:e2b)"]
end
subgraph Browser ["Automation Engine (Playwright)"]
Observer["PlaywrightObserver<br/>(DOM Extraction & Accessibility Tree)"]
Executor["PlaywrightExecutor<br/>(Click, Type, Navigate, Scroll)"]
Chrome["Chromium Browser Instance"]
end
subgraph Web ["Target Environments"]
Mock["Mock Enterprise Portal (Port 8080)<br/>(Invoices, Settings, Tasks, Injection Sandbox)"]
end
UI --> API
API --> Loop
Loop --> Ollama
Loop --> Safety
Loop --> Observer & Executor
Observer --> Chrome
Executor --> Chrome
Chrome --> Mock
Loop --> Events
Events --> UI
π§© Key Modules & File Organization
-
backend/app/main.py: The FastAPI server hosting/api/agent/start, atomic/execute,/stop,/observe, and real-time/ws/events. -
backend/app/agent_loop.py: The autonomous cognitive loop orchestrating: Observe β Scan Injections β Reason (LLM) β Check Safety β Execute β Stream Telemetry. -
backend/app/model_client.py: The Ollama HTTP client handling system prompting, few-shot conditioning, and structured Pydantic action extraction. -
backend/app/observer.py: Playwright-based DOM inspector converting raw webpages into compact, token-efficient summaries. -
backend/app/executor.py: Browser controller with auto-recovery, element scrolling, typing, and click stabilization. -
backend/app/safety.py: Security engine containing regex-based indirect prompt-injection detection and keyword-based action gates. -
frontend/app.py: Interactive Streamlit application providing real-time status badges, action timelines with redacted credentials, and an isolated model testing playground. -
mock-site/: Built-in benchmark testbed simulating enterprise invoicing, profile settings, and adversarial prompt-injection attack vectors.
π οΈ Technology Stack
| Layer | Technologies |
|---|---|
| Language & Runtime | Python 3.11 / 3.13, asyncio |
| API Framework | FastAPI, Uvicorn, WebSockets, Starlette |
| Data Validation | Pydantic v2 |
| Browser Engine | Playwright (Async Python API), Chromium |
| LLM Runtime | Ollama, Google Gemma 3 (4B) / Gemma 4 |
| Frontends | Streamlit, HTML5, Vanilla JavaScript, CSS3 |
| Testing | Pytest, Pytest-Asyncio (100% pass rate across 66 unit/integration tests) |
π¬ Real-World Use Cases & Demonstrations
-
Enterprise Back-Office Automation:
- Searching complex accounting tables, filtering for specific invoices (
INV-1001), and verifying balances in nested modal dialogues.
- Searching complex accounting tables, filtering for specific invoices (
-
Administrative Profile & Settings Management:
- Navigating multi-page dashboards, updating form inputs (e.g. usernames, preferences), submitting forms, and confirming visual toast notifications.
-
Security Auditing & Adversarial Defense:
- Navigating to untrusted user-generated web content and detecting hidden prompt-injection attacks (
"Ignore previous instructions...") before the LLM can be manipulated.
- Navigating to untrusted user-generated web content and detecting hidden prompt-injection attacks (
-
Safeguarded Operations:
- Intercepting dangerous user or model actions (e.g. clicking buttons labeled
purge-databaseordelete-account) and halting execution for Human-in-the-Loop review.
- Intercepting dangerous user or model actions (e.g. clicking buttons labeled
Built with
gemmaollama
AI tools
Coded withAntigravityCodexGemini 3.8 FlashGPT-6 Luna
Prize Categories Entered
- Submitted
Best Use of Gemma 4