Skip to content
@starlight-protocol

starlight-protocol

"Resilient browser automation through autonomous Sentinel coordination"

🛰️ Starlight Protocol

Starlight Protocol

An Open Standard for Autonomous Browser Automation

Version License CI Node Python

Quick StartSpecificationBookRoadmap


What is the Starlight Protocol?

The Starlight Protocol decouples intent from environment. Your test scripts describe goals; autonomous Sentinels handle the chaos.

// Traditional: Handle EVERYTHING yourself
if (await page.$('.cookie-banner')) await page.click('.dismiss');
if (await page.$('.popup')) await page.click('.close');
await page.click('#submit');

// Starlight: Express INTENT only
await hub.send({ goal: 'Submit Form' });
// Sentinels automatically clear obstacles

🏗️ Architecture

Architecture

Component Role
Hub Central orchestrator, manages Playwright browser
JWT Handler Authentication & authorization system
Schema Validator Input validation & message verification
PII Redactor Data protection & privacy compliance
Pulse Sentinel Monitors DOM/Network stability
Janitor Sentinel Clears popups, modals, banners
Vision Sentinel AI-powered obstacle detection (Moondream)
Data Sentinel Context extraction & injection

🚀 Quick Start

Prerequisites

  • Node.js 18+ & Python 3.9+
  • Ollama (optional, for Vision)

Install

git clone https://github.com/starlight-protocol/starlight.git
cd cba
npm install
pip install -r requirements.txt
npx playwright install chromium

Run

# One command launches everything
node bin/starlight.js test/intent_portfolio_v2.js --headless

Mission Control (GUI)

node launcher/server.js
# Open http://localhost:3000

Multi-Browser Support (Phase 14.1)

# Run with Firefox
HUB_BROWSER_ENGINE=firefox node bin/starlight.js test/intent_portfolio_v2.js

# Run with WebKit (Safari engine)
HUB_BROWSER_ENGINE=webkit node bin/starlight.js test/intent_portfolio_v2.js

# Or configure in config.json:
{
  "hub": {
    "browser": { "engine": "firefox" }
  }
}

Supported Browsers:

  • Chromium (default) - Full CDP access, shadow DOM piercing
  • Firefox - Mozilla engine, standard DOM APIs
  • WebKit - Safari engine, iOS compatibility testing

Install all browsers:

npx playwright install chromium firefox webkit

Mobile Emulation (Phase 14.2)

# Run on iPhone 14 Pro Max
HUB_DEVICE="iPhone 14 Pro Max" node bin/starlight.js test/intent_saucedemo.js

# Run on Pixel 7
HUB_DEVICE="Pixel 7" node bin/starlight.js test/intent_saucedemo.js

# Or configure in config.json:
{
  "hub": {
    "device": "iPhone 14 Pro Max"
  }
}

Verified: Full 12-step SauceDemo checkout flow passes autonomously. See test/intent_saucedemo.js.


🛰️ The Protocol

All communication uses JSON-RPC 2.0:

Method Purpose
starlight.intent Issue a goal or command
starlight.pre_check Hub → Sentinels handshake
starlight.clear Sentinel approves action
starlight.wait Sentinel vetoes (retry later)
starlight.hijack Sentinel takes browser control
starlight.resume Sentinel releases control

📄 Full Specification


✨ Key Features

Feature Description
JWT Authentication Secure token-based authentication with timing-safe verification
Input Validation Comprehensive JSON schema validation for all protocol messages
PII Protection Automatic detection and redaction of sensitive data (emails, passwords, credit cards)
Self-Healing Selectors Learns alternatives when selectors fail
Animation Tolerance Handles CSS animations without blocking
No-Code Recorder Record tests by clicking through your site
Visual Sentinel Editor Create custom Sentinels without code
Shadow DOM Support Pierces web component boundaries
Webhook Alerts Slack/Teams notifications
Upload Automation Native file upload support (selector & semantic)
ROI Dashboard Quantifies time saved

🛠️ Build a Sentinel

from sdk.starlight_sdk import SentinelBase

class MySentinel(SentinelBase):
    def __init__(self):
        super().__init__("MySentinel", priority=5)
        self.selectors = [".my-obstacle"]
    
    async def on_pre_check(self, params, msg_id):
        # Your detection logic
        await self.send_clear()

if __name__ == "__main__":
    import asyncio
    asyncio.run(MySentinel().start())

🛒 Sentinel Store

Install community Sentinels or create your own:

# List installed & available
python cli/main.py list --available

# Install from registry or GitHub
python cli/main.py install cookie-consent
python cli/main.py install captcha-detector
python cli/main.py install https://github.com/user/my-sentinel

# Create new Sentinel
python cli/main.py create "Cookie Blocker"

# Use Visual Editor (no-code)
# Open Mission Control → Click "Create Sentinel"

Available Plugins:

Plugin Description
cookie-consent Auto-dismiss cookie banners and GDPR popups
captcha-detector Detect CAPTCHA and pause for manual intervention
login-session Persist login sessions across test runs

✅ Test Coverage

# Run all unit tests (100% coverage)
node test/run_all_tests.js
Component Test File Status
IntentRunner test_intent_runner.js
SentinelSDK test_sentinel_sdk.js
HubCore test_hub_core.js
BrowserAdapter test_browser_adapter.js
ShadowUtils test_shadow_utils.js
Warp test_warp.js
Telemetry test_telemetry.js
CLI test_cli.js
+ 4 more ...

📚 Documentation

Document Description
🔒 Security Guide Security architecture & best practices
📖 Book Comprehensive guide
📄 Specification Formal protocol standard
📋 User Guide Getting started
⚙️ Technical Guide SDK & configuration
🛡️ Security Configuration Security settings reference
📊 Compliance Guide GDPR/HIPAA compliance
🧪 Security Testing Security testing procedures
🗺️ Roadmap Future plans
📝 Changelog Version history

🔒 Security Features

Starlight Protocol includes enterprise-grade security features:

Authentication & Authorization

  • ✅ JWT-based authentication with HS256 signing
  • ✅ Configurable token expiration (default: 3600s)
  • ✅ Timing-safe signature verification
  • ✅ Token refresh mechanism

Input Validation & Protection

  • ✅ Comprehensive JSON schema validation for all protocol messages
  • ✅ Field type checking, pattern matching, and length limits
  • ✅ CSS selector injection prevention
  • ✅ XSS protection with HTML escaping

Data Protection & Privacy

  • ✅ Automatic PII detection and redaction
  • ✅ AES-256-GCM encryption for sensitive data
  • ✅ Secure logging with automatic PII redaction
  • ✅ Compliance modes: alert, block, or redact

Security Configuration

{
    "security": {
        "jwtSecret": "your-secret-key",
        "tokenExpiry": 3600,
        "piiRedaction": true,
        "ssl": {
            "enabled": false,
            "keyPath": null,
            "certPath": null
        }
    }
}

📄 Security Guide - Complete security documentation


🐳 Docker

docker-compose up --build

📖 Blog Series


📄 License

MIT License - LICENSE


"Don't look at the ground; look at the Starlight."

Built with ❤️ by Dhiraj Das

Popular repositories Loading

  1. starlight starlight Public

    constellation based automation

    JavaScript 1

  2. .github .github Public

Repositories

Showing 2 of 2 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…