Search

PythonReactSEOPDF
OpenClaw

Api Security

API Security Best Practices

brandonwise0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install brandonwise/api-security

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

API Security Best Practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities.

Description

USE WHEN:

  • Designing new API endpoints
  • Securing existing APIs
  • Implementing authentication and authorization (JWT, OAuth 2.0, API keys)
  • Setting up rate limiting and throttling
  • Protecting against injection attacks (SQL, XSS, command)
  • Conducting API security reviews or preparing for audits
  • Handling sensitive data in APIs
  • Building REST, GraphQL, or WebSocket APIs

DON'T USE WHEN:

  • Need vulnerability scanning (use vulnerability-scanner skill)
  • Building frontend-only apps with no API
  • Need network-level security (firewalls, WAF config)

OUTPUTS:

  • Secure authentication implementations (JWT, refresh tokens)
  • Input validation schemas (Zod, Joi)
  • Rate limiting configurations
  • Security middleware examples
  • OWASP API Top 10 compliance guidance

How It Works

Step 1: Authentication & Authorization
  • 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
  • Validate all input data
  • Sanitize user inputs
  • Use parameterized queries
  • Implement request schema validation
  • Prevent SQL injection, XSS, and command injection
Step 3: Rate Limiting & Throttling
  • Implement rate limiting per user/IP
  • Set up API throttling
  • Configure request quotas
  • Handle rate limit errors gracefully
  • Monitor for suspicious activity
Step 4: Data Protection
  • Encrypt data in transit (HTTPS/TLS)
  • Encrypt sensitive data at rest
  • Implement proper error handling (no data leaks)
  • Sanitize error messages
  • Use secure headers

JWT Authentication Implementation

Generate Secure JWT Tokens
// auth.js
const jwt = require('jsonwebt...

Source information

Source
github
Repository
openclaw/skills
Path
skills/brandonwise/api-security
Version
—
Commit
6daac03c6cbb27132ed15bf194b69b5fce3a8827
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# API Security Best Practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities.

## Description

USE WHEN:
- Designing new API endpoints
- Securing existing APIs
- Implementing authentication and authorization (JWT, OAuth 2.0, API keys)
- Setting up rate limiting and throttling
- Protecting against injection attacks (SQL, XSS, command)
- Conducting API security reviews or preparing for audits
- Handling sensitive data in APIs
- Building REST, GraphQL, or WebSocket APIs

DON'T USE WHEN:
- Need vulnerability scanning (use `vulnerability-scanner` skill)
- Building frontend-only apps with no API
- Need network-level security (firewalls, WAF config)

OUTPUTS:
- Secure authentication implementations (JWT, refresh tokens)
- Input validation schemas (Zod, Joi)
- Rate limiting configurations
- Security middleware examples
- OWASP API Top 10 compliance guidance

---

## How It Works

### Step 1: Authentication & Authorization

- 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

- Validate all input data
- Sanitize user inputs
- Use parameterized queries
- Implement request schema validation
- Prevent SQL injection, XSS, and command injection

### Step 3: Rate Limiting & Throttling

- Implement rate limiting per user/IP
- Set up API throttling
- Configure request quotas
- Handle rate limit errors gracefully
- Monitor for suspicious activity

### Step 4: Data Protection

- Encrypt data in transit (HTTPS/TLS)
- Encrypt sensitive data at rest
- Implement proper error handling (no data leaks)
- Sanitize error messages
- Use secure headers

---

## JWT Authentication Implementation

### Generate Secure JWT Tokens

```javascript
// auth.js
const jwt = require('jsonwebt...

Related skills

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.