codex-multi-auth AGENTS.md

A project knowledge-base document containing a repository's purpose, structure, conventions, and known pitfalls.

In plain words
What is it for?
Use it when working on the codex-multi-auth project, especially for account management, command wrappers, storage, routing, and release-related changes.
Why use it?
It gives coding agents a shared map of the codebase so they can find the right files and follow project-specific rules.

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

Made for: Codex, OpenCode.

Per session 2,766 This file is loaded in full into every session.
When invoked 2,766 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.02766 $0.02766
Opus 5 $0.01383 $0.01383
Sonnet 5 $0.00553 $0.00553
Haiku 4.5 $0.00277 $0.00277

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

Security

Grade B, and why

codex-multi-auth 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.

- Official Codex state: `~/.codex/auth.json`, `~/.codex/accounts.json`, `~/.codex/config.toml`.
AGENTS.md · 145 lines

How it starts

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

PROJECT KNOWLEDGE BASE

Generated: 2026-04-25 Commit: 6147f88 Validated: 2026-06-10 against commit 98d9819 (repo audit; claims re-checked against the tree, content not regenerated) Branch: main Package version: 2.9.2

OVERVIEW

codex-multi-auth is a Codex CLI-first OAuth account manager and optional forwarding wrapper for the official Codex CLI. The installed codex-multi-auth entrypoint handles account-management commands locally, codex-multi-auth-codex forwards official Codex commands through this package's wrapper when explicitly used, mcodex is a convenience launcher over that wrapper, and runtime rotation can route live Responses traffic through a localhost account-rotation proxy by default. Local governance modules (usage ledger, budgets, account policies, routing profiles, local bridge) stay file-backed under the multi-auth root. The plugin-host entrypoint remains exported for compatibility, but the primary product surface is the account manager, optional wrapper, storage, runtime proxy, governance commands, and repair tooling.

STRUCTURE

./
├── scripts/
│   ├── codex.js              # codex-multi-auth-codex wrapper, official CLI forwarder, shadow CODEX_HOME/runtime proxy setup
│   ├── codex-multi-auth.js   # standalone package CLI entrypoint
│   ├── mcodex.js             # convenience launcher: forwards to codex.js; optional --monitor / --tmux
│   ├── codex-routing.js      # auth command and compatibility alias routing
│   ├── codex-bin-resolver.js # official Codex binary discovery
│   ├── codex-app-router.js   # persistent localhost router for packaged Codex app bind
│   └── codex-app-launcher.js # reversible user-level app launcher routing helper
├── index.ts                  # optional plugin-host runtime entry
├── lib/                      # core runtime logic (see lib/AGENTS.md)
│   ├── auth/                 # OAuth flow, PKCE, callback server
│   ├── runtime/              # Codex CLI/app integration helpers, app bind, first-run, live sync, runtime observability
│   ├── request/              # request transform, SSE, failover, backoff
│   ├── storage/              # path resolution, migrations, backups, restore, import/export
│   ├── policy/               # runtime policy composition (budgets, tags, routing profiles)
│   ├── usage/                # local usage ledger, pricing, redaction
│   ├── codex-cli/            # Codex CLI state sync and writer helpers
│   ├── codex-manager/        # command modules and settings panels
│   ├── prompts/              # model-family prompts, GitHub ETag cache
│   ├── recovery/             # conversation recovery state
│   ├── tools/                # hashline helper tools
│   └── ui/                   # TUI rendering, menus, copy, theme, select
├── test/                     # vitest suites (see test/AGENTS.md)
├── docs/                     # user, reference, release, audit, and maintainer docs
├── config/                   # optional plugin-host config templates
├── vendor/                   # vendored codex-ai-plugin + codex-ai-sdk shims
├── assets/                   # static assets
├── .github/                  # CI, issue/PR templates, plugin scanner fixtures
└── dist/                     # build output (generated, do not edit)

Read the full file on GitHub · 145 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 · 145 lines · 2,766 tokens per session scan B da8a0f94622a

Subscribe to this mod's changes

codex-multi-auth AGENTS.md is an instructions file published in the GitHub repository ndycode/codex-multi-auth (465 stars, last pushed 2d ago), licensed MIT. It adds 2,766 tokens to every session, about $0.0138 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-30.