Skip to content

Configuration

PenumbraForge edited this page Mar 29, 2026 · 1 revision

Configuration

Gate works out of the box with zero configuration. All settings are optional.

.gaterc (Project Config)

Create a .gaterc file in your project root (YAML or JSON):

# Entropy threshold (higher = fewer false positives, lower = more sensitive)
entropy_threshold: 4.8

# Hook types to install
hooks:
  - pre-commit
  - pre-push

# Maximum file size to scan (default: 2MB)
max_file_size: 5MB

# Output settings
output:
  format: text        # text, json, or sarif
  color: auto         # true, false, or auto
  context_lines: 2    # Lines of context around findings

# Per-rule severity overrides
severity:
  us-ssn: ignore              # Suppress SSN detection
  high-entropy-string: low    # Downgrade entropy findings

# Custom detection rules
rules:
  - id: internal-api-key
    name: Internal API Key
    pattern: "INTERNAL_[A-Z0-9]{32}"
    severity: high
    remediation: "Rotate in internal dashboard"

.gateignore (Suppression)

Create a .gateignore file to suppress false positives:

# Ignore entire directories
vendor/**
test/fixtures/**
*.min.js

# Rule-scoped suppression (only suppress specific rules in specific files)
[rule:high-entropy-string] src/crypto/**
[rule:us-ssn] test/pii-samples.txt

# Negation (un-ignore a file)
!src/config/production.yml

Inline Suppression

Add a comment to suppress a specific line:

const exampleKey = "AKIAIOSFODNN7EXAMPLE"; // gate-ignore: documentation example

User-Level Config

Global settings apply to all projects:

~/.config/gate/config.yaml

Project .gaterc overrides user-level settings. Severity maps are deep-merged (both apply).

Environment Variables

Variable Description
GATE_SKIP=1 Bypass the pre-commit hook
GATE_ALLOW_MISSING=1 Allow commits when Gate binary is not found
GATE_NODE_PATH=/path/to/node Explicit Node.js path for hooks
NO_COLOR=1 Disable colored output
DEBUG=1 Enable verbose error output

Clone this wiki locally