codex-browser-bridge: Instructions file for Codex

AGENTS.md

codex-browser-bridge AGENTS.md is an instructions file for Codex, OpenCode from DeliciousBuding/codex-browser-bridge. It costs 2,159 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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions .claude-plugin; mentions Claude Code; mentions AGENTS.md.

This is DeliciousBuding/codex-browser-bridge's own configuration. It tells Codex and OpenCode how to work on codex-browser-bridge itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything codex-browser-bridge configures →

Reuse

Borrowing it

Nothing to install: this file belongs to DeliciousBuding/codex-browser-bridge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/DeliciousBuding/codex-browser-bridge/main/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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codex-browser-bridge AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,159 This file is loaded in full into every session.
When invoked 2,159 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02159 $0.02159
Opus 5.5 $0.00864 $0.00864
Sonnet 5.5 $0.00432 $0.00432
Haiku 4.5 $0.00216 $0.00216

Measured 12d ago against content hash 7df1596777a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 12d 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 · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 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 bundle:skills/codex-browser/SKILL.md + references/

SKILL.md 只负责路由和工作流,任务细节按需读取一个 reference。支持项目级 skill 的客户端会自动发现;Claude Code 可通过仓库内 marketplace 把 skill 与 MCP server 作为同一个插件安装。

插件分发层

插件是分发层,MCP server 是执行层,两者不重复实现:

  • .claude-plugin/plugin.json + .claude-plugin/marketplace.json:Claude Code 插件,复用根 mcp.json
  • mcp.json 通过 npx 启动固定版本的 npm 包;插件本身不分发 Windows 二进制。全局 npm 安装是可选的快速路径,手工 MCP 示例仍使用它。

Codex / ChatGPT desktop 已经能通过现有浏览器扩展直接控制浏览器,不再把 bridge 包装成 Codex 插件,也不安装这个重复入口。bridge 继续作为通用 MCP server,供 Claude Code、Cursor、OpenClaw、Hermes Agent 等非 Codex 客户端复用同一登录态。

Claude 插件默认使用 full profile,因为 Claude Code 会通过 tool search 延迟加载 tool schema;只有 codex_doctor 使用 anthropic/alwaysLoad=true。不支持 tool search 的手工 MCP 配置仍推荐 basic。不要自造第二套工具路由器,也不要为节省 token 删除专用工具。

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.rs:ToolHandler 枚举新增 variant(当前 66 个工具)
  • handlers.rs:handle_tool_call 新增 match arm + handle_* 方法
  • schema.rs:registered_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_str、required_string_vec 等
  • Schema 测试(src/mcp/schema.rs):验证工具 required 字段、name order、type=object
  • 集成测试(tests/browser_api.rs):公开 browser/helper 行为与安全边界
  • Reconnect/mock 测试(src/client.rs,cfg(test)):跨平台 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。

Read the full file on GitHub · 125 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. 12d ago Changed · -2 tokens per session 7df1596777a8
  2. 13d ago Changed · +1 lines · +50 tokens per session 3d3eba468ad1
  3. 14d ago Changed · +3 lines · +95 tokens per session 57c4e5ac4f44
  4. 15d ago Changed · +12 lines · +286 tokens per session 8af8f1fac8f9
  5. 2mo 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 (25 stars, last pushed 5d ago), licensed MIT. It adds 2,159 tokens to every session, about $0.0086 per session on Opus 5.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.

Related

codex-browser-bridge AGENTS.md compared with instructions from other repositories

codex-browser-bridge AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codex-browser-bridge AGENTS.mdDeliciousBuding/codex-browser-bridgeInstructions file255d agoMITA2,159Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode