Pgsql Test Rls

🌐Community
by constructive-io · vlatest · Repository

Automates PostgreSQL Row Level Security (RLS) policy testing via generative SQL queries and validation against expected results.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add pgsql-test-rls npx -- -y @trustedskills/pgsql-test-rls
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "pgsql-test-rls": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/pgsql-test-rls"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill allows AI agents to test PostgreSQL database schemas against Row Level Security (RLS) policies. It executes provided SQL queries and validates that the results conform to the defined RLS constraints, ensuring data access is appropriately restricted based on user roles or other conditions. The skill helps automate verification of security configurations within a PostgreSQL environment.

When to use it

  • Automated Testing: Integrate into CI/CD pipelines to automatically verify RLS policies after schema changes or updates.
  • Security Audits: Quickly assess the effectiveness of existing RLS rules by running test queries and validating results.
  • Development & Debugging: Test new RLS policies in a development environment before deploying them to production.
  • User Role Validation: Confirm that specific users or roles can only access data they are authorized to see according to defined RLS policies.

Key capabilities

  • Executes SQL queries against a PostgreSQL database.
  • Validates query results against Row Level Security (RLS) constraints.
  • Supports various user roles and permissions for testing.
  • Provides feedback on whether the RLS policy is correctly implemented.

Example prompts

  • "Test this query: SELECT * FROM orders WHERE customer_id = 123; with role 'sales'."
  • "Run the following SQL and verify that user 'finance' cannot access order details."
  • "Execute SELECT COUNT(*) FROM products; as a 'guest' user and confirm it returns zero due to RLS restrictions."

Tips & gotchas

  • Requires appropriate PostgreSQL database connection credentials.
  • RLS policies must be defined in the target PostgreSQL schema for testing to be effective.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
constructive-io
Installs
8

🌐 Community

Passed automated security scans.