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.00121 | $0.05218 |
| Opus 5 | $0.00060 | $0.02609 |
| Sonnet 5 | $0.00024 | $0.01044 |
| Haiku 4.5 | $0.00012 | $0.00522 |
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 8d 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 — 620 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.6 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.1 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.
- 8d 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 (23 stars, last pushed 5d ago), licensed MIT. It adds 121 tokens to every session and 5,218 once invoked, about $0.0006 per session on Opus 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.
Other skills, from other repositories
hunt-auth-bypass
Hunting skill for auth bypass vulnerabilities. Built from 12 public bug bounty reports across SAML XSW / parser-differential (GitHub Enterprise CVE-2025-25291/25292), SAML signature stripping (Uber, Rocket.Chat, samlify CVE-2025-47949), SAML domain enforcement bypass via control characters (HackerOne 2024)…
frontmcp-config
Use when configuring a FrontMCP server through frontmcp.config or the @FrontMcp options. Covers auth modes (public, transparent, local, remote), OAuth plus credential vault and secureStore, CORS, HTTP port / entry-path prefix / unix socket, security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options), rate…
firebase
Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at 1 write/sec. NOT managed-Postgres BaaS with SQL and RLS (that…
opentelemetry
OpenTelemetry observability patterns: traces, metrics, logs, context propagation, OTLP export, Collector pipelines, and troubleshooting.
firebase
Build Firebase authentication, database rules, Cloud Functions, and messaging workflows; test access boundaries with the Emulator Suite.
api
FastAPI + async/sync HTTP client patterns, JWT auth, multi-provider routing, Pydantic request/response models, CORS, background tasks, and typed frontend API clients — synthesized from lead-gen-engine and seo-geo-aeo-engine.