Borrowing it
Nothing to install: this file belongs to phamviet86/codex-a2a-gateway. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/phamviet86/codex-a2a-gateway/main/AGENTS.mdgit clone --depth 1 https://github.com/phamviet86/codex-a2a-gatewayWrote 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.
[](https://agentmods.dev/instructions/phamviet86/codex-a2a-gateway/agents-md)<a href="https://agentmods.dev/instructions/phamviet86/codex-a2a-gateway/agents-md"><img src="https://agentmods.dev/badge/instructions/phamviet86/codex-a2a-gateway/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.
<a href="https://agentmods.dev/instructions/phamviet86/codex-a2a-gateway/agents-md"><img src="https://agentmods.dev/badge/instructions/phamviet86/codex-a2a-gateway/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01544 | $0.01544 |
| Opus 5.5 | $0.00618 | $0.00618 |
| Sonnet 5.5 | $0.00309 | $0.00309 |
| Haiku 4.5 | $0.00154 | $0.00154 |
Grade A, and why
codex-a2a-gateway 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository guidance
These instructions apply to the entire repository. Codex and other coding agents should read this file before changing code, tests, documentation, packaging, or release metadata.
Mission and scope
codex-a2a-gateway gives Codex a bidirectional A2A v1.0 integration:
- Outbound: Codex calls the local MCP stdio server, which delegates to the configured loopback Hermes A2A peer.
- Inbound: an A2A client calls the HTTP/SSE gateway, which maps the task to a Codex App Server thread and turn.
Hermes is the first verified outbound peer, not the product boundary. Do not turn this project into Hermes administration, a general arbitrary-URL proxy, or a multi-tenant service without an explicit architecture and security decision.
Architecture ownership
src/codex_a2a_gateway/server.py,core.py, anda2a.py: outbound MCP-to-A2A adapter.src/codex_a2a_gateway/gateway.pyandinbound.py: inbound A2A transport and task lifecycle.src/codex_a2a_gateway/codex_backend.py: Codex App Server and CLI compatibility adapters.src/codex_a2a_gateway/store.py: SQLite schema, mappings, tasks, messages, events, and migrations.src/codex_a2a_gateway/settings.py: environment contract and network policy.tests/: mirrors these boundaries with fake-server and protocol regression coverage.
Treat docs/durable-jobs.md, docs/architecture-v0.2.md, docs/inbound-gateway.md, and the current README as the implemented contract. Files labelled as v0.1 or research are historical evidence, not the current specification.
Non-negotiable invariants
- MCP stdout contains protocol frames only. Send diagnostics to stderr.
- Outbound endpoints and discovered interfaces remain loopback-only. Never accept a model-supplied URL or credential.
- Inbound non-loopback bind or public URL requires bearer authentication. Remote deployment also requires TLS at a trusted proxy.
- Read secrets from environment variables. Never log, persist, echo, or commit tokens.
- Do not persist the original outbound prompt. Results and artifacts can still be sensitive and require restrictive file permissions and retention.
- Never automatically resend a mutating A2A request after an ambiguous transport outcome. Reconcile only by saved task ID or exact request message identity, never context/unique-candidate inference; preserve
outcome_unknownwhen evidence is ambiguous. - Cancellation remains best-effort. Never claim that the underlying agent computation stopped unless an upstream protocol proves it.
- Preserve A2A v1 task and event shapes. Do not reintroduce the legacy stream field
final. - Codex App Server over stdio is the default inbound backend. CLI mode is an explicit compatibility path and may not take over a context that already owns an App Server thread.
- Preserve per-context serialization, bounded admission, and the one-active-writer assumption for each SQLite state file.
- SQLite migrations must be additive and backward-compatible. Never discard existing context, task, message, or event records.
- Live tests and
smokeare opt-in, use harmless prompts, and never run in CI. - The bundled Hermes
codex_a2aplugin is the reliable Hermes → Codex client path. Keep its endpoint loopback-only, persist only task/context handles inctx.state, submit withreturnImmediately, and never resend after an ambiguous result. The built-in Hermesa2a_callremains synchronous. - Execution preferences are inbound-only and require the negotiated Agent Card extension (
A2A-Extensions,message.extensions, andmessage.metadata.executionPreferences). Query App Servermodel/list; receiver policy may narrow that catalog but must not invent support. Persist requested/effective decisions, send onlymodelandefforttoturn/start, and reject the extension in CLI mode.
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.
- 1mo ago Changed · +23 tokens per session da7c7c791449
- 2mo ago Changed · +4 lines · +179 tokens per session 14a611c76c0c
- 2mo ago First seen · 89 lines · 1,342 tokens per session scan A 08a5da427a60
codex-a2a-gateway AGENTS.md is an instructions file published in the GitHub repository phamviet86/codex-a2a-gateway (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 1,544 tokens to every session, about $0.0062 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-31.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.