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.
npx agentmods add instructions/phamviet86/codex-a2a-gateway/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.svg" alt="Measured on agentmods" 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 | $0.01521 | $0.01521 |
| Opus 5 | $0.00760 | $0.00760 |
| Sonnet 5 | $0.00304 | $0.00304 |
| Haiku 4.5 | $0.00152 | $0.00152 |
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 yesterday.
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/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 by task/context and 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.
- yesterday Changed · +4 lines · +179 tokens per session 14a611c76c0c
- 4d 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 3d ago), licensed Apache-2.0. It adds 1,521 tokens to every session, about $0.0076 per session on Opus 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
IronMesh AGENTS.md
Instructions for WizTheAgent/IronMesh, covering agent guide for this repository, what ironmesh is, quick repo orientation, non-negotiable operating rules and workflow for changes.
prime-silo CLAUDE.md
Claude Code instructions for binary16labs/prime-silo, covering prime-silo agent navigation, current status (as of 2026-07-16), architecture in one sentence, what agents need to know and 1. agent authority (strict boundaries).
prime-silo AGENTS.md
AGENTS.md instructions for binary16labs/prime-silo, covering agents, documentation first, agents file index, programming guide and top-level structure.
a2amesh AGENTS.md
AGENTS.md instructions for oaslananka/a2amesh, covering a2a mesh agent map, what this repository is, setup, build and test and repository layout.
agent-meet CLAUDE.md
Instructions for matanrak/agent-meet, covering agent-meet development guidelines, active technologies, project structure, commands and code style.
a2a-demos copilot-instructions.md
Instructions for capiscio/a2a-demos, covering a2a-demos - github copilot instructions, ⛔ absolute rules - no exceptions, 1. all work via pull requests, 2. no watch/blocking commands and 🚨 critical: read first.