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

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.

agentmods
npx agentmods add skills/chadixearth/graphyloop/api-hardening
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00072 $0.01874
Opus 5 $0.00036 $0.00937
Sonnet 5 $0.00014 $0.00375
Haiku 4.5 $0.00007 $0.00187

Measured 4d ago against content hash 10225ad2de42, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (2 stars, last pushed 18d ago), licensed MIT. It adds 72 tokens to every session and 1,874 once invoked, about $0.0004 per session on Opus 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

Other skills, from other repositories

agent-code-analyzer

Agent skill for code-analyzer - invoke with $agent-code-analyzer.

ruvnet/ruflo · 19 tokens

worker-integration

Worker-Agent integration for intelligent task dispatch and performance tracking.

ruvnet/ruflo · 14 tokens

agui-dotnet-streaming-chat

Get started with the AG-UI .NET SDK: bootstrap and run your first streaming-chat app (client + server) with the AG-UI .NET NuGet packages (AGUI.Client, AGUI.Server, AGUI.Formatting, AGUI.Abstractions). USE FOR: which packages to install and how to wire them; constructing an AGUIChatClient against an endpoint and…

ag-ui-protocol/ag-ui · 223 tokens

agui-dotnet-sample-step

Add a GettingStarted sample Step (a Server/Client pair) to the AG-UI .NET SDK that demonstrates one protocol feature the way we want users to write it. USE FOR: adding a new samples/GettingStarted/StepNN Server+Client pair, wiring it into AGUI.slnx and the integration-test project, giving it a deterministic…

ag-ui-protocol/ag-ui · 168 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

quality-hooks

Language-specific auto-lint/format/typecheck pipeline. Supports Python (ruff+pyright), TypeScript (prettier+eslint+tsc), Go (gofmt+golangci-lint). Auto-fix and convergence loops.

a5c-ai/babysitter · 53 tokens