postgresql

Query PostgreSQL with read-only SQL, parameterized queries, and row limits.

1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/Ieer/OpenClaw-PWTInstaller --skill postgresql-ieer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/Ieer/OpenClaw-PWTInstaller/tree/main/panopticon/global-skills/postgresql
Command: npx skills add https://github.com/Ieer/OpenClaw-PWTInstaller --skill postgresql-ieer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2, and includes scripts (resource) components.

What problem does it solve?

AI agents need to query PostgreSQL safely without performing writes or exposing sensitive data. This Skill provides a controlled, read-only PostgreSQL interface with guardrails including parameterized queries, a table allowlist, and automatic row limiting.

Core Features & Use Cases

  • Read-only SQL validation (SELECT/WITH)
  • Parameterized queries with placeholders
  • Table allowlist enforcement and max-row limits
  • Consistent JSON output for AI consumption
  • Use cases: generating reports, dashboards, data diagnostics for AI agents

Quick Start

Run the included example to perform a safe read-only query against PostgreSQL using the supplied script.

Frequently Asked Questions about postgresql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run safe read-only PostgreSQL queries from an AI agent?

To run safe read-only PostgreSQL queries from an AI agent, use a tool that enforces strict SQL validation, parameterized queries, and table allowlists. This prevents accidental writes while returning structured JSON results for reporting and analytics.

What is the best way to restrict AI agents to SELECT queries in PostgreSQL?

The best way to restrict AI agents to SELECT queries in PostgreSQL is by applying an SQL allowlist that blocks writes and enforces read-only statements. This ensures only SELECT or WITH queries execute against the database.

Can I limit the number of rows returned by an AI SQL query to protect my database?

Yes, you can limit the number of rows returned by an AI SQL query to protect your database. A max rows cap enforces row-limiting automatically, preventing large data pulls from overwhelming the system during operational insights generation.

Does psycopg2 work with tools that provide AI guardrails for database reporting?

Yes, psycopg2 works with tools that provide AI guardrails for database reporting. It serves as the underlying dependency for executing parameterized queries and returning data with a fingerprint from PostgreSQL safely.

How do I convert natural language to SQL without risking database writes?

To convert natural language to SQL without risking database writes, use a read-only interface with strict guardrails. It validates generated SQL to ensure only read operations execute, blocking any destructive write actions.

What are the limitations of using read-only SQL validation for AI analytics?

The limitations of using read-only SQL validation for AI analytics include being restricted to SELECT and WITH statements, being unable to perform data modifications, and being confined to tables within the configured allowlist.