gate.config.ts

Gate works with no configuration at all. Add a config file when you want to change the threshold, suppress a finding, or record why something is acceptable.

Creating one

gate init

gate.config.ts

import { defineConfig } from '@usegate/core'

export default defineConfig({
  severity: 'high',

  ignore: [
    {
      rule: 'GATE007',
      reason: 'Internal development MCP server, pinned in our own registry',
    },
  ],

  telemetry: true,
})

Options

  • Name
    severity
    Type
    'info' | 'low' | 'medium' | 'high' | 'critical'
    Description

    Severity at which gate scan exits non-zero. Default 'high'.

  • Name
    ignore
    Type
    IgnoreEntry[]
    Description

    Suppressed findings. Each entry may match on rule, path, server, or a combination, and requires a reason. See ignoring findings.

  • Name
    ignorePaths
    Type
    string[]
    Description

    Repository-relative paths excluded from discovery. Supports * and **.

  • Name
    adapters
    Type
    { include: string[]; exclude: string[] }
    Description

    Which adapters run. An empty include means all detected adapters.

  • Name
    telemetry
    Type
    boolean
    Description

    Send anonymous aggregate usage data. Default true. See telemetry.

  • Name
    baseline
    Type
    string | false
    Description

    Baseline path, or false to disable. Default '.gate/baseline.json'.

  • Name
    requireIgnoreReason
    Type
    boolean
    Description

    Refuse to honour an ignore entry with no reason. Default true. Turning it off lets exceptions accumulate with no record of why.

  • Name
    limits
    Type
    { maxFiles: number; maxFileSizeBytes: number }
    Description

    Hard caps on discovery. Defaults: 2000 files, 2 MB per file.

File formats

Gate looks for these, in order:

  1. gate.config.ts
  2. gate.config.mts
  3. gate.config.mjs
  4. gate.config.js
  5. gate.config.json
  6. a "gate" key in package.json

gate.config.json

{
  "severity": "high",
  "ignore": [
    { "rule": "GATE007", "reason": "Pinned in our internal registry" }
  ],
  "telemetry": true
}

Precedence

Command-line flags beat the config file. That lets a pipeline be stricter than a developer's laptop without editing anything:

gate scan --severity critical   # overrides severity: 'high'
gate scan --no-telemetry        # overrides telemetry: true

Was this page helpful?