codex-blackbox AGENTS.md

Repository instructions for Codex Blackbox, a tool that observes coding-agent traffic through a local proxy and records related usage data. They describe the product boundary, code locations, testing evidence, and worktree rules.

In plain words
What is it for?
Use them when working on request handling, streamed responses, usage accounting, pricing, runtime behavior, monitoring, the command-line interface, or related tests.
Why use it?
They prevent developers from treating fake test responses as proof of live support and point them to the right source files when making changes.

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

Made for: Codex, OpenCode.

Per session 1,559 This file is loaded in full into every session.
When invoked 1,559 The same file — it is already loaded in full.
Security scan B 1 finding. 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.01559 $0.01559
Opus 5 $0.00779 $0.00779
Sonnet 5 $0.00312 $0.00312
Haiku 4.5 $0.00156 $0.00156

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

Security

Grade B, and why

codex-blackbox 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 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Do not mutate `~/.codex/config.toml` for wrapper behavior.
AGENTS.md · 148 lines

How it starts

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

Codex Blackbox Agent Instructions

These instructions apply to the whole repository unless a deeper AGENTS.md overrides them.

Product Boundary

  • Codex Blackbox observes Codex traffic through a local Envoy proxy, codex-blackbox-core, and the codex-blackbox CLI.
  • Fake OpenAI Responses fixtures validate local contracts only. Do not turn a fake e2e result into a live Codex support claim.
  • Live support claims require explicit real smoke or dogfood evidence.
  • Prefer the current code and tests over stale copied comments or old planning text.

Implementation Map

  • Architecture and harness map: ARCHITECTURE.md, docs/index.md, docs/harness.md
  • Request parsing: codex-blackbox-core/src/codex_request.rs
  • Response SSE accumulation: codex-blackbox-core/src/codex_response.rs
  • Turn accounting: codex-blackbox-core/src/codex_accounting.rs
  • Pricing: codex-blackbox-core/src/pricing.rs
  • Runtime, persistence, hooks, and Envoy ext_proc: codex-blackbox-core/src/main.rs
  • Watch event types: codex-blackbox-core/src/watch.rs
  • Metrics: codex-blackbox-core/src/metrics.rs
  • CLI wrapper, preflight, watch rendering: codex-blackbox-cli/src/main.rs

Worktree Rules

  • For multi-step work, use docs/PLANS.md and keep active plans in docs/exec-plans/active/.
  • Read the code path and nearby tests before changing behavior.
  • Use rg/rg --files for searches.
  • Check git status --short before and after meaningful edits.
  • Do not revert or overwrite user changes.
  • Keep changes scoped to the requested behavior and surrounding module.
  • Use apply_patch for manual edits.
  • Update tests and user-facing docs when behavior changes.

Codex Routing

  • codex-blackbox run -- codex ... uses the experimental ChatGPT subscription proxy path.
  • The default Envoy listener routes /backend-api to chatgpt.com.
  • Codex model turns use command-line config overrides: chatgpt_base_url, openai_base_url, model_provider="openai", and features.enable_request_compression=false.
  • Do not mutate ~/.codex/config.toml for wrapper behavior.
  • Do not inject --ephemeral; Codex keeps normal session persistence.
  • Remove inherited parent-session CODEX_* variables listed in the CLI before spawning child Codex processes.
  • OPENAI_API_KEY is not used for ChatGPT subscription proxy mode.
  • A successful codex exec child run must still fail the wrapper if codex-blackbox-core observes no new provider="codex_responses" request.

Read the full file on GitHub · 148 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. 2d ago First seen · 148 lines · 1,559 tokens per session scan B 932d3135f156

Subscribe to this mod's changes

codex-blackbox AGENTS.md is an instructions file published in the GitHub repository softcane/codex-blackbox (6 stars, last pushed 3mo ago), licensed MIT. It adds 1,559 tokens to every session, about $0.0078 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.