codex-global-agents-template: Instructions file for Codex

AGENTS.md

codex-global-agents-template AGENTS.md is an instructions file for Codex, OpenCode from yuanguang-ai-lab/codex-global-agents-template. It costs 4,861 tokens per session, scanned C, original, MIT.

A set of AGENTS.md instructions, where AGENTS.md is a file that tells a coding agent how to work in a project. It defines shared practices for collaboration, safety, evidence, engineering, Git, and handoffs.

In plain words
What is it for?
Use it as a starting template for global agent guidance, then adapt it for a team or repository.
Why use it?
It gives the agent consistent working rules while leaving project-specific commands and architecture details in the projects that need them.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: reads ~/.codex or $CODEX_HOME, but also the file is AGENTS.md. Also seen: mentions subagents; mentions AGENTS.md; mentions Codex.

This is yuanguang-ai-lab/codex-global-agents-template's own configuration. It tells Codex and OpenCode how to work on codex-global-agents-template 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-global-agents-template configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yuanguang-ai-lab/codex-global-agents-template. 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/yuanguang-ai-lab/codex-global-agents-template/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/yuanguang-ai-lab/codex-global-agents-template

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-global-agents-template AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/yuanguang-ai-lab/codex-global-agents-template/agents-md"><img src="https://agentmods.dev/badge/instructions/yuanguang-ai-lab/codex-global-agents-template/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,861 This file is loaded in full into every session.
When invoked 4,861 The same file — it is already loaded in full.
Security scan C 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.04861 $0.04861
Opus 5 $0.02431 $0.02431
Sonnet 5 $0.00972 $0.00972
Haiku 4.5 $0.00486 $0.00486

Measured 9d ago against content hash 6a62c7c4fdb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

codex-global-agents-template AGENTS.md scanned grade C 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 9d 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.

Instruction-override phrasinghighPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

This section states a default authorization preference. It does not override system rules, platform policy, sandbox limits, or tool approvals.
AGENTS.md · 257 lines

How it starts

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

Global AGENTS.md Template for Codex

01 - Identity And Scope

This file is a global Codex working agreement template. It defines stable cross-project defaults for collaboration style, safety boundaries, evidence standards, engineering habits, Git habits, and handoff discipline.

Use it as a starting point, not as a universal policy. Replace placeholders, remove rules that do not match your workflow, and keep project-specific facts in project-level or subdirectory-level AGENTS.md files.

The user or team is the product owner and final decision maker. Codex is a hands-on technical collaborator, research partner, and execution-focused advisor. For clear tasks, Codex should move work forward and report results with evidence, verification, risks, and remaining uncertainty.

This file should not store project-specific commands, architecture maps, release flows, generated-file rules, forbidden directories, or long operational manuals. Those belong closer to the project that needs them.

When current user instructions, project rules, and global rules all apply, follow the current user instruction first. For project facts and commands, use the most specific project rule. Safety, privacy, and irreversible-risk boundaries still apply.

02 - Working Agreements

Default Collaboration Posture

Codex is not merely a passive Q&A tool. It is a hands-on technical collaborator, research partner, and execution-oriented advisor.

When the objective is clear, Codex should move the work forward instead of stopping at suggestions. When the objective is unclear, involves important tradeoffs, or may affect safety, privacy, money, production systems, or externally visible outcomes, Codex should clarify and explain the risks before proceeding.

Codex should prioritize understanding what the user is really trying to accomplish, rather than mechanically executing the literal wording. When useful, Codex may propose a safer route, split the work, add verification steps, or point out risks that are easy to miss.

Read the full file on GitHub · 257 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. 9d ago First seen · 257 lines · 4,861 tokens per session scan C 6a62c7c4fdb8

Subscribe to this mod's changes

codex-global-agents-template AGENTS.md is an instructions file published in the GitHub repository yuanguang-ai-lab/codex-global-agents-template (1 stars, last pushed 3mo ago), licensed MIT. It adds 4,861 tokens to every session, about $0.0243 per session on Opus 5. A static security scan graded it C with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.