惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
WordPress大学
WordPress大学
雷峰网
雷峰网
小众软件
小众软件
D
DataBreaches.Net
V
Visual Studio Blog
博客园 - Franky
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
博客园 - 聂微东
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
云风的 BLOG
云风的 BLOG

Cerbos - All Posts

Authentik vs Keycloak: Self-hosted IdP comparison Mapping business requirements to authorization policy for automotive Fine-grained authorization for AI gateways EIC 2026: Stop counting agents, protect what they can touch Agent skill for writing authorization policies in Claude Desktop Identity security in 2026 EIC 2026 takeaways: the identity stack built for humans will not hold up for AI agents Already have authentication? Here's the authorization layer you still need. Tokens are authorization decisions: a guide to policy-driven token issuance What is a Runtime Authorization Platform It's a dimmer switch, not a kill switch. How CISOs are rethinking AI agent governance From maps to bitmaps (and from bitmaps to bitmaps) AuthZEN, Shared Signals, SCIM Events, IPSIE: Notes from the OpenID Enterprise Panel How do you update authorization policies without redeploying your application? IIW42 recap: Where agent authorization got real Cerbos PDP v0.52.0/v0.53.0: Engine performance, security hardening, and CEL path functions Authorization Management Platforms: what they do, how they work, and where they fit PocketOS AI coding agent deleted a production database in 9 seconds Non-Human Identity management still has a blind spot Supabase alternative in 2026: Best open source auth options Benefits of on-premise authorization: Why enterprises are moving toward self-hosted Authorization policies: How to write, test, and validate them (faster with AI) Agent skill for writing authorization policies How much does it cost to build authorization in-house? Why centralized authorization governance reduces incident response time OPA alternative Why AI agents make authorization a right now problem Modernizing legacy application authorization: why it’s your biggest security blind spot How to add authorization to legacy applications without code changes 5 authorization blind spots auditors find, and how to fix them
Cerbos Prisma integration v2.0: More powerful fine-graine...
Alex Olivier · 2025-03-17 · via Cerbos - All Posts

Authorization is a critical component of modern applications, ensuring users have the right level of access to data without embedding complex rules into application code. Cerbos’ Query Plan API has long been a valuable tool in this space, enabling dynamic filtering of data based on pre-defined policies.

With our latest update to the reference Prisma Query Plan Adapter, we’ve significantly expanded its capabilities, making it even easier to enforce fine-grained access control within applications using Prisma ORM. In this blog post, we’ll explore the new features, use cases enabled, and how you can start using it today.

What’s new in the Prisma Query Plan Adapter?

The new version of the Cerbos Prisma ORM Adapter introduces several powerful enhancements that make it more flexible and robust.

1. Expanded operator support

Previously, the adapter supported basic logical and comparison operators. The new release now adds support for:

  • String operations: startsWith, endsWith, contains, isSet
  • Advanced relation operators: every, exists, exists_one, all, filter
  • Set operations: hasIntersection

This makes it easier to apply more complex conditions directly in your Prisma queries.

2. Deep nested relations support

One of the biggest enhancements is full support for deep nested relations, allowing policies to filter data based on attributes from related models.

Example

Previously, filtering based on a related model required additional logic outside the adapter. Now, you can express such conditions naturally within your policies:

condition:
  match:
    expr: request.resource.attr.nested.aBool == true

With a simple field mapper, this is now seamlessly converted into a Prisma where clause:

const result = queryPlanToPrisma({
  queryPlan,
  mapper: {
    "request.resource.attr.nested.aBool": "nested.aBool",
  },
});

3. Automatic field inference and type-safe mapping

The adapter can now automatically infer field names and relationships based on policy expressions. And stronger TypeScript support ensures mappings are type-safe and easier to maintain.

4. Improved collection handling

With better support for collections, policies can now check for attributes across multiple related records. This enables more granular enforcement of rules such as:

  • Ensuring at least one related record meets a condition (some)
  • Ensuring all related records meet a condition (every)
  • Checking for the existence of related records (exists)

5. Performance optimizations

The internal logic of the adapter has been optimized for efficiency, ensuring that generated Prisma queries remain performant even as complexity increases.

New use cases enabled

These enhancements open up a range of new use cases for Prisma users integrating Cerbos, such as:

  • Complex hierarchical permissions – Filter records based on parent-child relationships.
  • Multi-tenant applications – Enforce tenant isolation without hardcoded application logic.
  • Content moderation systems – Apply rules based on nested user-generated content.
  • E-commerce platforms – Implement access control based on product ownership or purchase history.

Getting started with Cerbos and Prisma

If you're already using Cerbos and Prisma, upgrading to the new adapter is straightforward.

Installation

npm install @cerbos/orm-prisma

Usage

Integrate the adapter into your Prisma queries:

import { queryPlanToPrisma, PlanKind } from "@cerbos/orm-prisma";

const result = queryPlanToPrisma({
  queryPlan, // generated by the Cerbos PDP
  mapper: {
    "request.resource.attr.owner": { 
         relation: { 
            name: "owner", 
            type: "one" 
         }
     },
     "request.resource.attr.status": { 
          field: "status"
      },
  },
});

if (result.kind === PlanKind.ALWAYS_DENIED) {
  return [];
}

const records = await prisma.resource.findMany({ 
   where: result.filters 
});

Cerbos Prisma ORM Adapter - Try it now

Upgrade your existing integration or start from scratch with our updated documentation and examples.

For more details, check out the official GitHub repository or join the Cerbos community Slack to discuss best practices and real-world implementations.