codex-blackbox: Instructions file for Codex

AGENTS.md

codex-blackbox AGENTS.md is an instructions file for Codex, OpenCode from softcane/codex-blackbox. It costs 1,559 tokens per session, scanned B, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads ~/.codex paths; runs codex exec; mentions AGENTS.md.

This is softcane/codex-blackbox's own configuration. It tells Codex and OpenCode how to work on codex-blackbox 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-blackbox configures →

Reuse

Borrowing it

Nothing to install: this file belongs to softcane/codex-blackbox. 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/softcane/codex-blackbox/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/softcane/codex-blackbox

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-blackbox AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/softcane/codex-blackbox/agents-md/github.svg)](https://agentmods.dev/instructions/softcane/codex-blackbox/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/softcane/codex-blackbox/agents-md"><img src="https://agentmods.dev/badge/instructions/softcane/codex-blackbox/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-blackbox AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/softcane/codex-blackbox/agents-md"><img src="https://agentmods.dev/badge/instructions/softcane/codex-blackbox/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.01559 $0.01559
Opus 5.5 $0.00624 $0.00624
Sonnet 5.5 $0.00312 $0.00312
Haiku 4.5 $0.00156 $0.00156

Measured 2mo ago against content hash 932d3135f156, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 5mo ago), licensed MIT. It adds 1,559 tokens to every session, about $0.0062 per session on Opus 5.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.

Related

codex-blackbox AGENTS.md compared with instructions from other repositories

codex-blackbox AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codex-blackbox AGENTS.mdsoftcane/codex-blackboxInstructions file65mo agoMITB1,559Codex, 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