pigsty AGENTS.md

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

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/pgsty/pigsty/agents-md
Clone the repo
git clone --depth 1 https://github.com/pgsty/pigsty

Made for: Codex, OpenCode.

Per session 4,979 This file is loaded in full into every session.
When invoked 4,979 The same file — it is already loaded in full.
Security scan C 1 finding. 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.04979 $0.04979
Opus 5 $0.02490 $0.02490
Sonnet 5 $0.00996 $0.00996
Haiku 4.5 $0.00498 $0.00498

Measured 2d ago against content hash e4326e8a0098, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 · 486 lines

How it starts

The opening of the file, as written. The whole thing — 486 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 · 486 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 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,582 stars, last pushed 8d ago), licensed Apache-2.0. It adds 4,979 tokens to every session, about $0.0249 per session on Opus 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

Other instructions, from other repositories