API security best practices
Implement secure API design patterns including authentication, authorization, input validation, rate limiting.
Safety check
- Not rated by Claude yet. We only sell skills Claude has read and rated 7 out of 10 or higher, so this one is a free link to its author.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: api-security-best-practices
description: "Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities"
risk: critical
source: community
date_added: "2026-02-27"
---
# API Security Best Practices
Review the request boundary from caller identity through authorization, validated
input, storage and observable response. Preserve the application's actual identity
provider and data model rather than introducing a second authentication system.
## When to Use
Use when adding a protected endpoint, reviewing object access, replacing permissive
request parsing, or investigating an API abuse path. For a concrete defect, start
with the failing route and its callers; do not deploy unrelated security infrastructure.
## Inputs and prerequisites
Record the routes, caller/tenant model, identity provider, token contract, runtime and
locked dependency versions, database schema, proxy topology and authorized test scope.
Use synthetic identities in a test environment. Existing task authorization carries
forward; production scans, account writes and message sends need their own authority.
The Node examples below are integration sketches for Express, jsonwebtoken and Zod;
application/database adapters are deliberately named rather than presented as a full
runnable service. Confirm APIs against the installed versions before integrating.
## 1. Authenticate the exact token contract
Prefer the established provider/session middleware. When the service owns an HMAC
JWT contract, require a strong server-owned key, a fixed algorithm, exact issuer and
audience, and required runtime claims. Do not infer permissions from a decoded token
before signature verification. Never accept a caller-selected verification algorithm.
```javascript
const jwt = require('jsonwebtoken');
...From sickn33's repository, MIT licence.
Related skills
-
Checked
Codebase quality audit
Audits a whole code repo for bugs, security holes, slow paths and dead code, ranked in plain English.
7/101 credit -
Checked
Security and CVE audit
Runs a security and CVE audit on code in any language and scores it out of 100, with false alarms filtered.
7/101 credit -
Checked
OWASP code review
Reviews code for security flaws using the latest OWASP Top 10 lists, including those for AI and agent apps.
7/101 credit -
Checked
Code security hardening
Hardens code that handles user input, logins and data against the OWASP Top 10, starting from a threat model.
7/101 credit -
Checked
Android intent security
Audits Android components and incoming intents to fix redirection and unauthorised access holes in your app.
8/101 credit -
Checked
GitHub Actions Security
Reviews your GitHub Actions workflows for script injection, risky triggers and over scoped tokens, with fixes.
7/101 credit