agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/secure-invite-and-access/SKILL.md

secure-invite-and-access

Skill2 starsChanged 11 days agoMITView on GitHub

Implement access control, authentication, and authorization patterns. Use this skill when building auth endpoints, managing permissions, implementing session/token logic, or generating signed URLs — even if they just say "add auth" or "secure this endpoint". Generic template adaptable to any project's auth needs. Not for security-code-auditor, api-design-first.

The file

Files
SKILL.md

Secure Invite and Access

Implement access-control rules (authentication, authorization, sessions, audit logging) for any web application.

When to Use

  • Working on authentication, authorization, or session management.
  • Implementing role-based access control (RBAC) or permission grants.
  • Updating signed URL issuance/verification or audit logging.
  • Investigating auth-related bugs or observability gaps.

Workflow

  1. Define auth requirements -- confirm auth model (sessions, JWT, OAuth), password hashing, TTL expectations.
  2. Threat model -- identify enumeration risks, replay attacks, session leakage vectors.
  3. Implement -- secure password hashing (Argon2id/bcrypt), session issuing/refresh/revoke, signed URLs with TTL, trace ID logging.
  4. Audit -- log auth events with actor + trace ID. Return generic access-denied errors; never leak whether accounts exist.
  5. Tests -- add coverage for password validation, session expiry, signature validation, revocation flows.

Checklist

  • All auth endpoints validate payloads with schema validation + capability checks.
  • Sessions + signed tokens include expiry metadata and trace IDs.
  • Logout/refresh revoke existing tokens.
  • Audit rows created for create/update/revoke/grant usage.
  • Rate limiting or abuse guard documented (even if stubbed).
  • Never expose whether an email/username exists in error messages.

See Also

  • security-code-auditor — Security audits
  • privacy-first — Email/personal data prevention

Rationalizations

RationalizationReality
"Auth is straightforward, I don't need a dedicated skill"Authentication bugs are among the most critical security vulnerabilities; systematic patterns prevent common mistakes.
"I'll add rate limiting later"Rate limiting is a core auth control, not an afterthought; abuse vectors are most effective before protections exist.
"Generic error messages are用户体验bad"leaking account existence is a security vulnerability; generic errors are an industry-standard requirement.

Red Flags

  • Hardcoding secrets or tokens in source code instead of using environment variables.
  • Skipping session revocation on logout or password change.
  • Returning specific error messages like "account not found" instead of generic access-denied responses.
  • Implementing custom cryptography instead of using established libraries like Argon2id or bcrypt.

References

  • references/auth-patterns.md - Common authentication patterns
  • references/threat-model.md - Auth threat modeling guide

Voice & Context

  • Default: professional + blog
  • Reference: voice-profiles skill for definitions and auto-detection.

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.