Semantic Layer Guide - Architecture, Logic, and Operations

YAML

access_policy: - name: regional_manager_rls description: Restricts sales data visibility to the user’s assigned region. role: regional_manager row_level_filters: - field: customers.region operator: equals value: ‘{{ security_context.user_region }}’ By evaluating these access rules at query-compile time, a semantic layer ensures that a human analyst or an AI agent literally cannot query data they are not authorized to see. The rules become an inescapable property of the SQL generation itself, rather than a fragile filter applied after the fact. While the semantic layer enforces data access policies downstream, the semantic code repository itself requires equally rigorous governance. Maintaining a trustworthy single source of truth requires clear code ownership, pull-request approval workflows, and strict CI/CD testing before definitions are merged into production. We will explore exactly how to structure these maintenance workflows later in the Operationalizing the Semantic Layer section.

Semantic Layer Guide © Scalefree International GmbH 2026

15

Powered by