- Home
- Skills
- APIs & Backend
- GraphQL API Safety Check
More screenshots
Works with the AI Agents you already use
GraphQL API Safety Check
Check GraphQL servers and schemas before you deploy: introspection forced on, password hashes and API keys on output types, no depth limits, GraphiQL in production, CSRF off, stack traces, unpaginated lists and batching.
$5
GraphQL API Safety Check
Example session with this skill installed
Check this project with graphql-api-safety-check.
- Read your context and instructions
- Compiled the graphql api safety
$ python3 scripts/check_graphql.py examples/risky
BLOCK api/src/schema.graphql:5 G02 SENSITIVE_FIELD_EXPOSED
passwordHash: String!
Why: An output type (a type or interface, not an input) has a field that holds a password or password hash (password, passwordHash, adminPassword), a social security or card number, or a secret, token or API key as text (String, ID or a custom scalar), or a graphene-django or strawberry-django type for the User model exposes all model fields, which includes the password hash. Any client that reaches that type, often through nested fields such as post.author, can ask for the value. Token fields on types named as payloads (AuthPayload, LoginResponse) that no query returns, links to token objects (token: Token) and token or key fields behind an auth directive, a guard or a permission class are not reported; password fields always are.
Safer: Remove the field from the output type and keep the value on the server (strawberry.Private, exclude = ['password'] or an explicit fields list in graphene-django). If users need their own key, return it once in a mutation payload type (CreateApiKeyPayload), or guard the field with an owner check (an @auth directive, @Authorized or @UseGuards on the field resolver, or Strawberry permission_classes).
BLOCK api/src/schema.graphql:6 G02 SENSITIVE_FIELD_EXPOSED
BLOCK api/src/server.ts:16 G01 INTROSPECTION_FORCED_ON
REVIEW api/src/schema.graphql:35 G16 LIST_WITHOUT_PAGINATION
REVIEW api/src/schema.graphql:36 G16 LIST_WITHOUT_PAGINATION
REVIEW api/src/server.ts:12 G11 NO_DEPTH_OR_COST_LIMIT
REVIEW api/src/server.ts:17 G14 CSRF_PROTECTION_OFF
REVIEW api/src/server.ts:18 G15 ERROR_DETAILS_EXPOSED
REVIEW api/src/server.ts:19 G17 BATCHING_WITHOUT_LIMIT
REVIEW api/src/server.ts:20 G13 GRAPHQL_IDE_IN_PRODUCTION
REVIEW reports/app.py:19 G16 LIST_WITHOUT_PAGINATION
REVIEW reports/app.py:23 G11 NO_DEPTH_OR_COST_LIMIT
REVIEW reports/app.py:23 G12 INTROSPECTION_ON_BY_DEFAULT
REVIEW reports/app.py:24 G13 GRAPHQL_IDE_IN_PRODUCTION
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 5 files, 3 with GraphQL content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
One introspection: true left in your Apollo Server options hands the whole production schema, admin mutations included, to anyone who asks. One passwordHash field on type User lets any client read it through post.author or any other path to that type. This skill finds those and seven other GraphQL mistakes before you deploy, and tells you how to fix each one.
Your agent runs a scanner on your .graphql, .gql and .graphqls schema files, schema text inside code (gql tags, #graphql strings, typeDefs, Ariadne gql), and the server code of Apollo Server 2 to 5, NestJS GraphQL, GraphQL Yoga, Mercurius, express-graphql, graphql-http, TypeGraphQL, Strawberry, graphene and graphene-django, Ariadne and gqlgen. It tells output types from input types, knows each library's defaults (Apollo turns introspection off when NODE_ENV is production; Yoga and Strawberry serve GraphiQL unless told not to; gqlgen's starter server.go turns introspection on), accepts settings behind a check that keeps them out of production (NODE_ENV !== 'production', isDev ternaries, if settings.DEBUG) but not checks such as NODE_ENV !== 'test', and looks across all scanned files before it says a depth limit or an introspection switch is missing. Login payloads such as AuthPayload.token, links such as token: Token, paging tokens such as nextToken, and key fields behind an auth directive, guard or permission class are left alone. It never runs your server or app. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK
- G01: introspection forced on with no check that keeps it out of production (introspection: true in Apollo Server or NestJS, introspection=True in Ariadne)
- G02: passwords, password hashes, SSNs, card numbers, and secrets, tokens and API keys held as text on output types (SDL, Strawberry, graphene, NestJS and TypeGraphQL @ObjectType classes, graphene-django or strawberry-django User types with all fields)
REVIEW
- G11: servers with no query depth or cost limit anywhere in the project
- G12: introspection left on by default (Yoga, Mercurius, express-graphql, graphql-http, Strawberry, graphene, Ariadne, gqlgen NewDefaultServer and the extension.Introspection line gqlgen init writes)
- G13: GraphiQL, GraphQL Playground or Apollo Sandbox served in production
- G14: csrfPrevention: false, or a Django GraphQL view wrapped in csrf_exempt
- G15: stack traces and raw errors sent to clients (includeStacktraceInErrorResponses, debug, maskedErrors: false, formatError with error.stack)
- G16: root query lists without first, limit, page or cursor arguments
- G17: batched requests without a limit (allowBatchedHttpRequests, Apollo Server 3 defaults, allowBatchedQueries, graphene-django batch=True)
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example project (an Apollo Server 4 shop API with its schema and resolvers, and a Strawberry reports service), and the real report the scanner produces on the risky one
Limits It reads file text. Server options built in another file and passed in as a variable, schemas built at run time, permission checks inside resolvers, and gateway or router settings (Apollo Router, Hasura, PostGraphile) are not followed. An environment check is recognised around the setting itself, not an early return or a feature flag. Rate limiting, authentication, persisted operations, CORS and dependency vulnerabilities are not checked. NOT FLAGGED is not a guarantee.
Static check of schema and server code text. Options passed in from other files, run-time schemas, resolver permission checks, gateways and routers, rate limiting and dependency vulnerabilities are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The scanner only reads files. It never starts the GraphQL server, sends queries or uses the network. The example projects hold no secrets.