kimo
DefinitionAll productsData

Row-level security

Definition

Row-level security (RLS) is a database feature that restricts which rows of a table a user can read or modify, using a policy evaluated on every query, so two users running the same SELECT see different, authorized subsets.

Updated 4 sources3 min read

Row-level security (RLS) is a database feature that restricts which rows of a table a user can read or change, using a policy evaluated on every query. Two people can run the same SELECT and get different results, each seeing only the rows they are authorized for. Because the database enforces it, every tool that connects inherits the rule.

What is row-level security?

Microsoft’s SQL Server documentation describes RLS as using group membership or execution context to control access to rows in a table. It distinguishes filter predicates, which silently filter the rows available to reads, from block predicates, which explicitly block writes that violate the rule.2 PostgreSQL implements the same idea with policies attached to tables.1 Either way, the rule lives next to the data, not in each application.

Example: regional isolation in PostgreSQL

Each session sees only its region
sql
ALTER TABLE accounts ENABLE ROW LEVEL SECURITY;

CREATE POLICY region_isolation ON accounts
  FOR SELECT
  USING (region = current_setting('app.region', true));

-- In the session:
SET app.region = 'emea';
SELECT count(*) FROM accounts;  -- counts EMEA rows only

Three PostgreSQL rules trip people up. If RLS is enabled and no policy exists, a default-deny policy applies and no rows are visible. Superusers and roles with BYPASSRLS always bypass policies. Table owners normally bypass them too unless you run ALTER TABLE … FORCE ROW LEVEL SECURITY.1 Test policies with the actual role your tools connect as.

Why does row-level security matter?

Access control fails often. In the OWASP Top 10 (2021), broken access control moved up from fifth place to first, and 94% of applications were tested for some form of it.3 The 2025 edition keeps it at number one.4 Analytics makes the problem worse, because data gets reused by many tools and people. RLS gives a single enforcement point. Paired with a semantic layer, it lets one dashboard serve every region, customer or team safely.

Common misconceptions

  • “RLS hides columns.” It filters rows. Use column privileges or views for columns.
  • “The admin account tests it fine.” Superusers and owners bypass RLS, so a test as admin proves nothing.
  • “A filter in the dashboard is the same thing.” A UI filter can be removed by the viewer; a database policy cannot.

How Kimo works with row-level security

When Kimo connects to a database, directly or through Kimo Bridge, it uses the dedicated read-only role you create, so your database’s RLS policies apply to every query Kimo sends. On top of that, Kimo models can carry row filters tied to workspace roles, which keeps shared dashboards scoped per viewer. See connecting Postgres, SSO and SCIM and the Bridge security model.

Frequently asked questions

Does row-level security slow queries down?

Policies add a predicate to every query. Simple, indexed predicates such as tenant_id = … usually cost little; complex subqueries in policies can be expensive, so check the plan.

Should multi-tenant SaaS use RLS?

It is a strong second line of defense for shared-table multi-tenancy: even if application code forgets a tenant filter, the database still enforces it.

What is the difference between RLS and column-level security?

RLS decides which rows a user sees; column-level security decides which columns. Most sensitive datasets need both.

Sources

4 references
  1. Row Security Policies (opens in a new tab)
    PostgreSQL Global Development Grouppostgresql.org

    Default-deny; BYPASSRLS and superusers; FORCE ROW LEVEL SECURITY for owners.

  2. Row-level security (opens in a new tab)
    Microsoft Learn (SQL Server)learn.microsoft.com

    Definition; filter vs block predicates.

  3. A01:2021 – Broken Access Control (opens in a new tab)
    OWASP Top 10:20212021top10.owasp.org

    Moved up from fifth position to A01; 94% of applications tested for some form of broken access control.

  4. Introduction – OWASP Top 10:2025 (opens in a new tab)
    OWASP Foundation2025top10.owasp.org

    A01:2025 Broken Access Control maintains its position at #1.

External sources were accessed at the time of writing. Kimo product details, customers and figures in examples are illustrative unless a source is cited.

Used in

Where Row-level security shows up in practice

5 resources
GuideBeginner
All

Install Kimo Bridge with Docker

Run the bridge next to your database in minutes: outbound-only, read-only, revocable.

Arno Visser
10 min read
GuideAdvanced
All

Deploy Kimo Bridge on Kubernetes

Helm chart, secrets, high availability and network policies for production.

Arno Visser
10 min read
GuideIntermediate
All

The Kimo Bridge security model

What leaves your network, what never does, and how every query is authorized and audited.

Rhea Patel
10 min read
Whitepaper
All

Your Data, Your Rules

The hybrid analytics architecture behind Kimo Bridge: live query pushdown, optional cloud sync, and zero-trust by default.

Arno Visser
22 pages
ArticleProduct
All

Introducing Kimo Bridge: your data stays home

A small package you install next to your database opens a private, outbound-only bridge to Kimo. Query live, store nothing — or sync to our cloud when you want to.

Théo Marchand
7 min read

Your data officer is ready.

Connect a source — or install Kimo Bridge and keep data on your servers — then ask a question and get an answer you can audit.