identity-authz
Skill1 starsChanged 39 days agoApache-2.0View on GitHub
Design authentication and authorization for a Loams install: company IdP and OIDC, Zitadel identities, OpenFGA tuples, machine users, agent tokens, least privilege, and audit. Use when adding users, services, agents, or tenants.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- company/AGENTS.mdAGENTS.md
- agent-platformSkill
- app-migrationSkill
- byog-deploySkill
- conformance-testingSkill
- cutover-operationsSkill
- data-migrationSkill
- decision-recordsSkill
- loams-adoptionSkill
- loams-fitSkill
- loams-rust-sdkSkill
- observability-meteringSkill
- rust-workspaceSkill
- sdk-portabilitySkill
- stack-inventorySkill
- target-architectureSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 35
Never make the admin console public.
- Distinctive: line 63
No shared admin account; no long-lived agent keys.
- Distinctive: line 64
No resource permission in an IdP role.
- Distinctive: line 65
No public admin console or OpenFGA endpoint.
- Distinctive: line 66
No authorization decision in the UI only.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Identity and authorization
Zitadel answers who. OpenFGA answers what they can do. Loams enforces and audits.
When to use
- A company install needs SSO, service accounts, or agents.
- A new tenant, environment, or resource type is added.
- A permission review or audit asks for the tuple model.
Inputs
- Company IdP and OIDC issuer, audience, and group/role mapping.
company/architecture/target.md.- Design 76, Design 78.
Procedure
- Pick the auth mode.
- Single-user/local: built-in single-org authorizer; no Zitadel or OpenFGA.
- Company: company OIDC issuer for people; Zitadel for machine users when needed; OpenFGA for fine-grained authorization.
- Never make the admin console public.
- Map principals. Human
user:<id>; machineservice_account:<id>oragent:<id>;org:<id>;team:<id>. Never use an email as an id. - Model the hierarchy. org → project → environment → resource. Application
code checks only
can_*relations through theAuthorizertrait. - Keep roles coarse. Zitadel roles may sign in / administer the console. Resource permissions live in OpenFGA, not in IdP roles.
- Agents. Each agent is a machine user with explicit grants; never inherit from its owner. Sandboxed agents never hold an IdP key; agentd/supervisor vend 15-minute Loams tokens.
- Revocation. Disable the machine user/human and delete tuples. A disabled principal is refused on every request; do not rely on token expiry.
- Cache. At most one decision cache, TTL ≤ 5 s, allows only. Bypass it for higher-consistency checks.
- Audit. Zitadel events, OpenFGA changes, and Loams allow/deny decisions go
to the
_auditstream; retain per policy. - Test. A multi-org test proves no tuple links two orgs. A differential test keeps built-in and OpenFGA answers equal.
Outputs
company/architecture/identity.md— modes, principals, hierarchy, flows.company/architecture/authz-model.fgaor a link to the company model.- A tuple bootstrap and a revocation runbook.
- ADRs for auth mode, tenant isolation, and cache policy.
Guardrails
- No shared admin account; no long-lived agent keys.
- No resource permission in an IdP role.
- No public admin console or OpenFGA endpoint.
- No authorization decision in the UI only; enforce server-side.
References
- Design 76
- Design 78
- Design 70
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.

