Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add j4flmao/agent-skills --skill auth-patternsgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/j4flmao/agent-skills/auth-patterns)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/auth-patterns"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/auth-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/auth-patterns"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/auth-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 5 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Privilege Escalation · line 61 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 136 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 412 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 470 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- medium Excessive Agency · line 402 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00071 | $0.04141 |
| Opus 5.5 | $0.00028 | $0.01656 |
| Sonnet 5.5 | $0.00014 | $0.00828 |
| Haiku 4.5 | $0.00007 | $0.00414 |
Grade A, and why
backend-auth-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 499 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Backend Auth Patterns
Purpose
Implement authentication and authorization that is secure by default. Every endpoint must have an auth check. No secrets in code. No plaintext passwords.
Agent Protocol
Trigger
Exact user phrases: "auth", "authentication", "authorization", "JWT", "OAuth", "RBAC", "permissions", "login", "session", "refresh token", "guard", "middleware auth", "access control", "secure endpoint".
Input Context
- Application type (SPA, mobile, M2M, server-rendered).
- Security requirements level (basic auth, enterprise SSO, API-key M2M).
- Existing auth infrastructure (if any).
Output Artifact
Auth design as text. No file output.
Response Format
Auth strategy: {strategy name}
Rationale: {one sentence}
Token structure: {claims}
Auth middleware: {location and logic}
Authorization model: {model name and role/permission list}
Completion Criteria
- Auth strategy selected based on application type
- Token structure defined with minimum viable claims
- Refresh token rotation specified
- Authorization model defined (RBAC or ABAC)
- Auth middleware placement specified (Infrastructure layer)
- Password hashing algorithm specified (bcrypt/argon2)
- Brute force protection specified
- No secrets hardcoded in any code example
Architecture Decision Trees
Auth Strategy Selection
Browser-based SPA?
├── Yes → JWT with refresh tokens in httpOnly cookies (prevents XSS token theft)
│ └── CSRF protection required (SameSite=Strict + CSRF token)
└── No → Mobile app?
├── Yes → JWT with refresh tokens in secure device storage (Keychain/Keystore)
│ └── No CSRF needed (native apps can set custom headers)
└── No → Server-side rendered app?
├── Yes → Session-based auth with Redis store (simpler, CSRF protection built-in)
└── No → M2M service?
├── Yes → API Key (simple) or OAuth2 Client Credentials (standard)
└── No → Third-party login?
└── OAuth2 / OIDC delegated to provider
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/auth-oauth2.md 9.1 KB
- references/auth-passwordless.md 7.7 KB
- references/auth-patterns-advanced.md 4.4 KB
- references/auth-patterns-fundamentals.md 2.5 KB
- references/auth-patterns-provider-comparison.md 2.5 KB
- references/auth-testing.md 7.8 KB
- references/jwt-oauth-guide.md 1.7 KB
- references/oidc-flows.md 1.7 KB
- references/rbac-abac.md 2.6 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 16d ago Changed · +1 lines · -50 tokens per session 8c2e3791e58a
- 17d ago Changed 9640d8d7018a
- 1mo ago Changed · -122 lines 4ba31bd2f4db
- 3mo ago First seen · 620 lines · 121 tokens per session scan A 20a1e6d5a2e3
backend-auth-patterns is a skill published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 71 tokens to every session and 4,141 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
backend-auth-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| backend-auth-patternsj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 71 | Claude Code, Codex |
| firebaseericrisco/rsc-harness | Skill | 707 | 2d ago | MIT | A | 77 | Claude Code, Codex |
| frontmcp-configagentfront/frontmcp | Skill | 154 | today | Apache-2.0 | A | 187 | Claude Code |
| theauthglincker/theauth | Skill | 24 | yesterday | MIT | A | 67 | Claude Code, Codex |
| firebasealivirgo/Major-AI-Skills | Skill | 6 | 2d ago | MIT | A | 40 | Claude Code |
| zitadel-clizitadel/nextgen | Skill | 33 | today | AGPL-3.0 | A | 179 | Claude Code, Codex |
| crudauthbenavlabs/crudauth | Skill | 28 | 1mo ago | MIT | B | 199 | Claude Code, Codex |