agentleFS
ostrium-labsostrium-labs/loams-skills/skills/identity-authz/SKILL.md

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.

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
  1. Distinctive:

    Never make the admin console public.

    line 35
  2. Distinctive:

    No shared admin account; no long-lived agent keys.

    line 63
  3. Distinctive:

    No resource permission in an IdP role.

    line 64
  4. Distinctive:

    No public admin console or OpenFGA endpoint.

    line 65
  5. Distinctive:

    No authorization decision in the UI only.

    line 66

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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.
  2. Map principals. Human user:<id>; machine service_account:<id> or agent:<id>; org:<id>; team:<id>. Never use an email as an id.
  3. Model the hierarchy. org → project → environment → resource. Application code checks only can_* relations through the Authorizer trait.
  4. Keep roles coarse. Zitadel roles may sign in / administer the console. Resource permissions live in OpenFGA, not in IdP roles.
  5. 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.
  6. Revocation. Disable the machine user/human and delete tuples. A disabled principal is refused on every request; do not rely on token expiry.
  7. Cache. At most one decision cache, TTL ≤ 5 s, allows only. Bypass it for higher-consistency checks.
  8. Audit. Zitadel events, OpenFGA changes, and Loams allow/deny decisions go to the _audit stream; retain per policy.
  9. 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.fga or 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.