Skip to content

API Reference parrot.semantic.governance.rls

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.semantic.governance.rls

View source

RLS push-down: filtered base scans below aggregation, typed literals, fail closed.

Alias PermissionContext

Re-exported from parrot.auth.PermissionContext.

Alias PhysicalSchema

Re-exported from parrot.semantic.loader.PhysicalSchema.

Alias RlsPredicate

Re-exported from parrot.auth.RlsPredicate.

Class RlsPushdown

Apply registry RLS rules to qualified physical table scans.

Parameter Type Default Description
registry RlsRegistry Registry used to look up and render row-level rules.

Method RlsPushdown.apply

Wrap every RLS-governed base scan as a filtered subquery below aggregation.

apply(tree: exp.Expression, ctx: PermissionContext, driver: str) -> tuple[exp.Expression, tuple[str, ...], set[int]]

Parameter Type Default Description
tree exp.Expression Qualified query AST. The caller-owned tree is never mutated.
ctx PermissionContext Trusted request-local permission context.
driver str Canonical physical driver used by the registry.

Returns: tuple[exp.Expression, tuple[str, ...], set[int]] — The rewritten tree, applied rule descriptions without values, and identities of nodes injected by this pass.

Raises:

  • SemanticAccessError — If schema binding is absent, rule rendering fails, or a source cannot be rewritten deterministically.

Alias RlsRegistry

Re-exported from parrot.auth.RlsRegistry.

Alias SemanticAccessError

Re-exported from parrot.semantic.errors.SemanticAccessError.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally