codex-browser-bridge AGENTS.md

codex-browser-bridge AGENTS.md is an instructions file for Codex, OpenCode from DeliciousBuding/codex-browser-bridge. It costs 1,730 tokens per session, scanned A, original, MIT.

Repository instructions for building a browser-control service in Rust with MCP tools. MCP is a standard way for an AI agent to call tools exposed by another program.

In plain words
What is it for?
Use them when adding or changing browser operations, registering MCP tools, updating tool profiles, validating paths or URLs, and writing the required tests.
Why use it?
They give contributors a consistent place to add browser actions, tool definitions, security checks, diagnostics, and tests. They also reduce risks such as unsafe URLs and file-path traversal.

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

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-browser-bridge AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/deliciousbuding/codex-browser-bridge/agents-md.svg)](https://agentmods.dev/instructions/deliciousbuding/codex-browser-bridge/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/deliciousbuding/codex-browser-bridge/agents-md"><img src="https://agentmods.dev/badge/instructions/deliciousbuding/codex-browser-bridge/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,730 This file is loaded in full into every session.
When invoked 1,730 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.01730 $0.01730
Opus 5 $0.00865 $0.00865
Sonnet 5 $0.00346 $0.00346
Haiku 4.5 $0.00173 $0.00173

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

Security

Grade A, and why

codex-browser-bridge 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 3d 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 · 109 lines

How it starts

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

AGENTS.md

禁止提交 .env、凭据、私钥。提交前 git diff --staged 自查。

仓库级 Skill

本仓库包含项目级 skill:skills/codex-browser/SKILL.md

该 skill 是 LLM agent 使用全部 52 个 MCP 工具的操作手册,包含工具分组速查、常用工作流、工具选择原则。支持项目级 skill 的 MCP 客户端会自动加载。

MCP 工具设计规范

新增 MCP 工具遵循以下模式:

1. Browser 层(src/browser.rs

  • 每个 CDP 操作封装为一个 pub async fn,接受 &Client + 参数
  • CDP 响应解析用私有函数,返回 Result<T>
  • 使用 #[derive(Deserialize)] 私有结构体解析 CDP 响应
  • execute_cdp_generic() 是显式低风险方法 allowlist 的 raw CDP 入口;不要用域名前缀放宽,高风险能力必须走专用受控工具

2. MCP 层(src/mcp/ 目录)

  • types.rsToolHandler 枚举新增 variant(当前 52 个工具)
  • handlers.rshandle_tool_call 新增 match arm + handle_* 方法
  • schema.rsregistered_tools() 新增工具定义
  • profiles.rs:如需加入 profile,更新 BASIC_TOOLS / NETWORK_TOOLS 数组

3. 安全层(src/security.rs

  • 新增文件操作需经过 validate_file_path() 路径穿越防护
  • 新增 URL 参数需经过 validate_url() scheme 检查

4. 诊断(src/doctor.rs

  • run_diagnostics() — 独立于 MCP Server 的 pipe 探活逻辑

5. 测试

  • Extractor 测试src/mcp/types.rs):required_strrequired_string_vec
  • Schema 测试src/mcp/schema.rs):验证工具 required 字段、name order、type=object
  • 集成测试tests/browser_api.rs):公开 browser/helper 行为与安全边界
  • Reconnect/mock 测试src/client.rscfg(not(windows))):tokio::io::duplex() mock pipe
  • Harness 计划:新的真实/模拟 E2E 应放在 tests/,不要使用 #[path] 嵌入源码文件
  • Mock pipe / E2E harness 等待必须 bounded:正向 pipe read 和 spawned task join 用明确 timeout,负向“不得发 pipe 请求”断言用短 grace window;live E2E 的 doctor preflight 和 cleanup MCP 调用也必须有 timeout。

6. 工具数量

  • 当前:52 个 MCP 工具
  • 新增工具命名:codex_<domain>_<action>,group tag 放描述开头

构建

cargo check --locked              # 快速检查
cargo test --locked                # 全量测试
cargo clippy --locked -- -D warnings  # lint
cargo build --locked --release     # 发布构建 → target/release/codex-browser-bridge.exe
npm --prefix npm test              # npm installer/package helper 测试
.\scripts\live-e2e.ps1             # 可选真实 Codex Desktop + Chrome 冒烟测试

Release 时遵循 docs/release-process.md:确保 Cargo.tomlnpm/package.json 版本号与 tag 一致,CHANGELOG.md 有对应段,npm 包 dry-run 包含 skills/codex-browser/SKILL.mdexamples/ 多客户端模板。npm 发布走 Trusted Publishing/OIDC,不在 GitHub secrets 中放 npm write token。

Read the full file on GitHub · 109 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. 3d ago First seen · 109 lines · 1,730 tokens per session scan A 8c2bd9c7523d

Subscribe to this mod's changes

codex-browser-bridge AGENTS.md is an instructions file published in the GitHub repository DeliciousBuding/codex-browser-bridge (15 stars, last pushed 15d ago), licensed MIT. It adds 1,730 tokens to every session, about $0.0086 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.