api-security-best-practices

Implement secure API design patterns for REST, GraphQL, and WebSocket APIs.

Updated Nov 6, 2025
One-click install
npx skills add https://github.com/brandonlacoste9-tech/korean-AI-compliance- --skill api-security-best-practices-brandonlacoste9-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-security-best-practices
Source: https://github.com/brandonlacoste9-tech/korean-AI-compliance-/tree/main/skills/api-security-best-practices
Command: npx skills add https://github.com/brandonlacoste9-tech/korean-AI-compliance- --skill api-security-best-practices-brandonlacoste9-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers build and maintain secure APIs by providing guidance on implementing robust security measures against common vulnerabilities and attacks.

Core Features & Use Cases

  • Authentication & Authorization: Implement secure methods like JWT and RBAC.
  • Input Validation & Sanitization: Prevent injection attacks (SQL, XSS).
  • Rate Limiting & DDoS Protection: Protect APIs from abuse and overload.
  • Data Protection: Ensure data is secure in transit and at rest.
  • Use Case: When developing a new user authentication API, use this Skill to ensure JWTs are securely generated, validated, and that refresh tokens are handled properly, while also implementing rate limiting to prevent brute-force attacks.

Quick Start

Use the api-security-best-practices skill to implement JWT authentication for your API endpoints.

Frequently Asked Questions about api-security-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure JWT authentication for my REST API?

Secure JWT authentication for REST APIs involves correctly generating, validating, and handling refresh tokens to prevent unauthorized access. This Skill provides practical JavaScript examples for implementing JWTs and avoiding common authentication pitfalls.

What are the best ways to prevent SQL injection and XSS in API endpoints?

Preventing SQL injection and XSS in API endpoints requires strict input validation and data sanitization. This Skill offers guidance on implementing secure coding patterns to sanitize inputs and block injection attacks across REST, GraphQL, and WebSocket APIs.

How does rate limiting protect APIs from brute-force and DDoS attacks?

Rate limiting protects APIs from brute-force and DDoS attacks by restricting the number of requests a client can make within a specific timeframe. This Skill explains how to implement rate limiting to safeguard your endpoints from abuse and overload.

What is the OWASP API Security Top 10 and how do I secure my API against it?

The OWASP API Security Top 10 outlines critical API vulnerabilities like broken object level authorization and insufficient logging. This Skill addresses these OWASP risks directly, providing comprehensive design patterns to secure REST, GraphQL, and WebSocket APIs.

Can I use these API security patterns for both GraphQL and WebSocket APIs?

Yes, these API security patterns apply to GraphQL and WebSocket APIs alongside traditional REST architectures. The Skill covers authentication, authorization, and input validation techniques specifically tailored for these diverse API protocols.

Why does my API authorization fail despite having authentication in place?

API authorization often fails when role-based access control (RBAC) is improperly configured, allowing authenticated users to access restricted data. This Skill helps implement robust authorization checks to ensure users only access permitted resources.