agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/api-security/api-schema-security/SKILL.md

api-schema-security

Skill0 starsChanged 11 days agoMITView on GitHub

Review and lint API specifications (OpenAPI 3.x, GraphQL schemas) for security — authentication on every operation, strict schemas (additionalProperties false, formats, max lengths), rate-limit and pagination limits, sensitive fields, server URLs — with Spectral/OWASP rulesets, and enforce schema validation at the gateway. Use when reviewing an API design, adding API linting to CI, or hardening request validation.

The file

Files
SKILL.md

API Schema Security

Lint

npx @stoplight/spectral-cli lint openapi.yaml --ruleset .spectral.yaml

.spectral.yaml:

extends:
  - spectral:oas
  - https://unpkg.com/@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs

The OWASP ruleset flags missing security schemes, HTTP servers, unbounded strings/arrays, missing rate-limit headers, numeric IDs, and more. 42Crunch and similar tools provide commercial audits.

Checklist

AreaCheck
AuthNGlobal security requirement; no operation with security: [] unless intentionally public
SchemasadditionalProperties: false on request bodies (prevents mass assignment), maxLength/pattern/format on strings, maxItems on arrays, numeric minimum/maximum
IdentifiersPrefer non-sequential IDs; never rely on them for authorization
ResponsesExplicit response schemas; no internal fields (hashes, internal IDs, tokens)
PaginationEnforced max page size
Servershttps:// only; no internal hostnames in public specs
ErrorsGeneric error schema without stack traces
GraphQLDisable introspection in production (or restrict), query depth/complexity limits, per-field authorization, persisted queries for public clients

Enforce at runtime

Gateway request validation against the spec (Kong/Apigee/AWS API Gateway request validators, Envoy/OPA policies, framework validators like FastAPI/pydantic, express-openapi-validator) — reject unknown fields and invalid types before business logic.

Related skills

api-inventory, api-authorization-testing, release-gate

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.