bex-postgres

bex-postgres is a skill for Claude Code, Codex from bex-co/bex. It costs 86 tokens per session (2,047 once invoked), scanned A, original, Apache-2.0.

Guidance for running PostgreSQL databases on bex. PostgreSQL is a relational database used to store structured application data, and this add-on covers connections, storage, backups, replicas, and availability settings.

In plain words
What is it for?
Use it to create or configure a managed PostgreSQL database, choose internal or external connection URLs, set storage and replicas, configure high availability, and handle backups or safe deletion.
Why use it?
It helps avoid connection, TLS, capacity, and connection-limit problems, while making clear which database settings can or cannot be changed after creation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or configure a managed PostgreSQL database, choose internal or external connection URLs, set storage and replicas, configure high availability, and handle backups or safe deletion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bex-co/bex/bex-postgres
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.

Any agent
npx skills add bex-co/bex --skill bex-postgres
Clone the repo
git clone --depth 1 https://github.com/bex-co/bex

Made for: Claude Code, Codex.

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 bex-postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/bex-co/bex/bex-postgres/github.svg)](https://agentmods.dev/skills/bex-co/bex/bex-postgres)
Your own site
<a href="https://agentmods.dev/skills/bex-co/bex/bex-postgres"><img src="https://agentmods.dev/badge/skills/bex-co/bex/bex-postgres/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 bex-postgres

Your own site · 80×15
<a href="https://agentmods.dev/skills/bex-co/bex/bex-postgres"><img src="https://agentmods.dev/badge/skills/bex-co/bex/bex-postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00086 $0.02047
Opus 5.5 $0.00034 $0.00819
Sonnet 5.5 $0.00017 $0.00409
Haiku 4.5 $0.00009 $0.00205

Measured yesterday against content hash 8b2261324421, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bex-postgres scanned grade A 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

1. Retrieve the linked Markdown document directly with an available URL-fetching tool or HTTP client, such as `curl`. Do not substitute web-search summaries for the document.
lego/cli/internal/skills/pack/skills/bex-postgres/SKILL.md · 145 lines

How it starts

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

bex Managed PostgreSQL

This skill covers Managed Postgres on bex: how to connect, what cannot change after creation, storage behavior, limits, HA, replicas, and safe deletion. Deep dives live under references/.

When to Use

Apply this skill when the user:

  • Configures Postgres for an app on bex (URLs, TLS, pooling)
  • Creates or changes a database, plan, disk, or replicas
  • Asks about backups, PITR, exports, or deleting a database
  • Hits connection limits, SSL errors, or latency between services and DB
  • Authors Blueprint databases / readReplicas or wires fromDatabase

For deploy flows and Blueprint basics, see bex-deploy and bex-blueprints. For private networking between services, see bex-networking. For env var patterns, see bex-env-vars.

Before configuring or troubleshooting an internal database connection, read references/private-networking.md.

Connection Patterns

bex exposes two connection URLs for the same logical database:

URL Use when TLS
Internal App or service on bex in the same region and workspace Not required (private network)
External Local development, CI, or tools outside bex Required (TLS 1.2+)

Always prefer the internal URL for bex-hosted apps so traffic stays on bex’s network and avoids extra latency and public egress patterns.

  • IP allow list applies to external access only. Same-region bex services use the internal URL regardless of the allow list.
  • External clients must use TLS; misconfigured clients often show SSL handshake or sslmode errors.

URL formats, Dashboard locations, Blueprint fromDatabase, pooling, and common mistakes: references/connection-guide.md.

Creation and Setup

  • Instance display name: Can be changed later (where the Dashboard allows renaming the resource).
  • Immutable after creation: databaseName, database user, region, PostgreSQL major version. Plan these before create; changing them requires a new database and migration.
  • Storage size: 1 GB or multiples of 5 GB when provisioning.

Read the full file on GitHub · 145 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 145 lines · 86 tokens per session scan A 8b2261324421

Subscribe to this mod's changes

bex-postgres is a skill published in the GitHub repository bex-co/bex (577 stars, last pushed today), licensed Apache-2.0. It adds 86 tokens to every session and 2,047 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-29.