authorization
Skill59 starsChanged 2 months agoMITView on GitHub
Decide what an authenticated caller may do — pick the permission model, put the check at one enforcement point close to the data, and default to deny. Use when adding roles or permissions, scoping data per tenant or per owner, building an admin-only path, reviewing an endpoint that trusts a client-supplied id, or when someone reports seeing data that is not theirs. Not for establishing identity (that is authentication), and hiding a control in the UI is never the enforcement.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- suhailkakar/the-skillstheir own version, first seen May 7, 2026
- hkarpinen/agent-skillstheir own version, first seen Apr 15, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- suhailkakar/the-skills★ 26same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- hkarpinen/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- agent-dispatcherSkill
- agent-designSkill
- agent-evalsSkill
- context-engineeringSkill
- llm-observabilitySkill
- mcp-designSkill
- memory-designSkill
- model-routingSkill
- prompt-engineeringSkill
- prompt-injection-defenseSkill
- retrieval-ragSkill
- structured-outputSkill
- tool-designSkill
- api-contract-verificationSkill
- api-designSkill
- authenticationSkill
- background-jobsSkill
- cachingSkill
- idempotency-and-retriesSkill
- webhooksSkill
- database-migration-verificationSkill
- data-integritySkill
- data-pipelinesSkill
- data-qualitySkill
- migrationsSkill
- postgresSkill
- query-optimizationSkill
- schema-designSkill
- accessibilitySkill
- accessibility-verificationSkill
- design-systemsSkill
- design-to-codeSkill
- frontend-designSkill
- motion-designSkill
- responsive-designSkill
- ui-auditSkill
- ux-writingSkill
- ci-cdSkill
- deploymentSkill
- dockerSkill
- github-actionsSkill
- incident-responseSkill
- observabilitySkill
- release-verificationSkill
- rollbackSkill
- component-architectureSkill
- frontend-performanceSkill
- shadcn-uiSkill
- stack-detectionSkill
- tailwindSkill
- visual-verificationSkill
- competitive-analysisSkill
- copywritingSkill
- data-analysisSkill
- deep-researchSkill
- documentation-verificationSkill
- positioningSkill
- seoSkill
- source-evaluationSkill
- technical-writingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Do this before opening an editor — most authorization bugs are unwritten rules.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Authorization
Authentication says who is calling. Authorization says what that caller may do to this resource. Being logged in is not a permission, and a hidden button is not a check — the request still leaves the browser exactly the same way.
When this fires
A rule of the form "only X may do Y to Z" is being added, changed, or doubted. Roles, admin areas, per-owner or per-tenant data, sharing, feature gating that carries money or privacy. Also fires on any report that a caller reached a resource they should not have.
Procedure
- Write the rule as one sentence: who may do what action to which resource, under what condition. If it will not fit in a sentence, either the model is wrong or there are two rules. Do this before opening an editor — most authorization bugs are unwritten rules.
- Choose the smallest model the rules need. A handful of fixed roles → a role check. Rules that read the resource (owner, tenant, state, amount) → an attribute or ownership check. "A may see it because B shared it" → a relationship check. Do not stand up a policy engine for three roles; do not fake relationships with an ever-growing enum.
- Reuse the existing mechanism. Grep for the project's guard, policy,
can/abilityhelper, route middleware, decorator, or database row-level security. A second authorization system beside the first is where the gap will be. - Put the check as close to the data as it can go, once. Ownership and tenant scoping belong in the query itself — or in row-level security — not in a filter applied after the rows come back. A post-fetch filter has already loaded the row, often logged it, and will be skipped by the next query someone writes.
- Default deny. The check allows only on an explicit match. Unknown role, absent tenant, null owner, a new enum value, an endpoint added next month: all deny. If a new route is permitted by default, the model is inverted.
- Enumerate every entry point to the resource, not the one in the ticket. Routes, batch and bulk endpoints, GraphQL resolvers and nested fields, background jobs, webhooks, CSV export, admin scripts, internal service calls. The classic hole is an endpoint that takes an id list and checks only the first, or an "internal" service that trusts its caller.
- Never trust client-supplied identity or scope. A user id, tenant id, role or permission
arriving in a body, query string, path or header is input, not fact. Derive them from the
authenticated principal. Accepting
?userId=is not authorization, it is a parameter. - Choose the refusal deliberately and apply it consistently. 403 when the resource's existence is not itself sensitive; 404 when it is. Mixing them across neighbouring endpoints leaks exactly the fact the 404 was meant to hide.
- Mirror the rule in the UI after the server enforces it, never instead. Hiding a control is usability, so users do not walk into refusals. It changes nothing an attacker can reach.
- Log the decision, not the payload: principal, action, resource id, allow or deny. Denials are what an investigation reads; bodies are what a breach report quotes.
- Write the negative tests — they are the deliverable. For each rule: the permitted caller succeeds, and each non-permitted caller is refused, including the neighbouring tenant and the anonymous caller. A rule tested only from the allowed side is untested.
- A change to an existing rule moves real people in or out. Widening access on a live system, or removing a role someone currently holds, stops and asks first, and the report names who gains or loses access. Silent widening is the failure this step exists to prevent.
Checklist
- Each rule written as a sentence before implementation
- Model chosen deliberately; no policy engine for three roles
- Existing mechanism reused, or the absence of one confirmed
- Enforcement is in the query or the closest layer to the data, not a post-fetch filter
- Deny is the default for unknown roles, missing scope, and new routes
- Every entry point to the resource enumerated, including jobs, exports and bulk endpoints
- No identity, tenant or role taken from client-controlled input
- 403 vs 404 chosen once and applied consistently
- UI mirrors the rule; it does not implement it
- Allow and deny decisions logged with principal, action and resource
- Negative tests exist per rule, including the cross-tenant caller
- Any widening of access on a live system was asked about before it shipped
Failure handling
- A user saw data that is not theirs — treat it as a scoping defect, not a UI bug. Find every caller of the query, not only the screen in the report; the same unscoped query is usually reachable from three places. Fixing one leaves the others open.
- The check is in the wrong layer and moving it is large — say so and size it rather than adding a second check at the new layer. Two enforcement points that can disagree are worse than one in an awkward place.
- The rules contradict each other — do not invent a precedence. Name the conflict and the people or documents that can settle it, and leave the stricter behaviour in place meanwhile.
- No way to test as another tenant or role — that is a finding. Report the rule as implemented but unverified and name exactly which caller could not be exercised. Never call an access rule verified because you read it.
Evidence to report
Each rule as a sentence, next to the file and function that enforces it; the model chosen and what it excludes; the list of entry points checked, including the ones found beyond the ticket; the negative tests and their output; who gains or loses access if the change is a rule change; and the callers or paths that could not be exercised.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

