pigsty: Instructions file for Codex

AGENTS.md

pigsty AGENTS.md is an instructions file for Codex, OpenCode from pgsty/pigsty. It costs 5,172 tokens per session, scanned C, original, Apache-2.0.

A set of operating instructions for Pigsty, a production environment for PostgreSQL databases and related services. It identifies important configuration and security files and defines checks to perform before changes.

In plain words
What is it for?
Use it when operating Pigsty deployments: inspect configuration and system state, verify backups, run dry runs, limit target nodes, and handle incidents or risky operations.
Why use it?
It reduces the risk of changing the wrong database cluster, acting on outdated state, skipping backups, or exposing sensitive keys.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is pgsty/pigsty's own configuration. It tells Codex and OpenCode how to work on pigsty 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 pigsty configures →

About the project

Pigsty is an open-source PostgreSQL distribution that packages database deployment, high availability, point-in-time recovery, infrastructure automation, monitoring, and PostgreSQL extensions into one platform. It is for teams that self-host PostgreSQL from laptops to datacenters.

pgsty/pigsty · 5,908 stars · on GitHub · pigsty.io

Reuse

Borrowing it

Nothing to install: this file belongs to pgsty/pigsty. 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/pgsty/pigsty/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/pgsty/pigsty

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 pigsty AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/pgsty/pigsty/agents-md"><img src="https://agentmods.dev/badge/instructions/pgsty/pigsty/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,172 This file is loaded in full into every session.
When invoked 5,172 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.05172 $0.05172
Opus 5.5 $0.02069 $0.02069
Sonnet 5.5 $0.01034 $0.01034
Haiku 4.5 $0.00517 $0.00517

Measured 2d ago against content hash 27cbd5bd84e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

pigsty 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- rm -rf /pg/* # Delete data directories
AGENTS.md · 494 lines

How it starts

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

Pigsty Production Environment - Agent Guide

Pigsty v4.5.0 | PostgreSQL RDS/DBaaS | Apache-2.0


Important Files

pigsty.yml, source of truth of this deployment, always read it to understand current environment. Sometimes the real state may drift from the config file, especially after manual changes / failover. trust by verify.

files/pki/ca/ca.key - highly sensitive CA private key. Keep it safe, never share it, don't lose it.

If pig cli is available, you can use it to perform operation command with caution. https://pigsty.io/docs/pig


Standard Operating Procedures

Before Any Change

  1. Identify scope: Which cluster? Which nodes?
  2. Check current state: pig pg list, system status
  3. Verify backup: pig pb info - is backup recent?
  4. Dry run first: Add --check to playbook

For Dangerous Operations

  1. Confirm with user - even in YOLO mode
  2. Verify backup exists and is recent
  3. Ask user to type exact target name
  4. Execute with explicit -l limit flag

Incident Response

  1. Read logs first, understand the situation, you can get it from /pg/log, or query victorialogs API
  2. Check Patroni/HA status
  3. Do NOT take any action without user confirmation
  4. Recommend rollback/recovery options before executing

Permission Boundaries

ALWAYS ALLOWED (No confirmation needed)

Read-only operations:

  • Read pigsty.yml configuration file
  • Read Ansible inventory and playbook files
  • Read system monitoring metrics (CPU, memory, disk, network)
  • Read PostgreSQL/Patroni cluster status via pg list, patronictl
  • Read backup status via pb info, pgbackrest info
  • Read service status via systemctl status
  • Read logs: /pg/log/, system journal, nginx access logs
  • Query monitoring dashboards and Grafana metrics
  • Dry-run playbooks with --check flag
  • Read extension catalog and documentation

Read the full file on GitHub · 494 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 Changed · +8 lines · +193 tokens per session 27cbd5bd84e7
  2. 2mo ago First seen · 486 lines · 4,979 tokens per session scan C e4326e8a0098

Subscribe to this mod's changes

pigsty AGENTS.md is an instructions file published in the GitHub repository pgsty/pigsty (5,908 stars, last pushed 2d ago), licensed Apache-2.0. It adds 5,172 tokens to every session, about $0.0207 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pigsty AGENTS.md compared with instructions from other repositories

pigsty AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pigsty AGENTS.mdpgsty/pigstyInstructions file5.9k2d agoApache-2.0C5,172Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode