api-security

api-security is a skill for Claude Code, Codex from LeahyCC/claude-skills. It costs 51 tokens per session (2,501 once invoked), scanned A, original, MIT.

A security guide for application programming interfaces, the endpoints software uses to exchange data, in Next.js applications.

In plain words
What is it for?
Use it to design authentication and access checks, validate requests, limit traffic, protect against server-side request forgery, and filter API responses.
Why use it?
It helps prevent unauthorized access, unsafe input, excessive data exposure, and other common API weaknesses identified by OWASP, a web-security standards group.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design authentication and access checks, validate requests, limit traffic, protect against server-side request forgery, and filter API responses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leahycc/claude-skills/api-security
Install

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.

Any agent
npx skills add LeahyCC/claude-skills --skill api-security
Clone the repo
git clone --depth 1 https://github.com/LeahyCC/claude-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin api-security — /plugin install api-security after adding the marketplace above.

Wrote 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.

agentmods badge for api-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/leahycc/claude-skills/api-security/github.svg)](https://agentmods.dev/skills/leahycc/claude-skills/api-security)
Your own site
<a href="https://agentmods.dev/skills/leahycc/claude-skills/api-security"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/api-security/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.

agentmods 80×15 button for api-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/leahycc/claude-skills/api-security"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/api-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.02501
Opus 5.5 $0.00020 $0.01000
Sonnet 5.5 $0.00010 $0.00500
Haiku 4.5 $0.00005 $0.00250

Measured today against content hash f383c79485c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-security 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 today.

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.

skills/api-security/SKILL.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Security — OWASP API Security Top 10 (2023) for Next.js

Production-grade API security patterns for Next.js App Router. Covers every category in the OWASP API Security Top 10 (2023) with cross-references to the OWASP Web Top 10 (2025). AI tools attached to those APIs are in AI Tools. Verified against the official OWASP specifications.

Architecture

Request → proxy.ts (logged-out redirect) → Route Handler / Server Action
                                       ↓
                                  Input Validation (Zod)
                                       ↓
                                  Data Access Layer (auth + authz + DTO)
                                       ↓
                                  Database (parameterized queries)
                                       ↓
                                  Filtered Response (DTO, no raw records)

The Data Access Layer (DAL) is the central security architecture recommended by Next.js. All database access, authorization checks, and response filtering happen in one server-only module — never in components or actions directly.

Quick Reference

Resource OWASP API OWASP Web What It Covers
Access Control API1, API5 A01 BOLA/IDOR, function-level auth, ownership checks
Authentication API2 A07, A04 Session management, JWT, Clerk/Auth0, proxy.ts
Input Validation API3, API8 A05 Zod schemas, SQL injection, XSS, Server Action validation
Rate Limiting API4 A06 Per-endpoint limits, cost attacks, Upstash patterns
Security Headers API8 A02 CSP, HSTS, CORS, Permissions-Policy, next.config
Data Exposure API3, API6 A06, A10 DAL pattern, DTOs, error sanitization, response filtering
Supply Chain API9, API10 A03, A08 Dependencies, env vars, CI/CD, third-party APIs
SSRF & Logging API7 A01, A09 URL validation, fetch safety, secure logging, audit trails
AI Tools API1, API5 A01 Tool calls, session identity, signed approval, MCP

Read the full file on GitHub · 158 lines

Changes

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.

  1. today Changed · -10 lines · +7 tokens per session f383c79485c4
  2. yesterday Changed · +2 lines e7b7273c2500
  3. 2d ago Changed 24f79dfabda1
  4. 1mo ago First seen · 166 lines · 44 tokens per session scan A 5ee636274e57

Subscribe to this mod's changes

api-security is a skill published in the GitHub repository LeahyCC/claude-skills (3 stars, last pushed today), licensed MIT. It adds 51 tokens to every session and 2,501 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

Accessibility Audit Helper

Reviews UI code and components for WCAG 2.1 accessibility violations and provides specific fixes.

Notysoty/openagentskills · 23 tokens

a11y-ally

Use when running comprehensive WCAG accessibility audits with axe-core + pa11y + Lighthouse, generating context-aware remediation, or testing video accessibility. Supports 3-tier browser cascade with graceful degradation.

proffesor-for-testing/agentic-qe · 44 tokens

accessibility-testing

WCAG 2.2 compliance testing, screen reader validation, and inclusive design verification. Use when ensuring legal compliance (ADA, Section 508), testing for disabilities, or building accessible applications for 1 billion disabled users globally.

proffesor-for-testing/agentic-qe · 50 tokens

Accessibility Auditor

Comprehensive WCAG 2.1 AA compliance testing combining automated axe-core scans with manual keyboard navigation, screen reader compatibility, and focus management verification.

PramodDutta/qaskills · 32 tokens

accessibility

Use when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast, tap-target size. NOT palette or visual intent (that is design), NOT test-runner setup (that is testing-web), NOT LCP/page-speed (that is…

ericrisco/rsc-harness · 86 tokens

Accessibility A11y Enhanced

Comprehensive WCAG compliance and accessibility testing covering ARIA, keyboard navigation, screen readers, color contrast, and automated a11y validation.

PramodDutta/qaskills · 34 tokens