Skip to main content

Privacy-first self-healing agent for Playwright tests. AI-powered, 100% local, zero data exposure.

Project description

Healix

PyPI version Python License: MIT CI

Healix is a privacy-first, self-healing web automation agent. It fixes broken Playwright selectors using AI — and everything runs 100% on your machine. No data ever leaves your device.

Built for teams in healthcare, fintech, government, and enterprise where sending DOM data to cloud APIs is not an option.

The Problem

Web automation is fragile. Selectors break when:

  • Developers change class names
  • DOM structure shifts
  • Content loads dynamically
  • A/B tests alter page layouts

Why Healix?

  • Zero data exposure — AI runs locally via Ollama. No API keys, no cloud, no telemetry. Your DOM never leaves localhost
  • Compliance ready — Safe for HIPAA, SOC 2, PCI-DSS, and air-gapped environments
  • Zero config — Drop-in replacement for flaky selectors, no test rewrites needed
  • Browser-aware — Separate caching per browser engine (Chromium, Firefox, WebKit)
  • Learns over time — Caches successful fixes for instant replay on subsequent runs
  • Transparent — Logs every decision with confidence scores and reasoning

The Solution

Healix uses an agentic loop to automatically detect and fix selector failures:

  1. Observe — Analyze the current page state and DOM
  2. Reason — Use AI to determine the correct selector/action
  3. Act — Execute the corrected action
  4. Verify — Confirm the action succeeded
  5. Learn — Cache successful fixes for future use

Operational Workflow

                        Test Failure Detected
                                |
                          Check Cache
                         /          \
                      Hit            Miss
                       |               |
               Apply Cached       DOM Scrubbing
                 Selector        & Minification
                       |               |
                Re-run Test       Query Ollama
                 /       \        (Local LLM)
            Success     Fail          |
               |          \    Confidence Scoring
               |           \      /          \
               |            \  High          Low
               |             \  |             |
               |          Re-run with     Manual Review
               |           AI Fix          Required
               |           /    \             |
               |       Success  Fail          |
               |          |       |           |
               |    Update Cache  |           |
               |          |       |           |
                \         |      /           /
                 \        |     /           /
              Healing  ----+----    -------
             Successful    |
                           |
                  Log Code Proposal
                           |
                    Action Complete

Architecture

healix/
├── .github/workflows/
│   └── ci.yml                 # CI: tests on Python 3.9/3.11/3.12
├── src/healix/
│   ├── __init__.py            # Public API (smart_click, Healix)
│   ├── engine.py              # Core self-healing logic
│   └── utilities/
│       └── dom_scrubber.py    # DOM cleaning helpers
├── tests/
│   ├── integration/
│   │   └── test_login.py      # Live browser healing demo
│   └── unit/
│       └── test_engine.py     # 18 unit tests (no Ollama needed)
├── CHANGELOG.md               # Version history
├── LICENSE                    # MIT
├── pyproject.toml             # Package config & dependencies
└── README.md

~/.healix/                     # Runtime data (created automatically)
├── cache.json                 # Persistent selector cache
└── proposals.json             # Logged code fix suggestions

Prerequisites

  • Python 3.9 or higher
  • Ollama running locally — Install Ollama, then:
    ollama serve
    ollama pull qwen2.5-coder:7b
    

Installation

pip install healix-ai

Or install from source:

git clone https://github.com/kunaal-ai/healix.git
cd healix
pip install -e .

Make sure to install Playwright browsers:

playwright install chromium

Quick Start

import asyncio
from playwright.async_api import async_playwright
from healix import smart_click

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()

        await page.goto("https://the-internet.herokuapp.com/login")

        # These selectors are intentionally wrong — Healix will heal them
        await smart_click(page, "input#wrong-id", text_to_fill="tomsmith")
        await smart_click(page, "input[name='bad_field']", text_to_fill="SuperSecretPassword!")
        await smart_click(page, "button.does-not-exist")

        print("Login healed!" if await page.locator(".flash.success").is_visible() else "Failed")
        await browser.close()

if __name__ == "__main__":
    asyncio.run(main())

How It Works

DOM Cleaning & Privacy

  • Strips scripts, styles, and heavy elements to save tokens
  • Focuses on actionable elements (buttons, links, inputs)
  • All processing happens in-memory on your machine

AI-Powered Reasoning

  • Uses local LLM (Ollama) for selector analysis — no external API calls
  • Considers both technical errors and visible page state
  • Returns confidence scores and explanations

Persistent Learning

  • Caches successful fixes in ~/.healix/cache.json
  • Gets faster over time as it learns common patterns
  • Maintains context across test runs

Privacy & Security

Healix was designed from the ground up for zero-data-exposure environments:

What Where it runs Data leaves device?
AI inference (Ollama) localhost:11434 No
DOM analysis In-process Python No
Selector cache ~/.healix/ No
Browser automation Local Playwright No
  • No cloud APIs — The LLM runs entirely on your hardware via Ollama
  • No telemetry — Healix collects zero analytics or usage data
  • No network calls — The only outbound traffic is your test navigating to its target URL
  • No API keys — Nothing to configure, nothing to leak

This makes Healix safe for:

  • Healthcare (HIPAA) — Patient portals, EHR systems
  • Finance (SOC 2, PCI-DSS) — Banking apps, payment flows
  • Government (FedRAMP) — Internal tools, classified environments
  • Enterprise — Any org that prohibits sending DOM/HTML to third-party APIs

Configuration

Healix uses Ollama for local AI inference:

from healix import Healix

# Default model: qwen2.5-coder:7b
healix = Healix(model="your-preferred-model")

Make sure Ollama is running:

ollama serve

Testing

# Run all tests
pytest tests/

# Run with coverage
pytest tests/ --cov=src/healix --cov-report=html

# Run integration tests (requires browser)
pytest tests/integration/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

This project is licensed under the MIT License.

Known Limitations

  • Requires Ollama running locally (cloud LLM support planned)
  • Healing accuracy depends on DOM quality — heavily obfuscated pages may need multiple retries
  • First-time healing adds latency (~2-5s per selector); cached fixes are instant
  • Currently supports click and fill actions; other Playwright actions coming soon

Support

Roadmap

  • Support for more AI models (OpenAI, Anthropic)
  • Visual regression testing
  • Multi-browser support expansion
  • Performance optimization for large-scale testing
  • Plugin system for custom healing strategies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

healix_ai-0.1.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

healix_ai-0.1.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file healix_ai-0.1.3.tar.gz.

File metadata

  • Download URL: healix_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for healix_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 593316756fffb683bddd334396c1f2f3064b2add89d427e9e8e04d074ef95afb
MD5 77cc770630b93cb3977551e31824a1f6
BLAKE2b-256 4a079561a386169209f4a75eda28c354bd40890bfe5a3bc45ed45849d5ec8a5a

See more details on using hashes here.

File details

Details for the file healix_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: healix_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for healix_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4a268f336ef4fcc3d838149252eeb51b0186c450d885fe61c6809c4029507686
MD5 0feea4a082e34d469e27dc1950979ad4
BLAKE2b-256 529835b113aceaaa227e97cd43767084b0ea8ffc96d5ff23611f3dce1e177aa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page