if user.is_admin. This skill applies RBAC design, the principle of least privilege, separation of duties, and break-glass emergency procedures to define the complete admin surface before it is built.
Best for
- Designing the admin panel and permission system for any multi-role application
- Formalizing who can do what before building authorization logic, rather than deciding it ad hoc in code
- Satisfying compliance requirements for access control and audit logging (SOC 2, PCI-DSS, ISO 27001)
- Defining emergency access procedures for when normal access is unavailable or compromised
What it produces
The generated document covers:- Overview — what system this governs, how many distinct privilege levels it has
- Role inventory — every role with description and assignment criteria, including implicit roles (system service accounts, support staff, platform-level super-admins)
- Permission matrix — complete role × action table with explicit
AlloworDenyin every cell — no blanks - Role assignment rules — inheritance model, mutual exclusivity rules, maximum roles, auto-assignment, revocation rules
- Conditional permissions (ABAC) — context-dependent rules by ownership, temporal, environmental, user state, and resource state attributes
- Permission implementation map — per permission: API layer enforcement, UI layer enforcement, database row-level enforcement, cache strategy, invalidation triggers, maximum propagation delay
- Sensitive actions and separation of duties — actions requiring dual approval, risk if misused, approval workflow
- Audit logging specification — fields logged (actor, action, target, timestamp, before/after state, service identity), retention period, who can read the log, and who explicitly cannot alter it
- Break-glass / emergency access procedure — trigger conditions, invocation steps (request → approval → grant → alert → auto-expiry → post-use review), what is logged during emergency sessions, failure mode fallback
- Permission testing strategy — positive tests, negative tests, privilege escalation tests, boundary tests, matrix completeness tests, cross-tenant isolation tests; coverage target: 100% of matrix cells
- Access review cadence — quarterly review schedule, document owner, off-cycle review triggers
How to invoke it
Example scenarios
Multi-tenant SaaS roles
Internal tool with break-glass
Audit logging design
Compliance preparation
Key concepts
RBAC — roles, not direct user permissions
RBAC — roles, not direct user permissions
Allow or Deny in every cell. No cell should be left undecided — an undecided permission becomes a bug (either a silent block or a silent hole) the first time someone hits it.Principle of least privilege
Principle of least privilege
Separation of duties — dual approval for destructive actions
Separation of duties — dual approval for destructive actions
ABAC — context-dependent permission rules
ABAC — context-dependent permission rules
Audit logging — every privileged action, immutably
Audit logging — every privileged action, immutably
- Who — user ID and role at time of action
- What — specific action taken
- Target — affected resource or user
- When — UTC timestamp
- Before/after state — for change operations, where feasible
- Service identity — for machine-to-machine calls: service ID and permission scope
Break-glass emergency access — documented, logged, and time-limited
Break-glass emergency access — documented, logged, and time-limited
- Trigger conditions (e.g., production incident requiring elevated DB access)
- Invocation method (e.g.,
/emergency-accessSlack command) - Approval requirement (auto-approved for P1 incidents, manual otherwise)
- Automatic alerting on grant (
#securitySlack, PagerDuty, email to security team) - Auto-expiry after a defined maximum window (e.g., 4 hours)
- Post-use review — required, performed by someone who did not use the access
Multi-tenant isolation — platform admin vs. tenant admin
Multi-tenant isolation — platform admin vs. tenant admin
- A tenant admin can see and manage only their own tenant’s users and data — never another tenant’s
- A platform admin can see across tenants, but every cross-tenant action is logged and requires justification
- Every data query is scoped to
tenant_id— no query should return data across tenant boundaries - Testing requirement: an automated test case must attempt cross-tenant data access and verify it is blocked
Permission caching — staleness is a security window
Permission caching — staleness is a security window
Interview process
Phase 1: Socratic clarification (mandatory)
.engineering-docs/ files. Up to 3 questions: which actions would cause the most damage if misused (data export, refunds, impersonation, deletion, permission changes), and whether the system serves multiple separate organizations who must never see each other’s data.Phase 2: Role inventory (40–60 min)
Phase 3: Resource and action inventory (60–90 min)
Phase 4: Permission matrix (1.5–2 hrs)
Phase 5: Separation of duties and sensitive actions (40–60 min)
Phase 6: Audit logging specification (40–60 min)
Phase 7: Break-glass procedure (30–45 min)
Phase 8: Revision (after user review)
last_updated.Output structure
The generated.engineering-docs/11-admin-access-control-specification.md follows this structure:
Handoff
Reads from
4-technical-specification.md— functional requirements, user roles7-system-architecture.md— system components, services, trust zones8-database-design-document.md— data entities that permissions govern9-api-design-document.md— API actions that require access control
Feeds into
12-security-threat-model.md— privilege model and trust boundaries for threat analysis14-technical-blueprint.md— access control requirements for feature designs15-implementation-plan.md— auth/permissions as a foundation build phase
Quality gate
- Every role in the inventory has a clear description and defined assignment criteria
- The permission matrix has zero blank cells — every role/action intersection is explicitly
AlloworDeny - Every sensitive action (data export, impersonation, deletion, financial operations) is listed in the Separation of Duties table
- Audit logging specification covers who, what, when, and target for every privileged action, and specifies who cannot alter logs
- Break-glass procedure includes trigger conditions, invocation authority, auto-expiry, alerting, and mandatory post-use review
