implementing-api-schema-validation-security

implementing-api-schema-validation-security is a skill for Claude Code, Codex from xalgorix/xalgorix. It costs 35 tokens per session (3,284 once invoked), scanned A, original, Apache-2.0.

Guidance for validating API requests and responses against OpenAPI or JSON Schema documents. These schemas describe the allowed fields, types, and structure of data exchanged by an API.

In plain words
What is it for?
Adding gateway and development-time validation, securing object schemas, checking responses, and reviewing common validation gaps.
Why use it?
It helps reject malformed or unexpected data, reducing risks such as injection, accidental data exposure, and unwanted field updates.

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/xalgorix/xalgorix/implementing-api-schema-validation-security
Any agent
npx skills add xalgorix/xalgorix --skill implementing-api-schema-validation-security
Clone the repo
git clone --depth 1 https://github.com/xalgorix/xalgorix

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 implementing-api-schema-validation-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/xalgorix/xalgorix/implementing-api-schema-validation-security.svg)](https://agentmods.dev/skills/xalgorix/xalgorix/implementing-api-schema-validation-security)
Your own site
<a href="https://agentmods.dev/skills/xalgorix/xalgorix/implementing-api-schema-validation-security"><img src="https://agentmods.dev/badge/skills/xalgorix/xalgorix/implementing-api-schema-validation-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,284 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00035 $0.03284
Opus 5 $0.00017 $0.01642
Sonnet 5 $0.00007 $0.00657
Haiku 4.5 $0.00003 $0.00328

Measured 4d ago against content hash 600ffe30ca28, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

implementing-api-schema-validation-security 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 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.

Makes network callslowCapability

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

curl -X POST "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/user_schemas" \
internal/tools/skills/data/api-security/implementing-api-schema-validation-security/SKILL.md · 441 lines

How it starts

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

Implementing API Schema Validation Security

Overview

API schema validation enforces that all data exchanged through APIs conforms to a predefined structure defined in OpenAPI Specification (OAS) or JSON Schema documents. This prevents injection attacks (SQLi, XSS, XXE), blocks mass assignment by rejecting unknown properties, prevents data leakage by validating response schemas, and ensures type safety across all API interactions. Schema validation operates at both the API gateway level (runtime enforcement) and during development (shift-left security).

When to Use

  • When deploying or configuring implementing api schema validation security capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Common Misconfigurations & Verification

  • additionalProperties missing or true: the single most common gap - without additionalProperties: false, mass-assignment fields pass validation; set it on every object schema.
  • Request-only validation: validating input but not responses lets excessive-data-exposure through; validate/serialize responses with explicit DTOs.
  • Loose constraints: strings without maxLength/pattern and fields without enum permit injection and DoS payloads.
  • readOnly not enforced server-side: clients can still write readOnly fields if the server only documents them rather than rejecting them.
  • Permissive/verbose errors: leaking schema detail in 400 responses aids attackers.
  • Spec drift: the deployed schema lagging the live API leaves new endpoints unvalidated.

How to verify it works: send a request with an extra/unknown field and confirm 400 (not silent acceptance); submit over-long and pattern-violating values and confirm rejection; attempt to set a readOnly field and confirm it is ignored; force a sensitive field into a response and confirm response validation strips it or fails safely; diff the enforced spec against the live route list.

Read the full file on GitHub · 441 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 · 441 lines · 35 tokens per session scan A 600ffe30ca28

Subscribe to this mod's changes

implementing-api-schema-validation-security is a skill published in the GitHub repository xalgorix/xalgorix (955 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 3,284 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

implementing-api-schema-validation-security

Implement API schema validation using OpenAPI specifications and JSON Schema to enforce input/output contracts and prevent injection, data exposure, and mass assignment attacks.

Njones17/AI-agent-master-cyber-skills-list · 35 tokens

API Contract Validator

Validate API responses against OpenAPI/Swagger specifications, JSON Schema definitions, and consumer-driven contracts to prevent breaking changes.

PramodDutta/qaskills · 26 tokens

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect BOLA/IDOR attacks, rate limit bypass, credential scanning, and injection attempts. Uses pandas for statistical analysis of request patterns and anomaly detection. Use when investigating API abuse or building API-specific threat detection rules.

mukul975/Anthropic-Cybersecurity-Skills · 72 tokens

hunt-ato

Hunt account takeover taxonomy — 9 distinct paths to ATO, plus chains. Paths: (1) password reset flaws (host-header injection redirects token, predictable/numeric token, Referer leak, no-expiry/reuse), (2) email change without re-auth, (3) OAuth account-link CSRF, (4) MFA bypass (per hunt-mfa-bypass), (5) session…

Zyrexnn/Cybermes · 241 tokens

create-tutorial

Scaffold a new Membrane API Gateway tutorial in the api-gateway repo — the numbered self-teaching YAML under distribution/tutorials/ /, its support files and README links, and the matching auto-discovered integration test. Use whenever the user asks to create, add, write, or scaffold a tutorial (or a tutorial step)…

membrane/api-gateway · 97 tokens

review-branch

Review the current git branch against master — code quality, refactoring opportunities, regressions, correctness, and test coverage — and print a severity-grouped markdown report. Use whenever the user asks to review the branch, review their changes against master, do a pre-PR / pre-merge review, or asks "is this…

membrane/api-gateway · 125 tokens