Protected Configuration

Guardrails System

Preserve architectural decisions and tech stack choices across AI sessions. Guardrails prevent drift, ensure consistency, and maintain the integrity of your carefully chosen preferences.

The Problem: AI Memory Loss

Without guardrails, AI assistants can:

  • Forget your preferred tech stack and suggest alternatives mid-project
  • Introduce inconsistent patterns across different features
  • Overwrite carefully crafted architecture decisions
  • Require repeated explanations of your preferences in every session

The Solution: Protected Configuration Files

ProtoFlow's guardrails system uses protected YAML files that AI cannot modify without explicit human approval. These files act as persistent memory for your project's technical decisions.

Protected

AI cannot modify guardrail files without explicit human approval

Versioned

Track changes to preferences over time with git history

Team-Shared

Consistent preferences across entire development team

Guardrail Categories

1. Tech Preferences

Define approved technologies by category

# .guardrails/tech-preferences/backend.yaml category: backend approved: - name: FastAPI version: ">=0.100.0" reason: "Async support, automatic OpenAPI docs" - name: Pydantic version: ">=2.0.0" reason: "Type validation, serialization" forbidden: - name: Flask reason: "Team standardized on FastAPI for async"

2. Architecture Preferences

Document architectural patterns and constraints

# .guardrails/architecture-preferences/api-design.yaml patterns: - name: RESTful APIs description: "Use REST conventions for all HTTP APIs" examples: - "GET /users - List users" - "POST /users - Create user" - "PUT /users/:id - Update user" constraints: - "Always use plural resource names" - "Version APIs with /v1/ prefix" - "Return 422 for validation errors"

3. AI Steering Rules

Guide AI behavior and decision-making

# .guardrails/ai-steering/code-quality.yaml rules: - id: type-safety description: "Always use type hints (Python) or TypeScript" severity: error - id: file-size description: "Keep files under 300-500 lines" severity: warning action: "Suggest decomposition when approaching limit" - id: testing description: "Write tests before implementation (TDD)" severity: error phase: 7 # TEST phase

How Guardrails Work

1

AI Checks Guardrails Before Acting

When proposing a tech stack or architecture pattern, AI first reads relevant guardrail files to understand approved choices.

2

Matching Preferences Are Prioritized

If FastAPI is in your backend preferences, AI won't suggest Flask or Django. It respects your documented choices.

3

Conflicts Require Human Approval

If AI needs to use a forbidden technology or violate a constraint, it must ask for explicit approval first.

4

Updates Are Tracked in Git

When preferences change, guardrail files are committed with clear messages documenting why the change was made.

Benefits of Guardrails

Consistency Across Sessions

Your tech preferences persist across conversations. No need to re-explain choices every time.

Team Alignment

Shared guardrails ensure everyone on the team uses the same patterns and technologies.

Faster Decision Making

Pre-approved choices mean AI can proceed confidently without asking for permission repeatedly.

Preserved Context

Architectural decisions include rationale, so future changes can be made with full context.

Reduced Tech Debt

Preventing inconsistent patterns reduces the need for refactoring later.

Onboarding Tool

New team members can read guardrails to understand team standards and preferences.

Example: Frontend Framework Choice

Without Guardrails

You: "Build a dashboard for viewing analytics"

AI: "I'll use React with Material-UI..."

You: "No, we use Next.js and shadcn/ui"

AI: "Okay, let me rebuild with Next.js..."

⏱️ Wasted 15 minutes rebuilding

With Guardrails

Guardrail file:

# .guardrails/tech-preferences/frontend.yaml approved: - name: Next.js version: ">=14.0.0" - name: shadcn/ui reason: "Accessible, customizable components"

You: "Build a dashboard for viewing analytics"

AI: "I'll use Next.js with shadcn/ui per your preferences..."

✓ Correct stack from the start

Set Up Guardrails for Your Projects

Document your tech preferences once and let ProtoFlow enforce them across all AI interactions.