Engineering Auth RBAC

RBAC Design Prompt

Design a role model that scales — roles derived from real permissions, the role-permission mapping, and the inheritance and edge cases before you hardcode 'isAdmin'.

Overview

RBAC done wrong becomes a tangle of special-case checks and a role nobody dares change. This prompt designs the model properly: it starts from the actual permissions the system needs, groups them into roles that map to real jobs, defines inheritance and the deny rules, and pressure-tests the edge cases (the admin who shouldn't see billing, the cross-team access) before any of it is code.

How to use this resource

  1. Define the permissions and actors

    Note what the system does, the kinds of users, and the sensitive operations. The model is derived from real permissions, not from role names.

  2. Open this resource in Multi-Step Prompt Builder

    Load the prompt into Multi-Step Prompt Builder and fill in your context. Building it in stages keeps the permissions, roles, mapping, and edge cases each fully worked out.

  3. Review the role model

    Read the permission list, the roles, the role-permission mapping, and how the edge cases - temporary access, cross-team, service accounts - resolve within the model.

  4. Tighten the model and re-run

    Adjust any role that became an arbitrary bucket or any missing deny, then regenerate before you hardcode the checks.

Why This Works

  • Starting from permissions stops roles from becoming arbitrary buckets
  • Explicit deny rules catch the leak that a missing grant would allow
  • Designing edge cases into the model avoids the special-case checks that rot RBAC

Best for

  • Systems with more than two or three user types
  • Apps where access mistakes leak data
  • Teams about to hardcode role checks

Not for

  • Reviewing existing authorization code — use the Authorization Review Prompt
  • Building the permission matrix artifact alone — use the Permission Matrix Prompt

Use cases

  • Designing roles and permissions for a new system
  • Replacing a tangle of isAdmin checks with a real model
  • Mapping permissions to roles before implementation

FAQ

Why does the RBAC design prompt enumerate permissions before defining any roles?

The prompt puts PERMISSIONS FIRST — it lists discrete permissions as verb + resource independent of roles, then groups them into roles under a hard rule: 'Derive roles from permissions, never the reverse.' Doing it in this order stops roles from becoming arbitrary admin/user buckets, because every role has to justify itself against real permissions in the role-permission matrix.

How does the RBAC design prompt keep service accounts and temporary elevation from turning into special-case checks?

Its EDGE CASES step names the awkward actors directly — elevated temporary access, cross-team, service accounts, the super-admin — and asks how the model handles each 'without special-casing.' Instead of an if-branch, each resolves through the permission list and explicit denies, so the OUTPUT shows how those edge cases sit inside the same role-permission matrix.

When should I use the RBAC design prompt instead of an authorization review or permission matrix prompt?

Reach for this when you're designing a role model from scratch — deriving permissions, roles, inheritance, and deny rules before any code. Its notFor points elsewhere: reviewing existing authorization code belongs to the Authorization Review Prompt, and building just the matrix artifact belongs to the Permission Matrix Prompt. This one produces the whole model, edge cases included.

Will the RBAC design prompt guarantee my access model has no security holes?

It doesn't — running it through Multi-Step Prompt Builder produces a design (permission list, roles, matrix, edge-case resolution) that you run in your own assistant and must review. Workflow step 4 exists for exactly this: tighten any role that became an arbitrary bucket or any missing deny, then regenerate. It's a design aid, not a substitute for a security audit or production validation.

More resources from Multi-Step Prompt Builder

Resources that pair well

Related tools

Projects that use this resource

Workflows that use this resource

Guides for this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.