api-hardening

api-hardening is a skill for Claude Code, Codex from chadixearth/graphyloop. It costs 72 tokens per session (1,874 once invoked), scanned B, original, MIT.

A security checklist for server-side entry points, such as web routes, API handlers, webhooks, scheduled jobs, and background workers.

In plain words
What is it for?
Use it when building or reviewing endpoints, authentication, sessions, roles, tenant separation, payments, file uploads, personal data, webhooks, cron jobs, or queue consumers.
Why use it?
It helps prevent authenticated users from accessing other users' data and catches missing input checks, permissions, rate limits, and related protections.

Skill for Claude CodeCodex

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

Good fit Use it when building or reviewing endpoints, authentication, sessions, roles, tenant separation, payments, file uploads, personal data, webhooks, cron jobs, or queue consumers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chadixearth/graphyloop/api-hardening
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 chadixearth/graphyloop --skill api-hardening
Clone the repo
git clone --depth 1 https://github.com/chadixearth/graphyloop

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 api-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/chadixearth/graphyloop/api-hardening/github.svg)](https://agentmods.dev/skills/chadixearth/graphyloop/api-hardening)
Your own site
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/api-hardening"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/api-hardening/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 api-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/api-hardening"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/api-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,874 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 3 findings. 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.00072 $0.01874
Opus 5.5 $0.00029 $0.00750
Sonnet 5.5 $0.00014 $0.00375
Haiku 4.5 $0.00007 $0.00187

Measured 3mo ago against content hash 10225ad2de42, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

api-hardening scanned grade B with 3 findings 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 3mo ago.

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.

Sends data to an external URLlowData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -si -X POST host/api/orders -H "content-type: application/json" -d '{"role":"admin"}' # rejected

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

(`169.254.169.254`) are the classic target.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

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

curl -si -X GET host/api/orders/<other-users-id> -H "authorization: Bearer $A" # expect 404/403
skills/api-hardening/SKILL.md · 142 lines

How it starts

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

API hardening

Most breached endpoints were authenticated. The pattern is not "no login" — it is "logged in, and the handler never checked that this row belongs to this caller." Authorization is per route, per object, every time. This skill is the server-side pass that goes route by route.

When to activate

  • Any new or changed endpoint: REST route, GraphQL resolver, RPC/tRPC procedure, server action, webhook receiver, queue consumer, cron entry.
  • Anything touching auth, sessions, roles, tenants, payments, uploads, or PII.
  • A bug report shaped like "user A can see user B's data" or "it 500s with a weird message".
  • Before a deploy that exposes a new surface publicly.

Route inventory first

Enumerate what exists before judging it. Grep the router, not your memory:

# Node/Next
rg -n "app\.(get|post|put|patch|delete)|router\.(get|post|put|patch|delete)" src
rg -n "export async function (GET|POST|PUT|PATCH|DELETE)" app
rg -n "'use server'" -l app src
# Python / Go / PHP
rg -n "@app\.(route|get|post)|@router\.(get|post)" .
rg -n "http.HandleFunc|mux.Handle" .
rg -n "Route::(get|post|put|delete)" routes

Build a table: method+path · auth required? · role/scope · object-ownership check · input validated? · rate limited? Every empty cell is a finding.

1. Authentication vs authorization

  • Authentication answers who; authorization answers may they, on this object. Middleware usually gives you the first and never the second.
  • Default deny. Public routes are an explicit allow-list, not "everything the middleware matcher forgot". Verify the matcher: a regex that misses /api/admin/../users or a trailing slash is a bypass.
  • IDOR / BOLA — the top one. Any handler taking an id from the request must scope the query by the caller: where id = :id and owner_id = :caller (or tenant/org id). Filtering after the fetch, or trusting a userId sent in the body/JWT payload the client can re-sign, is not a check.
  • Return 404 for objects the caller may not see, 403 only where existence is not sensitive. A 403 confirms the id exists.
  • Role checks server-side only, from the session/token verified this request — never from a header, query param, or hidden form field.
  • Multi-tenant: the tenant id comes from the session, never from the payload. In Postgres/Supabase, RLS is the second wall, not the only one — see supabase-setup.

Read the full file on GitHub · 142 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. 3mo ago First seen · 142 lines · 72 tokens per session scan B 10225ad2de42

Subscribe to this mod's changes

api-hardening is a skill published in the GitHub repository chadixearth/graphyloop (3 stars, last pushed 1mo ago), licensed MIT. It adds 72 tokens to every session and 1,874 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 3 findings (sends data to an external url, cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

api-hardening compared with skills from other repositories

api-hardening next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-hardeningchadixearth/graphyloopSkill31mo agoMITB72Claude Code, Codex
event-store-designwshobson/agentsSkill43k2d agoMITA33Claude Code
agui-dotnet-streaming-chatag-ui-protocol/ag-uiSkill22ktodayMITA223Claude Code
agui-dotnet-protobufag-ui-protocol/ag-uiSkill22ktodayMITA162Claude Code
workflow-orchestration-patternswshobson/agentsSkill43k2d agoMITA49Claude Code
microservices-patternswshobson/agentsSkill43k2d agoMITA38Claude Code
durable-objectsfcakyon/claude-codex-settingsSkill1.2ktodayApache-2.0A22Claude Code