Engineering Auth Permissions

Permission Matrix Prompt

Make access auditable — a roles-by-actions matrix that shows exactly who can do what, exposes the gaps and over-grants, and becomes the spec the code is checked against.

Overview

Authorization that lives only in code is impossible to audit — no one can answer 'who can delete this?' without grepping. This prompt builds a permission matrix: roles across the top, actions/resources down the side, allow/deny in every cell, with the over-grants and missing denies flagged. It's the artifact that turns access control into something you can review and the code into something you can check against.

How to use this resource

  1. Define the roles and actions

    List the roles in the system and the sensitive actions and resources they might touch. The matrix is built from these two axes.

  2. Open this resource in Markdown Output Builder

    Load the prompt into Markdown Output Builder and fill in your roles and actions. It returns the allow/deny matrix as a clean Markdown table you can drop into your docs.

  3. Review the matrix and findings

    Walk the allow, deny, and conditional cells, then read the flagged over-grants, missing denies, and orphaned actions, ranked by risk.

  4. Close the gaps before you build

    Resolve the over-grants and missing denies the matrix exposes, then use it as the spec your authorization code is checked against.

Why This Works

  • A matrix makes over-grants visible that code review can't see
  • Forcing every sensitive cell to be explicit removes silent default-allow
  • It becomes the spec the implementation is checked against

Best for

  • Systems where access mistakes are costly
  • Compliance or security reviews needing an access map
  • Teams that can't currently answer 'who can do X?'

Not for

  • Designing the roles themselves — use the RBAC Design Prompt
  • Reviewing the implementation — use the Authorization Review Prompt

Use cases

  • Documenting who can do what across roles
  • Auditing access control for over-grants
  • Producing the spec authorization code is reviewed against

FAQ

What exactly does this prompt produce for each role-action pair?

One cell marked ALLOW, DENY, or CONDITIONAL, where conditional cells name the condition (e.g. 'own records only'), plus a scope column stating whether allow means all records or only owned/scoped ones. The markdown-output-builder returns this as a clean Markdown table. It's a documented spec to review against your code — a plan, not a validated check of what your system actually enforces.

How does this matrix surface access problems I can't see in code review?

The FINDINGS step flags over-grants (a role with more than its job needs), missing denies (sensitive actions with no explicit deny), and orphaned actions no role can perform, ranked by risk. The RULES force every sensitive action explicit for every role — "no blank cells" — removing silent default-allow. Treat the flagged findings as items to resolve and confirm in code, not as a security certification.

Will this prompt design my roles or audit my authorization implementation?

Neither — it maps existing roles against actions. notFor is explicit: designing the roles is the RBAC Design Prompt, and reviewing the implementation is the Authorization Review Prompt. This one takes roles and sensitive actions you supply and builds the allow/deny matrix, calling out high-risk rows like delete, export, impersonate, and change-permissions to confirm each is tightly scoped.

More resources from Markdown Output 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.