browser-control AGENTS.md

Repository instructions for keon/browser-control, a small command-line tool for controlling a web browser and inspecting its pages.

In plain words
What is it for?
Use them to guide browser launch, navigation, inspection, clicking, typing, scrolling, keyboard shortcuts, screenshots, and debugging through browser-control.
Why use it?
They define a reliable order for observing pages and acting on them, which reduces mistakes when buttons, fields, or scrollable areas appear dynamically. They also list commands for screenshots, network activity, console output, and browser events.

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/keon/browser-control/agents-md
Clone the repo
git clone --depth 1 https://github.com/keon/browser-control

Made for: Codex, OpenCode.

Per session 484 This file is loaded in full into every session.
When invoked 484 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.00484 $0.00484
Opus 5 $0.00242 $0.00242
Sonnet 5 $0.00097 $0.00097
Haiku 4.5 $0.00048 $0.00048

Measured 2d ago against content hash f193bb0318af, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

browser-control 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 2d ago.

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 · 45 lines

What it actually says

browser-control agent guide

Use this project as a tiny browser pipe, not an agent framework.

Quick loop:

browser-control launch about:blank
export BROWSER_CONTROL_CDP_URL=http://127.0.0.1:9222
browser-control open https://example.com
browser-control inspect    # compact title/url/text/headings/actions/links
browser-control snapshot   # observe also works
browser-control click @e1
browser-control eval 'document.title'
browser-control events
browser-control network
browser-control console
browser-control cdp Browser.getVersion

Rules:

  • Use snapshot before ref actions.
  • Use inspect first when you need compact page text + candidate links/actions.
  • Use refs for simple actions, selectors/coordinates when needed.
  • Use --wait N on click/fill for late-rendered elements; wait-element for explicit polling.
  • Use press ctrl+a / press cmd+shift+t style combos; editing combos (select-all/copy/paste/undo) work headless and on macOS.
  • Use scroll --at x,y for inner scrollable containers; plain scroll for the window.
  • Use screenshot --full for full-page captures; click --clicks 2 / --button right for double/context clicks.
  • page-info reports a pending {dialog} instead of hanging; clear it with dialog accept|dismiss.
  • eval accepts top-level return (auto-wrapped in an IIFE).
  • Use eval or cdp as the raw escape hatch.
  • Use events, network, and console when diagnosing flaky waits/pages.
  • Use --frame <target-id|url-substring> on eval, click, or fill for OOPIF/frame targets.
  • Put reusable scripts in .browser-control/scripts.
  • Verify with text, eval, screenshot, or raw CDP before saying done.
  • Check .browser-control/traces/* after failures.
  • Short env aliases BU_CDP_WS and BU_CDP_URL are accepted.

Lifecycle:

browser-control stop     # stop browser launched by browser-control
browser-control reload   # same minimal lifecycle reset
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. 2d ago First seen · 45 lines · 484 tokens per session scan A f193bb0318af

Subscribe to this mod's changes

browser-control AGENTS.md is an instructions file published in the GitHub repository keon/browser-control (3,135 stars, last pushed 5d ago), licensed MIT. It adds 484 tokens to every session, about $0.0024 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.