Skip to main contentSkip to navigation
Back to Home
Guardrail
Documentation

Welcome to Guardrail

Guardrail is a comprehensive platform for adding safety guardrails to AI-powered development. It helps teams ship faster while maintaining code quality, security standards, and preventing common AI coding mistakes.

Security First

OWASP Top 10 scanning

Fast & Accurate

Sub-second scan times

CI/CD Ready

Native integrations

Quick Start

Get Guardrail up and running in your project in just a few commands.

1Install the CLI

Install via npm
$npm install -g @guardrail/cli

2Run Your First Scan

Scan current directory
$guardrail scan .

Configuration

Create a guardrail.config.js file in your project root to customize Guardrail's behavior.

// guardrail.config.js
module.exports = {
  // Scanning options
  scan: {
    paths: ['src', 'lib'],
    exclude: ['node_modules', 'dist', '**/*.test.ts'],
    severity: 'medium', // minimum severity to report
  },
  
  // Reality Mode settings
  reality: {
    enabled: true,
    patterns: ['TODO', 'FIXME', 'mock', 'placeholder'],
    strictMode: false,
  },
  
  // Ship Check configuration
  ship: {
    requirePassing: ['security', 'reality'],
    blockOn: ['critical', 'high'],
    notifications: {
      slack: process.env.SLACK_WEBHOOK_URL,
    },
  },
};

CLI Reference

guardrail scan

Run security and code quality scans on your codebase.

guardrail scan [path] [options]

Options:
  --severity <level>    Minimum severity to report (low|medium|high|critical)
  --format <type>       Output format (json|table|sarif)
  --exclude <patterns>  Glob patterns to exclude
  --ci                  CI mode - exits with non-zero on findings
  --fix                 Auto-fix issues where possible

guardrail ship

Pre-deployment validation to ensure code is ready to ship.

guardrail ship [options]

Options:
  --check              Run all checks without deploying
  --block-on <level>   Block deployment on severity level
  --report             Generate detailed report
  --notify             Send notifications on completion

GitHub Actions Integration

Add Guardrail to your CI/CD pipeline with our official GitHub Action.

name: Guardrail Check
on: [push, pull_request]

jobs:
  guardrail:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Guardrail
        uses: guardrail/action@v1
        with:
          scan-path: ./src
          fail-on: high
        env:
          GUARDRAIL_API_KEY: ${{ secrets.GUARDRAIL_API_KEY }}

Next Steps