Agent authorisation

Author policy once. Enforce it inside the database.

A central Cedar policy engine, with Snowflake as the enforcement point per column, per row and per session.

Kevin Keller · kevinkeller.org

Why it matters

Security teams want one policy engine for all AI agents

  • Cedar as the policy language: readable, analysable, open source.
  • OpenID AuthZEN 1.0 as the vendor-neutral decision API.
  • A central PDP, owned by security architecture, as the system of record.
Where does Snowflake fit, without becoming a second, competing policy engine?

The scenario

A European bank, three agents, strict rules

AgentModeAI Act tier
Advisor CopilotDelegated (On-Behalf-Of)High
Fraud SentinelAutonomousLimited
Marketing GenieAutonomousMinimal, revoked

One decision per column and row scope. No PDP means no data.

The policies

Regulation becomes readable Cedar rules owned by security

  • A delegated agent gets the intersection of its ceiling and the human's clearance.
  • AI Act Art. 14: high-risk agents need human approval for the most sensitive data.
  • GDPR purpose limitation: personal data only for a registered, allowed, declared purpose.
  • A registry kill switch and confused-deputy guards.

The weak spot

A gateway alone is only as strong as the gateway

  • A gateway bug lets requests through.
  • An agent asks for two columns and queries five.
  • An agent skips the gateway with its perfectly valid Entra token.

All of these go straight through if enforcement lives only at the gateway.

Three patterns

Combine runtime decisions with enforcement in the engine

PatternStrengthWeakness
A. Decide at the gatewayFinest granularityBypassable
B. Decide at token issuanceNative, no runtime dependencySession-level only
C. Decisions as data in SnowflakeHolds if gateway is bypassedNeeds sync and freshness

The demo combines A and C, and uses B where it fits.

The idea

The PDP pushes each permit into Snowflake as a decision grant

Horizon policies reveal data only where a live, session-bound grant exists. Policy is authored in one place, and enforced in two.

How Snowflake enforces it

One question: did the PDP permit this, for this session, recently?

  • Grants are bound to session, identity and role, with a short TTL.
  • One tag puts every governed column under tag-based masking.
  • Row access policies enforce row scopes such as data residency.
  • A stale PDP heartbeat fails closed. Humans without an agent keep normal RBAC.

What the scenarios prove

The design holds in the cases that matter

ScenarioResult
Agent queries more than permittedExtra columns masked
Agent bypasses the gateway0 rows
PDP unreachable, heartbeat stale0 rows
Bulk pull of 1,000 rowsBlocked by Data Movement Policy
Same human, no agentNormal access

Defence in depth

Two Horizon controls work even if a Cedar policy is wrong

  • Restricted Session Scope: every agent session capped at read-only
  • Data Movement Policy: 200 classified rows per statement, no external unload
  • Audit: query and access history joined to PDP decisions and policy hash
  • Evidence: who asked, which agent, which rule version

Before production

A readable demo, not a deployable system

  1. A highly available PDP with mTLS and signed policy bundles.
  2. Signed human approvals instead of a gateway-asserted boolean.
  3. A real directory feeding identities and clearances.
  4. Detection on bypass attempts and heartbeat staleness.
  5. Route agents through agentic OAuth, not passwords or key pairs.

The takeaway

A central PDP and a governed data platform are two halves of one answer.

Read the full article

Kevin Keller · Personal project, not an official Snowflake solution