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
| Agent | Mode | AI Act tier |
|---|---|---|
| Advisor Copilot | Delegated (On-Behalf-Of) | High |
| Fraud Sentinel | Autonomous | Limited |
| Marketing Genie | Autonomous | Minimal, 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
| Pattern | Strength | Weakness |
|---|---|---|
| A. Decide at the gateway | Finest granularity | Bypassable |
| B. Decide at token issuance | Native, no runtime dependency | Session-level only |
| C. Decisions as data in Snowflake | Holds if gateway is bypassed | Needs 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
| Scenario | Result |
|---|---|
| Agent queries more than permitted | Extra columns masked |
| Agent bypasses the gateway | 0 rows |
| PDP unreachable, heartbeat stale | 0 rows |
| Bulk pull of 1,000 rows | Blocked by Data Movement Policy |
| Same human, no agent | Normal 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
- A highly available PDP with mTLS and signed policy bundles.
- Signed human approvals instead of a gateway-asserted boolean.
- A real directory feeding identities and clearances.
- Detection on bypass attempts and heartbeat staleness.
- 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.
Kevin Keller · Personal project, not an official Snowflake solution