playbook-api

playbook-api is a skill for Claude Code, Codex from s0ld13rr/pentestcode. It costs 50 tokens per session (740 once invoked), scanned A, original, MIT.

A security-testing playbook for REST, GraphQL, and JSON APIs. It explains common API weaknesses such as accessing another user's records or sending unauthorized fields.

In plain words
What is it for?
Use it to test object access, login tokens, OAuth flows, mass assignment, data exposure, GraphQL queries, and rate limits.
Why use it?
API security problems often involve permissions and object IDs that ordinary interface testing misses.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test object access, login tokens, OAuth flows, mass assignment, data exposure, GraphQL queries, and rate limits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s0ld13rr/pentestcode/api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add s0ld13rr/pentestcode --skill api
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playbook-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/api/github.svg)](https://agentmods.dev/skills/s0ld13rr/pentestcode/api)
Your own site
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/api"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playbook-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/api"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 740 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.00740
Opus 5.5 $0.00020 $0.00296
Sonnet 5.5 $0.00010 $0.00148
Haiku 4.5 $0.00005 $0.00074

Measured yesterday against content hash 311ed15302f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

playbook-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -H "Authorization: Bearer $TOK" https://api.t/v1/orders/$id | head -c 200
skills/playbooks/api/SKILL.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Pentest — OWASP API Top 10

APIs fail differently than web apps: no UI to fuzz, auth is token-based, objects are addressable by ID. Test the OBJECT layer, not just the endpoint.

#1 BOLA / IDOR — test EVERY object reference

The single most common API finding. For each endpoint returning object data:

  1. Grab a valid object ID (your own, from responses)
  2. Swap in another user's ID — same token
  3. Also try: sequential IDs, UUID prediction, deleted IDs, other ID formats
# automate once endpoints are known
for id in $(seq 1 500); do
  curl -s -H "Authorization: Bearer $TOK" https://api.t/v1/orders/$id | head -c 200
done
  • Horizontal (same role, other user) AND vertical (user token → /admin/*) both ways.
  • GraphQL: query nesting abuse — { user(id: 1) { friends { ssn } } }, batching attacks.

#2 Broken auth on API

  • Token: no expiry, no rotation, alg:none, JWT key confusion, refresh token reuse detection absent.
  • OAuth: redirect_uri manipulation, state missing, scope escalation.
  • Password reset flows keyed by enumerable identifiers.

#3 Mass assignment

Send extra fields in the create/update body: {"role":"admin","verified":true,"balance":9999}. Frameworks bind blindly (Rails attr_accessible, Spring @ModelAttribute, Mongoose strict:false). Test on register, profile update, and EVERY PATCH.

#4 Excessive data exposure

Compare response schemas between users. Common leaks: password hashes, internal IDs, other users' PII in list endpoints, debug:true payloads, full object when UI shows 3 fields. Diff admin-vs-user responses field by field.

#5 Rate limiting & resource abuse

  • Login/OTP endpoints without lockout → brute force / SMS bombing (report, don't run to exhaustion).
  • Unbounded pagination (?limit=1000000), unbounded file upload, unauthenticated expensive queries (ReDoS, GraphQL depth).

#6 Injection surface

  • Params in URL, headers (X-Forwarded-For, custom trace headers), and JSON body — all three.
  • SSTI/NoSQL/SQLi/SSRF payloads adapted per content-type; Content-Type switch (json→xml) can unlock XXE.

Read the full file on GitHub · 54 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 54 lines · 50 tokens per session scan A 311ed15302f2

Subscribe to this mod's changes

playbook-api is a skill published in the GitHub repository s0ld13rr/pentestcode (883 stars, last pushed 2d ago), licensed MIT. It adds 50 tokens to every session and 740 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-24.