- Home
- Skills
- APIs & Backend
- PostgreSQL RLS & OIDC Multi-Tenant Security Blueprint
PostgreSQL RLS & OIDC Multi-Tenant Security Blueprint
by snowgem
Harden FastAPI multi-tenant APIs with PostgreSQL FORCE RLS and strict RFC 9068 OIDC access-token verification.
$19
PostgreSQL RLS & OIDC Multi-Tenant Security Blueprint
Example session with this skill installed
Audit my FastAPI + async SQLAlchemy SaaS backend for tenant isolation and OIDC access-token security.
- Read your context and instructions
- Compiled the postgresql rls
Connects securely to your tools. The creator never sees your data.
About this skill
Stop your AI coding agent from shipping leaky multi-tenant backends.
Standard prompts produce WHERE tenant_id = ? filters, table-owner DB roles that silently bypass RLS, session-level SET calls that leak data across pooled connections, and loose JWT checks that accept ID tokens or HS256 downgrades.
This production-hardened SKILL.md enforces an end-to-end security blueprint for FastAPI, async SQLAlchemy, Alembic, and PostgreSQL:
- True DB-level isolation: separated migrator/runtime roles (NOSUPERUSER NOBYPASSRLS), FORCE ROW LEVEL SECURITY, fail-closed GUC policies, composite tenant foreign keys, and transaction-local set_config(..., true).
- Strict RFC 9068 OIDC verification: rejects ID tokens (at+jwt only), enforces asymmetric algorithm allowlists before JWKS lookup, validates JWK algorithm match, runs off the async event loop with bounded timeouts, and redacts 503 upstream errors.
- Real proof, not mocked SQLite: ships with a self-verification checklist and real PostgreSQL + Pytest security test templates for CI.
Targets PostgreSQL with FastAPI, async SQLAlchemy, Alembic, and OIDC resource-server bearer tokens. Not intended for SQLite-only projects, browser cookie sessions, or OAuth authorization-server implementations.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 3 days ago
- Software
Python 3.10+PostgreSQLFastAPISQLAlchemy 2.xAlembic
Permissions
No special permissions declared or detected
What's inside
Creator
snowgem
Hi
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.