# API Security Engineer

> Engineers API security controls: OWASP Top 10 coverage, security headers, authentication middleware, dependency scanning with npm audit, and SAST with semgrep. Use when working with security headers, dependency sast or when the user mentions security headers, dependency sast.

- Skill: `opknock/api-security-engineer` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-security-engineer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-security-engineer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-security-engineer

---


Engineers API security controls: OWASP Top 10 coverage, security headers, authentication middleware, dependency scanning with npm audit, and SAST with semgrep.

## Agentic Workflow: Read -> Reason -> Act (api-security-engineer)

You are **api-security-engineer** (security) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — security context for `api-security-engineer`
- Domain: Engineers API security controls: OWASP Top 10 coverage, security headers, authentication middleware, dependency scanning with npm audit, and SAST with semgrep.
- **security-headers**: Apply and verify security response headers — `npm install helmet`
- **dependency-sast**: Scan dependencies and source code — `npm audit --audit-level=high`
- Check `knowledge` and `prerequisites: node.js, python, owasp-zap, helmet`

### 2. Reason — think for `api-security-engineer`
- For `security-headers`: Apply and verify security response headers — decide which checks to run
- For `dependency-sast`: Scan dependencies and source code — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-security-engineer` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Semgrep` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-security-engineer:7b6ff6eb`

# API Security Engineer

End-to-end API security controls.

## What This Skill Does
- Applies security headers at the framework level
- Scans dependencies and source for vulnerabilities
- Covers OWASP API Top 10 categories

## When to Use
- Hardening new API deployments
- Recurring vulnerability management
- Compliance evidence gathering

## Real Commands

```bash
npm install helmet
npm audit --audit-level=high
pip install semgrep
semgrep --config=p/owasp-top-ten .
```

## Header Baseline
- Strict-Transport-Security: max-age=31536000
- X-Content-Type-Options: nosniff
- Referrer-Policy: no-referrer
- Cache-Control: no-store on auth responses

## Testing
- Verify headers on every route prefix
- Re-run audits after dependency updates
- Keep semgrep findings triaged


## Best Practices
- Default-deny error responses
- Rate limit auth endpoints
- Scan in CI on every merge

## Capabilities

### security-headers
Apply and verify security response headers

**Parameters:**
- `header` (string): Header to verify
- `url` (string): Endpoint to check
- `middleware` (string): Security middleware name

**Commands:**
- `npm install helmet`
- `curl -sI http://localhost:8080/ | grep -iE 'strict-transport-security|content-security-policy|x-content-type-options|referrer-policy'`
- `curl -s -D- http://localhost:8080/api | grep -i 'x-frame-options'`
- `node -e "const helmet=require('helmet'); console.log(helmet()._name)"`

**Examples:**
- helmet sets a battery of security headers
- curl -sI greps HSTS and CSP headers
- X-Frame-Options blocks clickjacking

### dependency-sast
Scan dependencies and source code

**Parameters:**
- `severity` (string): Audit threshold: low, moderate, high, critical
- `config` (string): Semgrep ruleset
- `path` (string): Scan target directory

**Commands:**
- `npm audit --audit-level=high`
- `npm audit fix --dry-run`
- `pip install semgrep`
- `semgrep --config=p/owasp-top-ten .`
- `semgrep --config=auto --json -o semgrep.json .`

**Examples:**
- npm audit reports vulnerable dependencies
- semgrep with owasp-top-ten rules scans source
- --json output feeds CI dashboards

## References
- [OWASP API Security Top 10](https://owasp.org/API-Security/editions/2023/en/0x11-t10/)
- [Semgrep Docs](https://semgrep.dev/docs/)

