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.
npx agentmods add instructions/platonai/browser4/agents-mdgit clone --depth 1 https://github.com/platonai/Browser4What 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04778 | $0.04778 |
| Opus 5 | $0.02389 | $0.02389 |
| Sonnet 5 | $0.00956 | $0.00956 |
| Haiku 4.5 | $0.00478 | $0.00478 |
Grade B, and why
Browser4 AGENTS.md scanned grade B with 1 finding 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
| `.ps1` scripts don't run on Linux | `sudo apt-get install -y powershell`, then `pwsh script.ps1` | How it starts
The opening of the file, as written. The whole thing — 380 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository Guidelines
Repo: https://github.com/platonai/Browser4
Architecture
browser4-cli (Rust) ──MCP over HTTP──▶ browser4-rest (Kotlin/Spring) ──▶ PulsarWebDriver (Kotlin/CDP)
▲ │
│ ▼
└──── e2e tests ────▶ Fixture HTTP server (Rust test harness)
- CLI:
cli/browser4-cli/— Rust binary, MCP tool calls over HTTP - Backend:
browser4-rest/— Spring Boot,MCPToolControllerdispatches tools - Browser driver:
browser4-core/browser4-browser/—PulsarWebDriverwraps CDP - Agent tools:
browser4-agentic/—AgentToolManagermaps MCP tool names → driver methods
Dispatch chain (CLI → browser)
- CLI builds MCP tool call:
{tool: "browser_type", arguments: {ref: "#el", text: "hi"}} MCPToolController.callTool()→dispatchToToolExecutor()normalizeFrontendToolCall()appliesFRONTEND_TOOL_NAME_ALIASES(e.g.,browser_type→fill)DefaultArgumentNormalizermapsref→selector, stripssessionId, converts snake_caseresolveMcpToolCall()→ToolCall("tab", "fill", args)AgentToolManager.execute()→executor.callFunctionOn(toolCall, driver)→PulsarWebDriver.fill()
Batch commands
handleCommandBatch() → handleBatchTool() in MCPToolController. CLI's compile_batch_request() builds step arrays with op: "tool". preFocusSelector only added for keydown/keyup (not fill/type/press).
Known CDP pitfalls
- crbug.com/444929150:
Input.dispatchMouseEventtypemouseWheelrace condition in headless Chrome. Fix: dispatch to{passive: false}wheel listener. - Cursor positioning:
DOM.focus()+Input.dispatchMouseEvent(click) may leave cursor at 0. Fix:setSelectionRange(99999, 99999)after focus+click. Input.insertTextracing: 0ms delay between chars dropsinputevents. Fix: use same inter-char delay astype()viarandomDelayMillis("type")(90-240ms).
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.
- yesterday First seen · 380 lines · 4,778 tokens per session scan B 9d2ad598b116
Browser4 AGENTS.md is an instructions file published in the GitHub repository platonai/Browser4 (1,114 stars, last pushed 2d ago), licensed Apache-2.0. It adds 4,778 tokens to every session, about $0.0239 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
eric-task-master AGENTS.md
AGENTS.md instructions for npcworkspace-cmyk/eric-task-master: Read ARCHITECTURE.md before changing code.
comet-mcp CLAUDE.md
Instructions for hanzili/comet-mcp, covering claude.md, what this is, architecture, 6 tools and key implementation details.
intelligent-terminal rust.instructions.md
Concise Rust coding conventions for this repository.
crystal CLAUDE.md
Instructions for stravu/crystal, covering crystal - multi-session claude code manager, project overview, references, implementation status: ✅ complete and ✅ implemented features.
agent-ship CLAUDE.md
Instructions for Agent-Ship/agent-ship, covering claude.md, project overview, commands, docker development (recommended) and local development (no docker).
clawock AGENTS.md
Instructions for KCNyu/clawock, covering agents.md - your workspace, every session, kcn 偏好, git hook (one-time setup per clone) and git auto-commit rules.