api-security-best-practices
Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities
npx skills add sickn33/agentic-awesome-skills --skill api-security-best-practices --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides developers in building secure APIs by implementing authentication, authorization, input validation, rate limiting, and protection against common vulnerabilities across REST, GraphQL, and WebSocket APIs.
How it works
- Authentication & Authorization: choose method (JWT, OAuth 2.0, API keys), implement token-based authentication, set up RBAC, secure session management, and consider MFA.
- Input Validation & Sanitization: validate all input, sanitize inputs, use parameterized queries, implement request schema validation, and prevent SQLi, XSS, and command injection.
- Rate Limiting & Throttling: implement per-user/IP rate limiting, set up API throttling, configure quotas, handle rate limit errors gracefully, monitor activity.
- Data Protection: encrypt data in transit (HTTPS/TLS), encrypt data at rest, implement proper error handling, sanitize error messages, use secure headers.
- API Security Testing: test authentication/authorization, perform penetration testing, check OWASP API Top 10, validate input handling, test rate limiting.
When to use it
Use when designing new API endpoints; securing existing APIs; implementing authentication and authorization; protecting against API attacks (injection, DDoS, etc.); conducting API security reviews; preparing for security audits; implementing rate limiting and throttling; handling sensitive data in APIs.
What it can touch
- Tools mentioned: claude-code, codex, cursor.
- Files and code examples include multiple code blocks and configurations for authentication, validation, rate limiting, and testing.
Caveats
- Risk level: critical.
- License: MIT.
- Declared source: community.
- Date added: 2026-02-27.
# API Security Best Practices ## Overview Guide developers in building secure APIs by implementing authentication, authorization, input validation, rate limiting, and protection against common vulnerabilities. This skill covers security patterns for REST, GraphQL, and WebSocket APIs. ## When to Use This Skill - Use when designing new API endpoints - Use when securing existing APIs - Use when implementing authentication and authorization - Use when protecting against API attacks (injection, DDoS, etc.) - Use when conducting API security reviews - Use when preparing for security audits - Use when implementing rate limiting and throttling - Use when handling sensitive data in APIs ## How It Works ### Step 1: Authentication & Authorization I'll help you implement secure authentication: - Choose authentication method (JWT, OAuth 2.0, API keys) - Implement token-based authentication - Set up role-based access control (RBAC) - Secure session management - Implement multi-factor authentication (MFA) ### Step 2: Input Validation & Sanitization Protect against injection attacks: - Validate all input data - Sanitize user inputs - Use parameterized queries - Implement request schema validation
- Overview
- When to Use This Skill
- How It Works
- Step 1: Authentication & Authorization
- Step 2: Input Validation & Sanitization
- Step 3: Rate Limiting & Throttling
- Step 4: Data Protection
- Step 5: API Security Testing
- Examples
- Example 1: Implementing JWT Authentication
- Example 2: Input Validation and SQL Injection Prevention
- Example 3: Rate Limiting and DDoS Protection
- Best Practices
- ✅ Do This
What does the api-security-best-practices skill do?
Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill api-security-best-practices --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.