Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Api Security Hardening

  • 780 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

api-security-hardening is a backend security skill that adds authentication, rate limiting, input validation, CORS, and security headers to REST APIs for developers hardening endpoints against common attacks.

About

api-security-hardening is a Claude Code skill from aj-geddes/useful-ai-prompts that implements comprehensive REST API protection including authentication, authorization, rate limiting, input validation, CORS, and attack-prevention middleware. It includes an overview, quick start, reference guides, and best-practices sections for new API development and security audit remediation. Developers reach for api-security-hardening when exposing endpoints publicly or closing gaps found during reviews. The workflow focuses on practical middleware patterns rather than theoretical checklists.

  • Implements Helmet security headers, rate limiting, mongo sanitization, XSS cleaning, and HTTP parameter pollution protec
  • Supports JWT authentication, input validation with validator.js, and CORS configuration
  • Covers new API development, security audit remediation, production hardening, and compliance needs
  • Protects against common attacks including injection, XSS, and abuse from public exposure
  • Provides reference guides and best practices for high-traffic and public APIs

Api Security Hardening by the numbers

  • 780 all-time installs (skills.sh)
  • +9 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #435 of 2,203 Security skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill api-security-hardening

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs780
repo stars305
Security audit3 / 3 scanners passed
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you harden REST APIs against common attacks?

Add authentication, rate limiting, input validation, CORS, and security headers to REST APIs.

Who is it for?

Backend developers shipping or remediating public REST APIs that need authentication, throttling, and input-validation controls.

Skip if: Frontend-only styling work or infrastructure provisioning where no API attack surface is being modified.

When should I use this skill?

The user is building new API endpoints, remediating a security audit, or asks for auth, rate limiting, CORS, or input validation on REST routes.

What you get

Secured REST endpoints with authentication, rate limiting, validation middleware, CORS policy, and security headers configured.

  • Auth middleware configuration
  • Rate-limit rules
  • Validation and CORS policy

Files

SKILL.mdMarkdownGitHub ↗

API Security Hardening

Table of Contents

Overview

Implement comprehensive API security measures including authentication, authorization, rate limiting, input validation, and attack prevention to protect against common vulnerabilities.

When to Use

  • New API development
  • Security audit remediation
  • Production API hardening
  • Compliance requirements
  • High-traffic API protection
  • Public API exposure

Quick Start

Minimal working example:

// secure-api.js - Comprehensive API security
const express = require("express");
const helmet = require("helmet");
const rateLimit = require("express-rate-limit");
const mongoSanitize = require("express-mongo-sanitize");
const xss = require("xss-clean");
const hpp = require("hpp");
const cors = require("cors");
const jwt = require("jsonwebtoken");
const validator = require("validator");

class SecureAPIServer {
  constructor() {
    this.app = express();
    this.setupSecurityMiddleware();
    this.setupRoutes();
  }

  setupSecurityMiddleware() {
    // 1. Helmet - Set security headers
    this.app.use(
      helmet({
        contentSecurityPolicy: {
          directives: {
            defaultSrc: ["'self'"],
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Node.js/Express API SecurityNode.js/Express API Security
Python FastAPI SecurityPython FastAPI Security
API Gateway Security ConfigurationAPI Gateway Security Configuration

Best Practices

✅ DO

  • Use HTTPS everywhere
  • Implement rate limiting
  • Validate all inputs
  • Use security headers
  • Log security events
  • Implement CORS properly
  • Use strong authentication
  • Version your APIs

❌ DON'T

  • Expose stack traces
  • Return detailed errors
  • Trust user input
  • Use HTTP for APIs
  • Skip input validation
  • Ignore rate limiting

Related skills

How it compares

Use api-security-hardening for endpoint-level REST controls; pair with infrastructure or secrets skills for TLS, WAF, or vault configuration.

FAQ

What controls does api-security-hardening cover?

api-security-hardening covers authentication, authorization, rate limiting, input validation, CORS configuration, and security middleware to protect REST APIs against common vulnerabilities.

When should api-security-hardening be used?

Use api-security-hardening during new API development or security audit remediation when endpoints need practical auth, throttling, validation, and header hardening before production.

Is Api Security Hardening safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Securitybackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.