codex-a2a-gateway AGENTS.md

codex-a2a-gateway AGENTS.md is an instructions file for Codex, OpenCode from phamviet86/codex-a2a-gateway. It costs 1,521 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for codex-a2a-gateway, a project that connects Codex with other AI agents through the A2A communication standard.

In plain words
What is it for?
Use them when modifying, testing, documenting, packaging, or releasing codex-a2a-gateway.
Why use it?
They explain the project’s purpose, architecture boundaries, required invariants, and compatibility rules before you change its code.

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

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-a2a-gateway AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/phamviet86/codex-a2a-gateway/agents-md.svg)](https://agentmods.dev/instructions/phamviet86/codex-a2a-gateway/agents-md)
Your own site
<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>
Per session 1,521 This file is loaded in full into every session.
When invoked 1,521 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01521 $0.01521
Opus 5 $0.00760 $0.00760
Sonnet 5 $0.00304 $0.00304
Haiku 4.5 $0.00152 $0.00152

Measured yesterday against content hash 14a611c76c0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

AGENTS.md · 93 lines

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, and a2a.py: outbound MCP-to-A2A adapter.
  • src/codex_a2a_gateway/gateway.py and inbound.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_unknown when 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 smoke are opt-in, use harmless prompts, and never run in CI.
  • The bundled Hermes codex_a2a plugin is the reliable Hermes → Codex client path. Keep its endpoint loopback-only, persist only task/context handles in ctx.state, submit with returnImmediately, and never resend after an ambiguous result. The built-in Hermes a2a_call remains synchronous.
  • Execution preferences are inbound-only and require the negotiated Agent Card extension (A2A-Extensions, message.extensions, and message.metadata.executionPreferences). Query App Server model/list; receiver policy may narrow that catalog but must not invent support. Persist requested/effective decisions, send only model and effort to turn/start, and reject the extension in CLI mode.

Read the full file on GitHub · 93 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. yesterday Changed · +4 lines · +179 tokens per session 14a611c76c0c
  2. 4d ago First seen · 89 lines · 1,342 tokens per session scan A 08a5da427a60

Subscribe to this mod's changes

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.