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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
L
LangChain Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
D
Docker
WordPress大学
WordPress大学
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky

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) 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 Row-level security for Apache Trino, powered by Cerbos Synapse
Agent skill for writing authorization policies
Alex Olivier · 2026-04-21 · via Cerbos - All Posts

Writing authorization policies has always been the bit I wanted to make easier. The Cerbos policy language is expressive, the CEL conditions are powerful, but there's still a learning curve when you're staring at a blank file trying to model your access control requirements.

So we built a skill that does it for you: https://github.com/cerbos/skills

What it actually does

You describe what you need in plain English. "Editors can update posts in their own department. Admins can do everything. Viewers are read-only except they can't see salary data." That kind of thing.

The skill asks you clarifying questions until it has a clear picture of your resources, roles, actions, and conditions. It'll also push back on things that seem too broad. Say "admins can do everything" and it'll ask whether admins really need delete access, or whether you want an explicit list of actions. 5 years of helping teams model their authorization has taught us that the vague requirements are where security holes hide, so the skill steers you toward least-privilege and explicit deny-by-default from the start.

Once it has a clear spec, it generates everything in one pass: schemas, derived roles, resource policies, test fixtures, and test suites. The generated policies follow patterns we've seen work across hundreds of production deployments. Things like scoping derived roles tightly, using attribute conditions instead of role proliferation, and structuring tests to cover both the allowed and denied paths.

Once the files are written, it runs cerbos compile via Docker to validate the whole bundle. If something fails (and sometimes it does), the skill reads the errors and fixes them. It keeps iterating until the compiler is happy or it's tried 3 different fixes for the same problem, at which point it tells you what's wrong and lets you take over.

The workflow

There are 5 phases, and the skill follows them in order:

  1. Spec intake. Asks questions in plain business language ("who can delete a project?") until roles, resources, actions, and conditions are nailed down. Nudges you toward zero trust principles along the way: explicit permissions over implicit ones, narrow scopes over broad grants. Produces a short spec and confirms it with you before writing anything.

  2. Write. Generates all files in a single batch: schemas first, then derived roles and shared variables, then policies, then test data and test suites. Every generated policy follows the same patterns we use internally and recommend to customers. No wildcard actions, no overly permissive defaults, conditions on every rule that needs them.

  3. Validate. Runs docker run --rm -v "$(pwd):/policies" ghcr.io/cerbos/cerbos:latest compile /policies and check for any errors.

  4. Fix. If validation fails, it works through errors in priority order: YAML syntax, schema validation, compile errors, then test failures. One fix per iteration. Never deletes a test to make things pass (that rule is in there because I know how tempting it is).

  5. Finalize. Reports what was created and flags any assumptions it made along the way.

What you get

A complete policy bundle ready to drop into your Cerbos PDP:

  • _schemas/ with your principal and resource attribute schemas
  • derived_roles/ with shared role definitions and exported variables
  • resource_policies/ (or role_policies/) with your actual authorization rules
  • testdata/ with fixtures and test suites that exercise your policies

Install it

Works with Claude Code, Cursor, Codex, OpenCode, and a bunch of other agents.

npx skills add cerbos/skills --skill cerbos-policy

If you're using Claude Code directly:

claude plugin marketplace add cerbos/skills

The repo is at github.com/cerbos/skills.

Why we built this

Cerbos policies are code. They live in your repo, they're version controlled, they're testable. That makes them a natural fit for AI coding agents that already live in your editor and understand your codebase.

The tricky part was getting the output right. Authorization policies have sharp edges. A missing condition or a wrong role binding and you've got a security hole. So we packed the skill with the full Cerbos reference material (policy schemas, CEL patterns, testing recipes) and wired it to always validate against the real compiler. The agent doesn't just generate YAML and hope for the best. It proves the policies compile.

We also baked in 5 years of learnings from working with teams building authorization. Every recommendation the skill makes, from how it structures derived roles to how it models attribute conditions to how it generates test cases, comes from patterns we've seen succeed (and fail) in production. The zero trust defaults, the preference for explicit deny, the way it pushes you to define schemas upfront: that's all stuff we learned the hard way by watching what breaks when you skip it.

We've been using this internally for a few months now and it's genuinely changed how fast we can put together policy bundles for demos and customer POCs. I think it'll save you a fair amount of time too, especially if you're new to Cerbos and want to get something working quickly without picking up bad habits along the way.

Give it a try and let us know how you get on. We're tracking feedback and bug reports on the GitHub repo.


For a general guide on how to write, test, and validate authorization policies - read this write-up.

Using a specific agent? The Cerbos policy skill works in these and other tools: