PreFlight
av29nassh-sketch/PreFlight
Porta de segurança local para código gerado por IA com AST e deep reasoning
Ver no GitHubMCP server que atua como porta de segurança local para código gerado por IA, detectando e corrigindo automaticamente vulnerabilidades, vazamentos de credenciais e falhas arquiteturais. Funciona em dois modos: análise AST local gratuita e ilimitada, e deep reasoning em nuvem para flaws complexos. Integra-se nativamente com editores e fluxos de trabalho de IA.
Instalação
npx convez-ai av29nassh-sketch/PreFlight1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Validar código gerado por assistentes de IA antes de commit
- Detectar vazamentos de credenciais e secrets em frontend
- Identificar falhas arquiteturais em lógica multi-arquivo (SQL injection, CORS, RLS)
- Integrar verificação de segurança em pipelines de CI/CD
Veredito

Ferramenta especializada e bem-pensada para um problema real: conter drift de código gerado por IA. O modelo freemium (10 fixes locais grátis + scanning AST ilimitado) é justo. Recomendado para equipes que usam ativamente AI coding assistants e precisam de barreira de segurança antes da produção.
README
A tradução para o português deste README ainda está na fila.
PreFlight
⚡ Choose Your Remediation Depth
PreFlight runs in two distinct tiers depending on what your codebase needs:
🟢 Free Tier (Local AST)
- What it does: Scans and automatically fixes basic security and structural issues completely offline.
- Free fix allowance: Includes 10 free auto-fix applications before a
PREFLIGHT_PRO_KEYis required for additional fix workflows. Local scanning remains completely free and unlimited. - Setup: Zero config. Works instantly out of the box.
- Commands:
npm install -g preflight-pro preflight scan . --fix
Installing preflight-pro exposes the universal preflight command in your shell.
🚀 Pro Tier (Deep Reasoning)
-
What it does: Scans and automatically fixes everything—including complex multi-file architectural flaws, tenant isolation logic, and parametric SQL injections.
-
Setup: Requires an active
PREFLIGHT_PRO_KEYenvironment variable. -
Commands:
# PowerShell $env:PREFLIGHT_PRO_KEY="PREFLIGHT-BETA-XXXXX" preflight scan . --fix# Bash / macOS export PREFLIGHT_PRO_KEY="PREFLIGHT-BETA-XXXXX" preflight scan . --fix
Stop AI Coding Drift before it becomes production technical debt. PreFlight is a local-first safety gate and deterministic orchestration engine designed to catch risky, hallucinated, or unverified AI-generated code snippets inside modern AI coding workflows.
Pricing
- Free Tier: Unlimited local AST scanning plus 10 free auto-fix applications before a Pro key is required for more fix runs.
- Solo Founder Tier:
$19/month - Team Tier:
$49/seat/month
The Tri-State Risk Score Engine
PreFlight parses your code down to an Abstract Syntax Tree (AST) using Tree-Sitter, passing ambiguous findings through deep reasoning layers to enforce explicit architectural contracts:
- 🔴 Hard Block: Exposed frontend secrets, leaking database service roles, or missing Supabase Row Level Security (RLS).
- 🟡 High-Risk Drift: Structural state inconsistencies, un-idempotent webhooks, or open CORS contexts.
- 🟢 Likely Safe: Standard algorithmic changes matching your pre-defined stack rules.
2-Phase Pipeline
PreFlight Pro runs as a strict 2-phase remediation pipeline:
- Phase 1: Offline Local AST Sweep PreFlight completes an ultra-fast offline structural pass first and applies any local-only fixes it can resolve without calling the cloud reasoning layer.
- Phase 2: PreFlight Pro Deep Reasoning Handoff Only the remaining SQL and complex architectural flaws are handed off through the secure proxy-backed Pro Engine reasoning path for premium remediation suggestions.
Editor & MCP Usage
PreFlight can run directly in the terminal or as an MCP server for AI-native editors.
Free tier note: scan_project remains free and unlimited. preflight_fix can successfully apply up to 10 free fixes total before a PREFLIGHT_PRO_KEY is required.
Start the MCP server locally:
node index.js mcp
Available MCP tools include:
scan_projectpreflight_fixaudit_dependencies
Post-Fix Verification Loop
PreFlight is designed to be used as a closed loop, not a one-shot scanner:
- Generate or modify code with your AI coding assistant.
- Run
preflight scan .to classify the change under the Tri-State Risk Score. - If PreFlight returns
Hard Block, stop and repair the structural issue before moving forward. - If PreFlight returns
High-Risk Drift, runpreflight scan . --fixand inspect every proposed fix before applying it. - Re-run
preflight scan .after each accepted fix to confirm the repository settles intoLikely Safe. - Ship only after the final verification pass is green and the structural receipt matches the architecture boundary you intended.
This verification loop is the product: scan, review, patch, re-scan, then deploy with confidence.