# Permission Matrix Drafting

> Draft the endpoint-by-actor expectation matrix before running a single test, so results are judged against a written expectation. Use when you have an endpoint inventory and actor list and need an executable statement of what each combination should return

- Skill: `wsh7ash/permission-matrix-drafting` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/permission-matrix-drafting`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/permission-matrix-drafting/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/permission-matrix-drafting

---


# Permission Matrix Drafting

> Draft the endpoint-by-actor expectation matrix before running a single test, so results are judged against a written expectation

**Use when:** you have an endpoint inventory and actor list and need an executable statement of what each combination should return

**Avoid when:** you are doing exploratory testing where writing expectations first would only slow discovery down

## Procedure

1. Start from the endpoint inventory and the actor catalog produced by the mapping phase.
2. Assign each endpoint an auth layer: public, authenticated, role-restricted or tenant-restricted.
3. Write the expected status for every endpoint-actor pair, choosing deliberately between 401 and 403 and documenting why.
4. Add object-level expectations for endpoints that operate on a specific object, including the peer-owned case.
5. Flag combinations you cannot predict, since those mark places where the requirement is genuinely unclear.
6. Save the matrix as a spec file so the tooling can render it and your results can be compared against it.

## Signals

- Two endpoints handling the same resource expect different statuses for the same actor, which suggests inconsistent design.
- You cannot predict an expectation without asking the team, which reveals an undocumented requirement.
- The spec contains an endpoint with no object-level expectation while clearly operating on one object.
- Every cell is 200, which usually means the auth layer was never actually classified.

## Patterns

**1. Matrix cell**

```text
GET /api/orders  x actor=anonymous -> 401 (no credential presented)
GET /api/orders  x actor=member   -> 200 (own data only)
```

**2. Layer rules**

```text
auth=none    -> 200 for all
auth=session -> 401 anonymous, 200 member
auth=admin   -> 401 anonymous, 403 member, 200 admin
object=yes   -> peer-owned object must be 403 or 404
```

**3. Spec file**

```text
{"name":"demo-api","actors":[...],"endpoints":[{"path":"/api/orders","auth":"session","object":true}]}
```

## Pitfalls

- Writing the matrix after testing, which turns expectations into rationalizations instead of predictions.
- Using 200 everywhere because it is easy, hiding every distinction the review exists to find.
- Omitting the peer-owned object row, which is precisely where object-level authorization failures show up.

## Done when

- Every endpoint-actor cell has a written expected status, and every object endpoint has a peer-owned expectation.
- The matrix loads as a spec file and renders through the matrix command without manual editing.

## References

- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
- [PortSwigger - access control](https://portswigger.net/web-security/access-control)

