graphql-security

Identify and mitigate GraphQL security risks including unbounded query depth, introspection exposure, and batch attacks.

20|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/thejefflarson/soundcheck --skill graphql-security-thejefflarson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql-security
Source: https://github.com/thejefflarson/soundcheck/tree/main/.claude/skills/graphql-security
Command: npx skills add https://github.com/thejefflarson/soundcheck --skill graphql-security-thejefflarson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects GraphQL deployments from unbounded query depth, unintended introspection exposure, and batch/alias attacks that can exhaust resources and leak schema details.

Core Features & Use Cases

  • Enforce fixed max query depth and cost analysis to bound resolver execution.
  • Disable introspection in production and provide per-operation rate limits for sensitive mutations.
  • Provide guidance for securing common GraphQL server setups (Apollo Server, graphql-yoga, Strawberry, gqlgen) in production.

Quick Start

Configure your GraphQL server to enforce safe query depth, limit query cost, disable production introspection, and apply per-operation rate limits to guard sensitive mutations.

Frequently Asked Questions about graphql-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a GraphQL server against unbounded query depth attacks?

Secure a GraphQL server against unbounded query depth attacks by enforcing fixed maximum query depth limits and applying cost-bound analysis to resolver execution. This prevents deeply nested queries from exhausting server resources.

How do I disable GraphQL introspection in production environments?

Disable GraphQL introspection in production by configuring production-introspection gating on your server. This prevents unintended schema exposure while allowing introspection to remain active in development environments.

What's the best way to prevent GraphQL batch and alias attacks?

The best way to prevent GraphQL batch and alias attacks is applying per-operation rate limits for sensitive mutations alongside query cost analysis. This bounds resource consumption and blocks attackers from exhausting server capacity.

Does this GraphQL security guidance work with Apollo Server and gqlgen?

Yes, this GraphQL security guidance works with Apollo Server and gqlgen, as well as graphql-yoga and Strawberry. It provides specific configuration recommendations for securing these common GraphQL server setups in production.

Why do I need cost analysis for GraphQL queries if I already have depth limiting?

You need cost analysis alongside depth limiting because depth alone cannot prevent wide, shallow queries that still exhaust resolver resources. Cost analysis assigns weights to fields, bounding total execution cost per operation.

When should I apply per-operation rate limits to GraphQL mutations?

Apply per-operation rate limits to GraphQL mutations when they access sensitive operations such as authentication or payment processing. This prevents abuse by bounding how frequently individual clients can invoke those specific resolvers.