
Api Security Hardening
This is a solid foundation for locking down REST APIs with all the essentials in one place: authentication with JWT, rate limiting, helmet for security headers, input sanitization against XSS and NoSQL injection, and proper CORS configuration. You get reference implementations for Node.js/Express, Python FastAPI, and API gateway setups. Use this when you're hardening an existing API before going to production or building a new one that needs to pass a security audit from day one. The quick start example pulls together the usual suspects (helmet, express-rate-limit, xss-clean) so you don't have to remember which npm packages to combine. It won't write your security policy for you, but it handles the technical implementation of common defenses.
- skills.sh installs
- 868
- GitHub stars
- 379
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill api-security-hardening --agent claude-codeInstalls into .claude/skills of the current project.
Files
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();
}
Sponsors
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Backend & APIs, Security, AI & Agent Building
- First seen
- May 16, 2026
More from aj-geddes/useful-ai-prompts
All 258- Mobile App Testing831
- Technical Specification811
- User Story Writing793
- Access Control Rbac763
- User Guide Creation762
- Kubernetes Deployment759
- Logging Best Practices742
- Visual Regression Testing731
- Flutter Development725
- E2e Testing Automation695
- Business Case Development683
- React Component Architecture683
- Docker Containerization681
- Agile Sprint Planning677
- Log Analysis674
- Security Compliance Audit673
- Project Estimation670
- Gitlab Cicd Pipeline669
- Websocket Implementation668
- Requirements Gathering663
- Image Optimization662
- Ruby Rails Application660
- Api Rate Limiting647
- Internationalization I18n642