---
title: "Introducing Neon RLS: Simplifying Row-Level Security For Postgres"
description: "Neon RLS lets Postgres row-level security policies authenticate requests with JWTs from any auth provider that exposes a JWKS URL."
url: "https://swe.quest/articles/introducing-neon-rls-simplifying-row-level-security-for-postgres-4b66d76670bb402f"
canonical: "https://neon.com/blog/introducing-neon-authorize"
source: "Neon"
published: "2024-10-30"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 6
tags: ["postgres","identity-auth","multi-tenancy","typescript"]
---

# Introducing Neon RLS: Simplifying Row-Level Security For Postgres

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-10-30, 6 min read, Announcement. Original: [https://neon.com/blog/introducing-neon-authorize](https://neon.com/blog/introducing-neon-authorize)

## Summary

Neon RLS lets Postgres row-level security policies authenticate requests with JWTs from any auth provider that exposes a JWKS URL. The Neon Proxy verifies the token and exposes its claims through auth.user\_id() and auth.session() from the open-source pg\_session\_jwt extension, for use in RLS policies and WHERE clauses. A Drizzle ORM integration adds pgPolicy and crudPolicy helpers so policies are declared alongside the schema. Neon recommends RLS for core authorization rules such as multi-tenant isolation, keeping intricate access logic in backend code, and says backend-less client apps are only suitable for simple projects.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- JWT authentication ([easy posts on Identity & auth](https://swe.quest/tags/identity-auth.md?difficulty=easy))
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

Neon RLS, Row-Level Security, pg\_session\_jwt, Drizzle ORM, JWKS, Clerk, Neon Data API

## Related posts

- [How to Set Up Row-Level Security in Postgres Using AWS Cognito](https://swe.quest/articles/how-to-set-up-row-level-security-in-postgres-using-aws-cognito-7cb6bed6c9694d22.md): Neon · 2024-12-04 · Medium · 5 min read · PostgreSQL, Identity & auth, JavaScript, Serverless
  Postgres row-level security can be driven by AWS Cognito JWTs: a Cognito User Pool issues tokens, and Neon Authorize validates them and maps claims like \`sub\` into Postgres session variables.
- [Modelling Authorization for a Social Network with Postgres RLS and Drizzle ORM](https://swe.quest/articles/modelling-authorization-for-a-social-network-with-postgres-rls-and-drizzle-orm-6267eb437b8171e7.md): Neon · 2024-11-11 · Medium · 8 min read · PostgreSQL, Identity & auth, TypeScript, System design
  Postgres Row-Level Security can express the full authorization model for a Twitter-like social network, defined with Drizzle ORM's crudPolicy and pgPolicy helpers and the pg\_session\_jwt extension's auth.user\_id().
- [Higher-level CRUD Abstraction for Postgres RLS](https://swe.quest/articles/higher-level-crud-abstraction-for-postgres-rls-90207e4bb081ead2.md): Neon · 2024-11-13 · Medium · 3 min read · PostgreSQL, Identity & auth, TypeScript
  Postgres Row-Level Security requires separate USING and WITH CHECK policies per operation, which gets repetitive for CRUD apps.
- [Is Postgres RLS for Everything and Everyone?](https://swe.quest/articles/is-postgres-rls-for-everything-and-everyone-1df08667813a2c82.md): Neon · 2024-11-15 · Medium · 4 min read · PostgreSQL, Identity & auth, Multi-tenancy, Security
  Postgres row-level security is a poor fit for expressing an entire app's authorization model.
- [Is “SQL from the frontend” viable?](https://swe.quest/articles/is-sql-from-the-frontend-viable-7fa2effc8f7be530.md): Neon · 2024-11-07 · Easy · 3 min read · PostgreSQL, Identity & auth, System design, Security
  Letting the frontend query the database directly, via tools like PostgREST or Firebase, can sharply speed up development by removing backend abstraction layers and frontend/backend team dependencies, which makes it attractive for prototypes and many apps.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
