πŸ†• AegisGate Lens v0.1.4 is LIVE β€” CWS approved 2026-07-13, released the same day. This page documents the v0.1.4 architecture (the v0.1.0-beta baseline + 35 polish commits).



title: “AegisGate Lens β€” Architecture” description: “How AegisGate Lens works: 4-facet regex detection, Ed25519-signed bundle, Apache 2.0. The full technical architecture of v0.1.4.” type: “docs” weight: 2

πŸ›‘οΈ AegisGate Lens v0.1.4canonical facts (source: docs/FACTS.md)
  • 8 AI providers: ChatGPT, Claude, Gemini, Copilot, DuckDuckGo, Perplexity, Mistral, Grok
  • 132 regex patterns across 4 detection facets: PII, secrets, XSS, compliance
  • 647 automated tests: 500/500 Node + 3/3 Go + 16/16 headless smoke + 128/128 mini-smoke (5/5 stable runs)
  • 2.31% FPR on 6,500 WildChat prompts (5.1x better than v0.1.0-beta baseline)
  • Sub-millisecond detection (p50 0.076ms, p95 0.085ms, p99 0.14ms for 500-char prompts)
  • 100% on-device, zero network egress by default
  • 12 privacy non-negotiables, Apache 2.0, zero external dependencies
  • Free, forever

AegisGate Lens β€” Architecture

The full source code is on GitHub (Apache 2.0). This page summarizes the architecture of v0.1.4.

4-Facet Detection System

Lens runs 4 active detection facets in parallel on every prompt you type. v0.2.0 will expand the compliance facet (more frameworks: HIPAA, PCI, FedRAMP, FIPS 140-3) β€” the ML-based facets (Toxicity, Prompt-Injection ML) were evaluated and deferred, see the AegisGate v0.2.0 work plan.

FacetWhat it catchesExample
PIIEmail, phone, SSN, credit card, bank account, DOB, address, driver’s license, passport, tax ID, IP address (55 patterns)john.doe@example.com, 4111-1111-1111-1111
SecretsAPI keys (AWS, GitHub, OpenAI, Stripe, Slack), OAuth tokens, database credentials, RSA private keys (41 patterns)ghp_abc123..., AKIA..., -----BEGIN RSA PRIVATE KEY-----
XSSCross-site scripting payloads (12 patterns)<script>alert(1)</script>
ComplianceOWASP LLM Top 10 (5/10 implemented), MITRE ATLAS, EU AI Act, NIST CSF, ISO 27001, CCPA, LGPD, PIPEDA, POPIA (24 patterns)“patient SSN:”, “credit card:”

All 4 facets use regex patterns (fast, synchronous, on-device). No ML model. No heuristics. No inference latency. The detection is deterministic and auditable.

Why Regex (not ML)?

v0.1.4 is intentionally regex-only. The rationale (from the v0.1.3 baseline; v0.1.4 keeps the same approach):

  • Privacy: regex is auditable. A model is a black box.
  • Size: a TinyML model would add 1-2MB to the extension. Regex is 132 patterns = ~50KB.
  • Latency: regex detects in <1ms. A model would need 50-100ms.
  • Determinism: regex produces the same result every time. A model can drift.
  • No training data: regex patterns are hand-curated. No need for training corpus.
  • FPR: with the v0.1.4 postProcess tightening, FPR on 6,500 WildChat prompts is 2.31% β€” comparable to or better than ML approaches.

