Cerbos agent skills
Build authorization with your coding agent
Cerbos keeps access rules in policies instead of your application code, and your app asks it for each decision. Our skills teach your coding agent to write, test and enforce those policies, and ship them through Cerbos Hub.
Paste this into your coding agent
Set up Cerbos using cerbos.dev/agents.md
Works in Claude Code, Codex, Cursor, Copilot, Gemini CLI, Grok and most other agents. The agent asks before it installs anything.
claude Β· expenses-api
Managers can approve expenses for their own team, up to $5,000. Add that.. Skill cerbos. Skill cerbos-policy. Writing a Cerbos policy for the manager approval rule, then I'll wire the check into the Express route.. Write cerbos/policies/resource_policies/finance/expense.yaml. Write cerbos/policies/resource_policies/finance/expense_test.yaml. Bash cerbos compile cerbos/policies. 5 tests executed [5 OK]. Bash npm install @cerbos/http. Edit src/server.js. Added 17 lines, removed 2 lines. Bash cerbos server, then curl the approve route. $1,200 β 200 Β· $7,500 β 403 Β· other team β 403. Managers can now approve expenses for their own team, up to and including $5,000. Everyone else gets a 403.
A recorded Claude Code session with the Cerbos skills on a sample Express app, condensed to its main steps.
Install it in your agent
Each agent installs the same plugin from the cerbos/skills repository, and updates from it with one command.
claude plugin marketplace add cerbos/skillsclaude plugin install cerbos-skills@cerbos-skills
Update with claude plugin marketplace update cerbos-skills.
What the plugin runs
The plugin contains skills only. It has no hooks, no MCP servers and no background processes, and it sends no data anywhere itself. Your agent asks before running commands the skills don't pre-approve, and the README lists what each skill runs. Policy uploads and decision logs go to your own Cerbos Hub workspace, and only once you set them up. See what each skill runs
claude Β· expenses-api
Managers can approve expenses for their own team, up to $5,000. Add that.. Skill cerbos. Skill cerbos-policy. Writing a Cerbos policy for the manager approval rule, then I'll wire the check into the Express route.. Write cerbos/policies/resource_policies/finance/expense.yaml. Write cerbos/policies/resource_policies/finance/expense_test.yaml. Bash cerbos compile cerbos/policies. 5 tests executed [5 OK]. Bash npm install @cerbos/http. Edit src/server.js. Added 17 lines, removed 2 lines. Bash cerbos server, then curl the approve route. $1,200 β 200 Β· $7,500 β 403 Β· other team β 403. Managers can now approve expenses for their own team, up to and including $5,000. Everyone else gets a 403.
A recorded Claude Code session with the Cerbos skills on a sample Express app, condensed to its main steps.
From prompt to policy
Tell your agent who should be able to do what, in your own words. You usually don't need to name Cerbos. The starter skill, cerbos, recognizes an access-control problem, works out which parts of Cerbos it needs and hands off to the skill that builds them.
Step 1
Describe the rule
Tell your agent who can do what, in plain words. The session above started from this one sentence.
Step 2
Get policies with tests
Your agent writes the Cerbos policy and its test suite, then compiles both until every test passes.
Step 3
Enforce it in your code
It adds a Cerbos SDK check to your code. The SDK asks a policy decision point (PDP), a Cerbos service beside your app.
Step 4
Ship it through Cerbos Hub
Create a free Hub account and approve the sign-in. Your agent connects your PDP, so rule changes ship without a release.
Sign up for Cerbos Hub
What the agent produced
The policy, tests and code change from the session above, as the agent wrote them.
cerbos/policies/resource_policies/finance/expense.yaml
apiVersion: api.cerbos.dev/v1
resourcePolicy:
version: "default"
resource: "expense"
schemas:
principalSchema:
ref: "cerbos:///principal.json"
resourceSchema:
ref: "cerbos:///resources/expense.json"
rules:
# Managers sign off their own team's expenses; anything over $5,000 needs someone else.
- name: manager-approves-own-team-up-to-5000
actions: ["approve"]
roles: ["manager"]
effect: EFFECT_ALLOW
condition:
match:
all:
of:
- expr: R.attr.team == P.attr.team
- expr: R.attr.amount <= 5000
Try prompting your agent
Copy a prompt into Claude Code, Codex, Cursor, Copilot, Gemini CLI, Grok or any agent with the skills installed. Each one names the skill it uses.
Only managers should see salary fields in the employee API. Set that up.
Follow the cerbos skill.
Turn this access-control spec into Cerbos policies with tests.
Follow the cerbos-policy skill.
Filter the documents list so people only see records they're allowed to view.
Follow the cerbos-pep-integration skill.
Hide the delete button for users who can't delete this project.
Follow the cerbos-embedded-pdp skill.
What your agent learns
Eight skills cover authorization from the first design question to the audit trail. Your agent reads a skill's full instructions only when your request calls for it.
cerbos
Starts here, and picks the parts of Cerbos your request needs.
Cerbos PDP
cerbos-policy
Resource and role policies, conditions and test suites.
cerbos-pep-integration
SDK checks in eight languages, list filtering and agent tool calls.
cerbos-authz-migration
Moves checks out of code or off OPA, Casbin, OpenFGA and others.
Cerbos Hub
cerbos-hub-setup
Policy stores, deployments, PDP connections and rollback.
cerbos-embedded-pdp
Checks in the browser, at the edge and in serverless, in WebAssembly.
cerbos-audit-insights
Decision logs, masking, and why a request was denied.
Cerbos Synapse
cerbos-synapse-extension
Adds data to requests and enforces policy at gateways.
cerbos
Starts here, and picks the parts of Cerbos your request needs.
Cerbos PDP
Policies, and the checks that ask for decisions
cerbos-policy
Resource and role policies, conditions and test suites.
cerbos-pep-integration
SDK checks in eight languages, list filtering and agent tool calls.
cerbos-authz-migration
Moves checks out of code or off OPA, Casbin, OpenFGA and others.
Cerbos Hub
Ship, embed and audit those policies
cerbos-hub-setup
Policy stores, deployments, PDP connections and rollback.
cerbos-embedded-pdp
Checks in the browser, at the edge and in serverless, in WebAssembly.
cerbos-audit-insights
Decision logs, masking, and why a request was denied.
Cerbos Synapse
Add data and enforce at gateways
cerbos-synapse-extension
Adds data to requests and enforces policy at gateways.
When the rule changes
Raise the limit from $5,000 to $10,000. Hard-coded, the rule lives in every service that checks it, so each one changes and ships on its own. In Cerbos, it lives in one policy.
Hard-coded in each service
expenses-apiJavaScript
approvals-workerGo
finance-reportsPython
In one Cerbos policy
expenses-api
β Updated
approvals-worker
β Updated
finance-reports
β Updated
Same request, different answers
A sales manager approves a $7,500 sales expense on Tuesday, mid-rollout.
Until the last service ships, the answer depends on which service the request reaches. With Cerbos, every PDP has the new limit within seconds.
Example services. The same holds for however many services check the rule.
Give your agent a place to ship
Cerbos Hub tests the policies your agent writes, rolls them out to every PDP and keeps an audit trail of decisions. Start on the free Proof of Concept plan.
The Cerbos platform handles more than 2 billion authorization checks a month.