ego-lite AGENTS.md

Repository instructions for ego-lite, a project that lets AI agents control a real browser through a Node.js automation runtime. They describe the project structure, startup paths, and how browser actions flow through the code.

In plain words
What is it for?
Use them when developing or debugging the browser runtime, its command-line interface, its embedded version, or the shared helper functions agents use.
Why use it?
They make it easier to change the correct part of the browser harness and avoid confusing the open-source harness with the separate ego lite browser application.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/citrolabs/ego-lite/agents-md
Clone the repo
git clone --depth 1 https://github.com/citrolabs/ego-lite

Made for: Codex, OpenCode.

Per session 1,577 This file is loaded in full into every session.
When invoked 1,577 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01577 $0.01577
Opus 5 $0.00788 $0.00788
Sonnet 5 $0.00315 $0.00315
Haiku 4.5 $0.00158 $0.00158

Measured yesterday against content hash 73d8d7a1d03e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ego-lite AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repository Guidelines

Project Overview

ego-browser is a Node.js CDP browser-automation harness for AI agents. It drives the ego lite browser through globalThis.ego bindings (provided by the closed-source ego lite app), exposes a compact snapshot/ref workflow, and layers reusable site-specific knowledge ("learnings") on top of the browser runtime.

This repo contains the open-source harness and the agent skill package — not the browser itself. The ego lite app bundles its own ego-browser binary that embeds this runtime; skills/ego-browser/SKILL.md documents that binary's usage (ego-browser nodejs <<'EOF' ... EOF). The repo CLI built here takes the heredoc directly on stdin with no subcommand.

Architecture & Data Flow

  • package/ego-browser/src/index.ts is the entrypoint with two startup paths:
    • Executed directly as a CLI → runMain() (reads JavaScript from stdin, executes it).
    • Imported as a module (how the app embeds it) → installEgoSdk(globalThis).
  • Both paths expose the same helper surface, built by helperContext() in src/helpers.ts — the single source of truth for what agents can call (including help() and agent_helpers.js extensions).
  • src/run.ts executes stdin JavaScript inside an async function with the helpers injected as parameters.
  • src/browser-runtime.ts owns CDP transport over ego.sendCDPMessage, session attach/caching (2s TTL, auto re-attach on session loss), the buffered event queue (10k cap), and JS dialog tracking.
  • src/cdp-eval.ts provides cdp() and js() (string-expression evaluation; top-level return is auto-wrapped in an IIFE).
  • src/element-resolver.ts resolves all target forms — @N refs, loc=css: / loc=role: / loc=href: locators, xpath=, raw CSS — and classifies failures as transient (retryable) or permanent.
  • src/ref-map.ts + src/ref-state.ts: refs are numeric backendNodeIds (@21, not @e21). The map is rebuilt on every snapshot; using a ref while the map is empty triggers an automatic re-snapshot, which is what makes refs work across heredoc rounds.
  • src/driver/nav (tabs, navigation), pointer (click/scroll/drag), keyboard, observe (snapshot/screenshot), waits, files (upload), element-ops (objectId handles), load.
  • src/learning/ — discovery, validation, and execution of site skills from skills/ego-browser/learnings/<site>/manifest.json (runSiteTool, runSiteBrowserTool, learnContext).
  • src/state.ts is the shared mutable runtime state singleton; src/env.ts resolves the agent workspace (EGO_BROWSER_AGENT_WORKSPACE, falling back to the skill dir bundled next to the build output, then the repo's skills/ego-browser).
  • src/help-runtime.ts parses the built bundle's JSDoc with acorn at runtime to power help() — JSDoc on exported helpers is therefore user-facing documentation.

Read the full file on GitHub · 61 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 61 lines · 1,577 tokens per session scan A 73d8d7a1d03e

Subscribe to this mod's changes

ego-lite AGENTS.md is an instructions file published in the GitHub repository citrolabs/ego-lite (14,365 stars, last pushed 2d ago), licensed MIT. It adds 1,577 tokens to every session, about $0.0079 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.