pgsandbox: Instructions file for Codex

AGENTS.md

pgsandbox AGENTS.md is an instructions file for Codex, OpenCode from LVTD-LLC/pgsandbox. It costs 1,416 tokens per session, scanned A, original, MIT.

A repository guide for PGSandbox, a local tool that lets coding agents create, inspect, use, and delete temporary PostgreSQL databases. PostgreSQL is a relational database; an MCP server lets an agent call the tool through a standard interface.

In plain words
What is it for?
Use it when changing PGSandbox, testing migrations or SQL, creating seeded demo database states, reproducing backend bugs, or running its build and test commands.
Why use it?
It explains the project’s scope, required files, and reliable checks so changes support isolated database testing without pretending the tool installs PostgreSQL itself.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lvtd-llc/pgsandbox/agents-md"><img src="https://agentmods.dev/badge/instructions/lvtd-llc/pgsandbox/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,416 This file is loaded in full into every session.
When invoked 1,416 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01416 $0.01416
Opus 5.5 $0.00566 $0.00566
Sonnet 5.5 $0.00283 $0.00283
Haiku 4.5 $0.00142 $0.00142

Measured 1mo ago against content hash 96bfa908353d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pgsandbox 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 1mo 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.

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 · 166 lines

How it starts

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

PGSandbox Agent Guide

Scope

This file is the repo-level operating manual for coding agents working on pgsandbox. Apply it to the whole repository unless a more specific steering file says otherwise.

Project Summary

PGSandbox is a local-first MCP server that lets coding agents create, inspect, use, and delete disposable Postgres databases. The goal is to make a real isolated database the easy default for migrations, SQL validation, seeded demo states, and backend bug reproduction.

The package is a Rust native CLI and MCP stdio server. It manages a local Postgres cluster by default. Setup and ensure_postgres can install missing PostgreSQL binaries through a supported package manager when available. Explicit external Postgres admin profiles remain optional and can be configured by environment variables or a JSON config file.

First Files To Read

  • README.md for user-facing install and workflow.
  • docs/architecture.md for the resource model and future backend ideas.
  • docs/mcp-tools.md for MCP tool contracts.
  • docs/open-questions.md before expanding scope.
  • PRODUCT.md, TECH.md, STRUCTURE.md, VISION.md, and DESIGN.md for steering context.

Reliable Commands

Run these from the repo root:

npm run check
npm test
npm run build

These npm scripts delegate to Cargo. The direct equivalents are:

cargo check
cargo test
cargo build --release

Useful manual checks with the managed local runtime:

pgsandbox local status
pgsandbox doctor
pgsandbox smoke-test

Release packaging check:

npm run package:homebrew

Implementation Rules

  • Keep the MCP tool surface narrow and explicit in rust-src/mcp.rs; put database lifecycle behavior in rust-src/postgres.rs.
  • Preserve the distinction between admin connections and sandbox role connections. Admin connections are for lifecycle and metadata only.
  • Destructive operations must only target databases recorded in the pgsandbox_databases metadata table for the selected profile.
  • Keep TTL enforcement and maxTtlMinutes caps intact when changing create or cleanup behavior.
  • Do not log full connection strings. Mask or omit passwords in user-facing output unless the tool intentionally returns sandbox credentials to the caller.
  • Use quote_ident and quote_literal from rust-src/names.rs for generated SQL identifiers/literals. Do not interpolate identifiers by hand.
  • Preserve run_sql row limiting and truncation behavior. New query paths should have tests that prove large result sets do not dump unbounded rows.
  • Prefer structured parsing and validation through Rust types, Serde, JSON, TOML, or Postgres client APIs over regex/string manipulation when practical.
  • Do not make Docker a hard requirement. docker-compose.example.yml is only a local demo helper.
  • Treat the current server as local/private infrastructure. Hosted database platform work is allowed as an explicit product direction, but it needs a deliberate design for auth, tenancy, quotas, billing, and security before adding a public network admin surface.

Read the full file on GitHub · 166 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. 1mo ago Changed · +2 lines · +24 tokens per session 96bfa908353d
  2. 2mo ago First seen · 164 lines · 1,392 tokens per session scan A 320b08aeb5f7

Subscribe to this mod's changes

pgsandbox AGENTS.md is an instructions file published in the GitHub repository LVTD-LLC/pgsandbox (3 stars, last pushed today), licensed MIT. It adds 1,416 tokens to every session, about $0.0057 per session on Opus 5.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.

Related

pgsandbox AGENTS.md compared with instructions from other repositories

pgsandbox AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pgsandbox AGENTS.mdLVTD-LLC/pgsandboxInstructions file3todayMITA1,416Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot