โœจ Open Source ยท AI-Friendly ยท Quality First

Teach Your AI to Code Like a Pro

Universal configurations that teach AI coding assistants to follow engineering best practices for security, quality, and documentation.

8+
AI Tools Supported
20+
Pre-commit Hooks
100%
Security Focused

AI Generates Code Fast.
Is It Safe?

Without guardrails, AI coding assistants can create security vulnerabilities, inconsistent code, and technical debt.

๐Ÿ”“

Security Risks

AI might commit API keys, passwords, or sensitive credentials directly to your repository.

โš ๏ธ

Inconsistent Quality

Different AI tools generate different code styles, making maintenance difficult.

๐Ÿ“

Missing Documentation

AI-generated code often lacks proper type hints, docstrings, and comments.

๐ŸŽฏ The Solution

Professional Standards,
Built Into Your Workflow

AI Guardrails provides tool-specific configuration files that teach AI coding assistants to follow your engineering standards from day one.

  • Security First: Never commit secrets, enforce proper credential handling
  • Quality Enforced: Auto-format, lint, and validate all code changes
  • Universal Support: Works with Cursor, Claude, Copilot, and more
  • Easy Setup: Copy configs, run one script, and you're protected
.cursor/rules/006_security.mdc
# Security (HIGHEST PRIORITY)

priority: 100
scope: "**/*"

## NEVER Commit Secrets
โŒ API keys, tokens, passwords
โŒ Private keys (SSH, TLS)
โŒ Cloud credentials (AWS, GCP, Azure)

โœ… Use .env files (gitignored)
โœ… Provide .env.example (safe to commit)

## Example: Proper Secret Handling
import os

# โœ… CORRECT
api_key = os.environ.get("OPENAI_API_KEY")

# โŒ WRONG
api_key = "sk-1234567890abcdef"

Everything You Need for
Production-Ready AI Code

Comprehensive configurations, automated checks, and professional standards.

Works With Your
Favorite AI Tools

Native support for all major AI coding assistants with optimized configurations.

๐Ÿ–ฑ๏ธ Cursor
โœ“ Supported

Scoped .mdc files with priority system

.cursor/rules/*.mdc
๐Ÿค– Claude Desktop
โœ“ Supported

Comprehensive conversational instructions

CLAUDE.md
๐Ÿ’ฌ Claude Projects
โœ“ Supported

Optimized single-line configuration

.claudeprompt
๐Ÿ™ GitHub Copilot
โœ“ Supported

Concise, example-heavy format

.github/copilot-instructions.md
๐ŸŽจ Aider
โœ“ Supported

YAML configuration with auto-read files

.aider/.aider.conf.yml
โšก Continue.dev
โœ“ Supported

Agent config with rules and prompts

.continue/config.yaml
๐ŸŒŠ Windsurf
โœ“ Supported

Context exclusions and VS Code settings

.windsurfignore
๐Ÿ“ VS Code
โœ“ Supported

Python, YAML, JSON, Markdown formatters

.vscode/settings.json

Professional Engineering
Standards Included

Comprehensive coding standards for all major languages and formats.

Never Commit Secrets

  • โŒ API keys, tokens, passwords
  • โŒ Private keys (SSH, TLS)
  • โŒ Cloud credentials (AWS, GCP, Azure)
  • โœ… Use .env files (gitignored)
  • โœ… Provide .env.example (safe to commit)
โœ… Correct
import os

# โœ… Load from environment
api_key = os.environ.get("OPENAI_API_KEY")
if not api_key:
    raise ValueError("OPENAI_API_KEY required")

Bash Script Standards

  • โœ… Use #!/usr/bin/env bash shebang
  • โœ… Set set -euo pipefail
  • โœ… Quote all variables
  • โœ… Validate inputs and check file existence
  • โœ… Use meaningful error messages
โœ… Correct
#!/usr/bin/env bash
set -euo pipefail

# Validate input
if [[ -z "${1:-}" ]]; then
  echo "Error: Missing argument" >&2
  exit 2
fi

# Quote variables
FILENAME="$1"
echo "Processing: ${FILENAME}"

Python Code Standards

  • โœ… Type hints for public functions
  • โœ… Docstrings with Args/Returns/Raises
  • โœ… Use Black formatter (88 char line length)
  • โœ… Follow PEP 8 conventions
  • โœ… Proper error handling with specific exceptions
โœ… Correct
from typing import List

def calculate_average(numbers: List[float]) -> float:
    """Calculate the average of numbers.

    Args:
        numbers: List of numbers to average

    Returns:
        Average value

    Raises:
        ValueError: If list is empty
    """
    if not numbers:
        raise ValueError("Empty list")
    return sum(numbers) / len(numbers)

YAML & JSON Standards

  • โœ… Use .yaml extension (not .yml)
  • โœ… 2-space indentation
  • โœ… Quote string values explicitly
  • โœ… No trailing commas in JSON
  • โœ… Consistent key ordering
โœ… YAML
# Use .yaml extension
log_level: "info"
retry_count: 3
features:
  - "auth"
  - "logging"

Get Started in
2 Minutes

Copy configurations, run one script, and you're protected.

1

Clone the Repository

# Clone as a reference directory in your project
cd your-project
git clone https://github.com/christopherpaquin/Guardrails-AI .ai-guardrails
2

Copy Configuration Files

# Copy context files to your project root
cp .ai-guardrails/AGENTS.md .
cp .ai-guardrails/WORKLOG.md .
cp .ai-guardrails/WORKLOG_USAGE.md .
cp .ai-guardrails/CONTEXT.md .
cp .ai-guardrails/CONTRIBUTING.md .

# Copy tool-specific configs
cp .ai-guardrails/.cursor/ . -r
cp .ai-guardrails/CLAUDE.md .
cp .ai-guardrails/.continue/ . -r
3

Setup Pre-commit Hooks & CI/CD

# Bootstrap copies:
# - Pre-commit config (.pre-commit-config.yaml)
# - CI/CD workflows (.github/workflows/)
# - Management scripts (scripts/)
./.ai-guardrails/template/bootstrap-guardrails.sh .

# Install and activate pre-commit hooks
./scripts/setup-precommit.sh

# CI/CD activates automatically on next push!
๐ŸŽ‰

You're All Set!

AI assistants will follow your standards, pre-commit hooks will catch issues locally, and CI/CD will scan on every push.

โœ“ AI Rules Active โœ“ Pre-commit Hooks Installed โœ“ CI/CD Workflows Ready

Ready to Build Better
with AI?

Join developers using AI Guardrails for secure, high-quality code.