A TinyML model (1-2MB transformer) was planned for v0.2.0 to add the 2 missing facets (Toxicity, Prompt-Injection) and improve FPR on edge cases. After the v0.2.0 evaluation, the ML approach was deferred (6 model families failed to meet the ship gate β€” see Lesson #99 and the v0.2.0 work plan). The v0.1.4 approach remains regex-only; v0.2.0 will instead expand the compliance facet (more frameworks).

Architecture Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Provider (ChatGPT, Claude, Gemini, ...)          β”‚
β”‚  (DOM content, user input, AI output)                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↑↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Lens Content Script (MV3, injected into page)       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Event Listener (input, keyup, paste)        β”‚   β”‚
β”‚  β”‚  ↓                                            β”‚   β”‚
β”‚  β”‚  Debounced Detection (250ms throttle)         β”‚   β”‚
β”‚  β”‚  ↓                                            β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚
β”‚  β”‚  β”‚  4-Facet Detection (parallel)        β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  All regex patterns                   β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  - PII (55)                           β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  - Secrets (41)                       β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  - XSS (12)                            β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  - Compliance (24)                     β”‚    β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚
β”‚  β”‚  ↓                                            β”‚   β”‚
β”‚  β”‚  PostProcess (FP rejection):                  β”‚   β”‚
β”‚  β”‚  - Luhn validation for credit cards          β”‚   β”‚
β”‚  β”‚  - 4-4-4 CC pattern rejection                 β”‚   β”‚
β”‚  β”‚  - ID-label context for ID-shaped patterns    β”‚   β”‚
β”‚  β”‚  ↓                                            β”‚   β”‚
β”‚  β”‚  UI Update (non-blocking banner)             β”‚   β”‚
β”‚  β”‚  - Show severity color                        β”‚   β”‚
β”‚  β”‚  - Show rewritten text                        β”‚   β”‚
β”‚  β”‚  - Show "Send anyway / Edit / Cancel"        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↑↓
                  (optional Tier 1 opt-in)
                  Hashed metadata only
                  NEVER prompt text
                          ↑↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  (Optional) AegisGate Platform Backend             β”‚
β”‚  - Hashed FP report aggregation                     β”‚
β”‚  - Team-wide policy (Enterprise)                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Detection Latency

Prompt lengthDetection time
Any length (regex only)<1ms (typical: 0.3-0.5ms)
Worst case (10K+ chars)~2ms

All detection is synchronous β€” the user gets the result before they can send. There is no async ML inference.

Ed25519 Commit Signing

All commits to the AegisGate Lens repository are signed with Ed25519 SSH keys (per GitHub’s signing docs). The Chrome extension .zip is built by GitHub Actions and distributed via the Chrome Web Store, which verifies the package on install.

To verify commits locally:

git log --show-signature

No Model Bundles (v0.1.4)

v0.1.4 is regex-only. There are no model bundles, no ML inference, no inference timeouts.

This means:

  • No bundle signing is needed (no bundles to sign)
  • No SLSA L2 provenance is needed (no bundles to attest)
  • No Sigstore/Rekor integration is needed (no artifacts to log)
  • No key ring is needed (no keys to manage)

If v0.2.0 adds a TinyML model (planned), the bundle signing and provenance flow will be added at that time and documented here.

Release Process

  1. Commits are signed with Ed25519 SSH keys
  2. The build runs in GitHub Actions on every push to the v0.1.x branches
  3. The build produces the .zip file and uploads it as a CI artifact
  4. The .zip is submitted to the Chrome Web Store dashboard
  5. Chrome Web Store verifies the package and distributes it to users

Zero External Dependencies

Lens has zero external dependencies. All code is in plain JavaScript. No npm, no node_modules, no bundled libraries.

This is a privacy feature, not just a code-quality feature: there are no third-party libraries that could be compromised and exfiltrate data.

File Structure

aegisgate-lens/
β”œβ”€β”€ src/                        # Canonical source
β”‚   β”œβ”€β”€ api/                    # Optional backend client
β”‚   β”œβ”€β”€ content.js              # Content script (entry point)
β”‚   β”œβ”€β”€ background.js           # MV3 service worker
β”‚   β”œβ”€β”€ popup/                  # Browser action popup
β”‚   β”‚   β”œβ”€β”€ popup.html
β”‚   β”‚   └── popup.js
β”‚   β”œβ”€β”€ welcome/                # First-install welcome page
β”‚   β”‚   β”œβ”€β”€ welcome.html
β”‚   β”‚   β”œβ”€β”€ welcome.js
β”‚   β”‚   └── fonts/              # Bundled Inter font (OFL)
β”‚   β”œβ”€β”€ detectors/              # 4-facet detection
β”‚   β”‚   β”œβ”€β”€ regex/              # Regex pattern files
β”‚   β”‚   β”‚   β”œβ”€β”€ pii.js          # Aggregator (loads 4 sub-files)
β”‚   β”‚   β”‚   β”œβ”€β”€ pii-us-core.js
β”‚   β”‚   β”‚   β”œβ”€β”€ pii-us-extended.js
β”‚   β”‚   β”‚   β”œβ”€β”€ pii-international-id.js
β”‚   β”‚   β”‚   β”œβ”€β”€ pii-financial.js
β”‚   β”‚   β”‚   β”œβ”€β”€ secrets.js
β”‚   β”‚   β”‚   β”œβ”€β”€ source_xss.js
β”‚   β”‚   β”‚   └── compliance.js
β”‚   β”‚   β”œβ”€β”€ luhn.js             # Credit card Luhn validation
β”‚   β”‚   └── index.js            # Detector orchestrator
β”‚   β”œβ”€β”€ privacy/                # Privacy + schema
β”‚   β”‚   β”œβ”€β”€ schema.js           # Event schema validator
β”‚   β”‚   └── domain_hash.js      # SHA-256 domain hashing
β”‚   β”œβ”€β”€ util/                   # Banner UI, dismiss logic, etc.
β”‚   β”‚   β”œβ”€β”€ banner-ui.js        # Aggregator
β”‚   β”‚   β”œβ”€β”€ banner-ui-html.js
β”‚   β”‚   β”œβ”€β”€ banner-ui-lifecycle.js
β”‚   β”‚   β”œβ”€β”€ banner-ui-formatters.js
β”‚   β”‚   β”œβ”€β”€ banner.css
β”‚   β”‚   β”œβ”€β”€ banner-icons.js
β”‚   β”‚   β”œβ”€β”€ dismiss.js
β”‚   β”‚   β”œβ”€β”€ prompt-detect.js    # Orchestrator
β”‚   β”‚   β”œβ”€β”€ prompt-detect-dom.js
β”‚   β”‚   β”œβ”€β”€ prompt-detect-lifecycle.js
β”‚   β”‚   β”œβ”€β”€ selectors.js        # Provider host detection
β”‚   β”‚   β”œβ”€β”€ constants.js        # Storage keys, TTLs, etc.
β”‚   β”‚   β”œβ”€β”€ typedefs.js
β”‚   β”‚   └── logger.js
β”‚   └── manifest.json           # MV3 manifest
β”œβ”€β”€ test/                       # 500/500 Node tests + 3/3 Go tests + 16/16 smoke + 128/128 mini-smoke
β”‚   β”œβ”€β”€ unit/                   # 18 test files
β”‚   β”œβ”€β”€ helpers/                # Mock chrome, load-module
β”‚   β”œβ”€β”€ headless-smoke/         # 16/16 real-browser integration
β”‚   └── e2e/                    # empty (v0.2.0 scope)
β”œβ”€β”€ docs/                       # Public documentation
β”‚   β”œβ”€β”€ ARCHITECTURE-v0.1.0-BETA.md
β”‚   β”œβ”€β”€ METRICS-v0.1.2.md
β”‚   β”œβ”€β”€ MODEL-CARD.md
β”‚   β”œβ”€β”€ API.md
β”‚   β”œβ”€β”€ SECURITY.md
β”‚   β”œβ”€β”€ THREAT-MODEL.md
β”‚   β”œβ”€β”€ A11Y-AUDIT-v0.1.4.md
β”‚   β”œβ”€β”€ PRODUCT-SUMMARY.md
β”‚   └── CHANGELOG.md
β”œβ”€β”€ .plans/                     # Internal planning (gitignored)
β”‚   β”œβ”€β”€ AEGISGATE-LENS-STANDING-RULES-2026-06-29.md
β”‚   β”œβ”€β”€ AEGISGATE-LENS-CHROME-STORE-LISTING.md
β”‚   β”œβ”€β”€ todo-v0.1.4.md
β”‚   └── v0.2-burndown/          # v0.2.0 research artifacts (gitignored)
└── README.md

Test Coverage

  • 500/500 Node tests pass (using node:test from Node 20+ stdlib)
  • 3/3 Go tests pass (in tools/headless-smoke/flow/)
  • 16/16 headless smoke in real Chrome (the 4 facet detectors + 16 flow cases)
  • Zero external dependencies for tests (no Jest, no Mocha)
  • Real-browser E2E tests against 8 AI provider mocks

See Also

The full source code is at github.com/aegisgatesecurity/aegisgate-lens. PRs welcome.