pgsandbox AGENTS.md

pgsandbox AGENTS.md is an instructions file for Codex, OpenCode from LVTD-LLC/pgsandbox. It costs 1,392 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

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/lvtd-llc/pgsandbox/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,392 This file is loaded in full into every session.
When invoked 1,392 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.01392 $0.01392
Opus 5 $0.00696 $0.00696
Sonnet 5 $0.00278 $0.00278
Haiku 4.5 $0.00139 $0.00139

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

How it starts

The opening of the file, as written. The whole thing — 164 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 does not install or manage Postgres itself. It targets one or more existing Postgres admin connections 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 · 164 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. 3d 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 (2 stars, last pushed 4d ago), licensed MIT. It adds 1,392 tokens to every session, about $0.0070 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.