api-security

Secure REST and GraphQL APIs with authentication, validation, and rate limiting.

5|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/latestaiagents/agent-skills --skill api-security-latestaiagents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-security
Source: https://github.com/latestaiagents/agent-skills/tree/main/plugins/security-guardian/skills/common/api-security
Command: npx skills add https://github.com/latestaiagents/agent-skills --skill api-security-latestaiagents

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires express-rate-limit, rate-limit-redis, joi, graphql-depth-limit, graphql-validation-complexity, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the critical need to protect REST and GraphQL APIs from common attacks and vulnerabilities, ensuring data integrity and secure communication.

Core Features & Use Cases

  • Authentication & Authorization: Implement robust mechanisms like API keys, OAuth 2.0, JWT, RBAC, and resource ownership.
  • Input Validation: Utilize schema validation for both REST (Joi) and GraphQL to prevent malformed or malicious data.
  • Rate Limiting: Configure granular rate limits to prevent abuse and ensure service availability.
  • Response Security: Sanitize responses and set secure headers to prevent data leakage and other attacks.
  • Use Case: When designing a new public-facing API, use this skill to implement secure authentication, validate all incoming requests against a defined schema, and set up rate limiting to protect against DoS attacks.

Quick Start

Use the api-security skill to implement OAuth 2.0 authentication for your API endpoints.

Frequently Asked Questions about api-security

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

FAQPage Schema
How do I implement OAuth 2.0 authentication for my REST API?

This skill implements OAuth 2.0 flows and API key management to secure REST API authentication. It provides patterns for configuring authorization mechanisms to protect endpoints and manage client access.

What's the best way to validate GraphQL queries against malicious data?

Validating GraphQL queries against malicious data requires applying schema validation rules like graphql-depth-limit and graphql-validation-complexity. These measures prevent deeply nested queries and analyze query complexity to block attacks.

How do I set up rate limiting with Redis to protect APIs from abuse?

Setting up Redis rate limiting protects APIs from abuse by configuring express-rate-limit with rate-limit-redis. This strategy enforces granular request thresholds to ensure service availability and prevent DoS attacks.

Does Joi work for REST API request validation and secure error handling?

Joi works for REST API request validation by validating incoming data against defined schemas. This ensures malformed data is rejected and enables secure error handling to prevent information leakage in responses.

Can I use this to secure both REST and GraphQL APIs comprehensively?

Yes, you can secure both REST and GraphQL APIs comprehensively. It covers schema validation with Joi for REST and specific validation rules for GraphQL, addressing authentication, authorization, and response security.