Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Access Control Policy Design

ASecurity

USE THIS SKILL whenever any topic related to access control, authorization, permissions, or security policy arises in any form. Triggers include — but are not limited to: RBAC, ABAC, PBAC, ACL, DAC, ReBAC, Zanzibar, OPA, Cedar, Casbin, SpiceDB, OpenFGA, Permify, Oso, Cerbos, Permit.io; any mention of "who can do what", "role", "permission", "policy", "authorization", "multi-tenant access", "least privilege", "Zero Trust", "IAM design", "SaaS permission modeling", "access audit", "compliance a...

78 stars
0 votes
0 copies
1 views
Added 9/19/2026
code-qualitypythonrustgoshellnoderailsdebuggingrefactoringgitci/cd

Works with

cli

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add tan-yong-sheng/ai-vision-mcp --skill access-control-policy-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Access Control Policy Design?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Access Control Policy Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tan-yong-sheng-access-control-policy-design/badge)](https://www.skillsdirectory.com/skills/tan-yong-sheng-access-control-policy-design)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: access-control-policy-design
description: >
  USE THIS SKILL whenever any topic related to access control, authorization, permissions,
  or security policy arises in any form. Triggers include — but are not limited to:
  RBAC, ABAC, PBAC, ACL, DAC, ReBAC, Zanzibar, OPA, Cedar, Casbin, SpiceDB, OpenFGA,
  Permify, Oso, Cerbos, Permit.io; any mention of "who can do what", "role", "permission",
  "policy", "authorization", "multi-tenant access", "least privilege", "Zero Trust",
  "IAM design", "SaaS permission modeling", "access audit", "compliance access control"
  (HIPAA, GDPR, SOC2, PCI-DSS, ISO27001); also trigger when designing any new feature
  that controls what users can see or do, or when reviewing, refactoring, or debugging
  any auth/authz system. When in doubt — trigger this skill. Access control is
  architectural and getting it wrong is expensive.
---

# Access Control Policy Design — Skill Navigator

## What this skill does

Acts as a senior IAM/authorization architect. Covers all major access control paradigms,
hybrid composition patterns, policy engines, compliance mapping, implementation code, and
decision frameworks for modern apps (SaaS, multi-tenant, microservices, cloud-native).

---

## Core Mental Model (always apply this first)

Every access control system answers one runtime question:
> **Should subject S perform action A on resource R right now?**

Models differ in *how* that decision is made. They are **layers, not competitors**:

| Layer | Model | Answers |
|-------|-------|---------|
| Structure | RBAC | Who are you organizationally? |
| Context | ABAC | What conditions apply right now? |
| Governance | PBAC | Who controls the rules and how? |
| Relationships | ReBAC | How do entities connect to resources? |
| Precision | ACL | What's explicitly allowed on this object? |
| Delegation | DAC | What has the owner chosen to share? |

**Key principle:** Most mature systems use 3–4 of these together, with PBAC as the
governance shell wrapping the others. Start simple (RBAC), add layers as complexity demands.

---

## Quick Decision Matrix

| Scenario | Recommended Model(s) | Reference File |
|----------|----------------------|----------------|
| Internal tool, stable job roles | RBAC | `01-rbac.md` |
| Multi-tenant SaaS | RBAC + ABAC | `01-rbac.md`, `02-abac.md` |
| Healthcare / Finance data | ABAC + PBAC | `02-abac.md`, `03-pbac-opa.md` |
| Collaborative hierarchical content | ReBAC | `04-rebac-zanzibar.md` |
| Object-level sharing exceptions | ACL on top of RBAC | `05-acl-dac.md` |
| Consumer app with owner sharing | DAC + guardrails | `05-acl-dac.md` |
| Many microservices, many teams | PBAC (OPA/Cedar) | `03-pbac-opa.md` |
| Zero Trust architecture | RBAC + ABAC + PBAC | `06-hybrid-patterns.md` |
| SOC2 / HIPAA / GDPR compliance | PBAC + audit trail | `08-compliance.md` |
| Early-stage startup (<50 users) | RBAC only | `01-rbac.md` |

---

## Reference Files (load the relevant one per task)

```
references/
├── 01-rbac.md               — RBAC deep dive: design, role taxonomy, anti-patterns, OPA/Casbin code
├── 02-abac.md               — ABAC deep dive: attribute schema, OPA Rego policies, XACML, JWT patterns
├── 03-pbac-opa.md           — PBAC + OPA/Cedar/Casbin: policy-as-code, engine selection, CI/CD
├── 04-rebac-zanzibar.md     — ReBAC/Zanzibar: SpiceDB, OpenFGA, schema design, dual-write patterns
├── 05-acl-dac.md            — ACL + DAC: when to use, guardrails, combining with RBAC
├── 06-hybrid-patterns.md    — Layered defense, multi-tenant patterns, Zero Trust, evolution arc
├── 07-policy-engines.md     — Engine comparison matrix: OPA vs Cedar vs Casbin vs SpiceDB vs Permify
├── 08-compliance.md         — HIPAA, GDPR, SOC2, PCI-DSS, ISO27001 — exact mapping + audit schema
└── 09-code-examples.md      — Ready-to-use code: Python, Node.js, Go across all models
```

**When to load which file:**
- User asks about a specific model → load that model's reference file
- User asks about implementation / code → load `09-code-examples.md` + model file
- User asks about tool/engine selection → load `07-policy-engines.md`
- User asks about compliance → load `08-compliance.md`
- User is designing multi-tenant or microservices → load `06-hybrid-patterns.md`
- User is debugging broken access / role explosion → load `06-hybrid-patterns.md` §Warning Signs

---

## Evolution Arc (how real systems grow)

```
Phase 1 — Early product:     RBAC (Admin / User / Viewer). Fast, auditable.
Phase 2 — Multi-tenant:      RBAC + ABAC (tenant_id attribute, conditional access).
Phase 3 — Multiple services: PBAC layer (OPA/Cedar policy engine, decoupled from code).
Phase 4 — Collaborative:     ReBAC (hierarchical resource ownership + sharing graph).
Phase 5 — Enterprise/regulated: Full hybrid — RBAC+ABAC+PBAC+ReBAC, audit logging,
                                 access certification, anomaly detection.
```

---

## Universal Rules (apply regardless of model chosen)

1. **Deny by default** — explicit ALLOW, implicit DENY everywhere
2. **Enforce server-side** — UI hints only; never trust client-side permission checks
3. **Log every decision** — allow AND deny, with subject/action/resource/reason/timestamp
4. **Least privilege** — grant minimum access required; time-bound temporary elevations
5. **Version policies** — treat authorization rules as code: review, test, deploy, roll back
6. **Quarterly access reviews** — permissions rot without active curation
7. **Test both allow and deny** — missing a deny test is a security gap

---

## Warning Signs (diagnose broken access control fast)

| Symptom | Root Cause | Fix |
|---------|------------|-----|
| Role count doubles every quarter | RBAC role explosion | Introduce ABAC attributes |
| "We have a role for that" for every edge case | RBAC over-stretch | ABAC conditions |
| Different services enforce the same rule differently | Authorization scatter | PBAC engine |
| Can't answer "who has access to X?" | ACL sprawl | Centralize with PBAC |
| Audit takes days to compile | No central access log | Structured decision logging |
| Access doesn't revoke when user changes teams | Role creep | Access certification process |
| Sharing causes accidental data exposure | Unbounded DAC | DAC guardrails / boundaries |
| One engineer understands all the auth rules | ABAC policy sprawl | PBAC + documentation |

---

## Two-Question Clarity Test

**Q1: What will be harder in 6 months — explaining access decisions, or changing them safely?**
- Hard to *explain* → ABAC/PBAC + visibility tooling
- Hard to *change safely* → PBAC governance layer before system becomes brittle

**Q2: Does "same action" need different decisions based on context?**
- YES → ABAC is mandatory
- NO → Pure RBAC may be sufficient for now


## Online Sources
  - https://www.loginradius.com/blog/identity/how-access-control-models-work
  - https://www.openpolicyagent.org/docs/comparisons/access-control-systems
  - https://www.osohq.com/learn/abac-with-open-policy-agent-opa
  - https://authzed.com/learn/google-zanzibar
  - https://authzed.com/docs/spicedb/concepts/zanzibar
  - https://github.com/openfga
  - https://auth0.com/blog/how-to-choose-the-right-authorization-model-for-your-multi-tenant-saas-application
  - https://www.permit.io/blog/authorization-with-open-policy-agent-opa
  - https://www.styra.com/blog/enforcing-role-based-access-control-rbac-policies-with-opa/

Attribution

tan-yong-shengtan-yong-sheng
View sourceMore from tan-yong-sheng →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman Review

Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /caveman-review. Auto-triggers when reviewing pull requests.

1066601 votes

Caveman Commit

Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit. Auto-triggers when staging changes.

1066601 votes

Verification Loop

一个全面的 Claude Code 会话验证系统。

2456590 votes

Springboot Verification

Verification loop for Spring Boot projects: build, static analysis, tests with coverage, security scans, and diff review before release or PR.

2456590 votes

Django Verification

Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.

2456590 votes
View all in code-quality →