Search docs

Docs search
Back to Rule Catalog
AP-DQR-003Data & Query Risk

Unbounded query risk without limit/pagination evidence

Flags list/query paths without obvious limit or pagination controls.

warningviolationNo auto-fix

How to fix

  1. Add limit and pagination parameters.
  2. Set a maximum page size.
  3. For exports, move heavy reads to an explicit export workflow with operational safeguards.

What it means

A query path can return an unbounded number of rows.

Why it matters

Unbounded queries can degrade production systems and create unpredictable API behavior.

Common causes

  • A list endpoint was added without pagination.
  • A batch export reuses online request code.
  • The limit is applied in a layer ArchPilot cannot see.

Example bad pattern

findMany({ where: { organizationId } })

Example good pattern

findMany({ where: { organizationId }, take: pageSize, skip: offset })

Related files/config

  • apps/api/src
  • packages/db/prisma/schema.prisma

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-DQR-003 - Unbounded query risk without limit/pagination evidence | ArchPilot Docs