{"id":5943,"date":"2026-06-22T23:14:50","date_gmt":"2026-06-22T16:14:50","guid":{"rendered":"https:\/\/daiilynews.cu.ma\/?p=5943"},"modified":"2026-06-22T23:14:50","modified_gmt":"2026-06-22T16:14:50","slug":"av29nassh-sketch-preflight-the-local-security-gate-for-ai-generated-code-%c2%b7-github","status":"publish","type":"post","link":"https:\/\/daiilynews.cu.ma\/?p=5943","title":{"rendered":"av29nassh-sketch\/PreFlight: The local security gate for AI-generated code. \u00b7 GitHub"},"content":{"rendered":"<p> <br \/>\n<br \/>\nStop AI Coding Drift before it becomes production technical debt. PreFlight is a local-first safety gate for AI-generated code, built to catch unsafe auth, RLS, SQL, SSRF, command execution, dependency, and secret-handling changes before they get committed.<br \/>\nWebsite: https:\/\/preflight-vibe.vercel.app<br \/>\nChoose Your Remediation Depth<br \/>\nPreFlight runs in two distinct tiers depending on what your codebase needs.<br \/>\nFree Tier: PreFlight Guardian<\/p>\n<p>What it does: Unlimited local scanning plus 10 free patch applications across local deterministic fixes and proxy-backed AI fixes.<br \/>\nSetup: Zero config for scanning. A Pro key is only required after the 10 free patches are used.<br \/>\nCommands:<\/p>\n<p>npm install -g preflight-pro<br \/>\npreflight init<br \/>\npreflight scan . &#8211;fix<br \/>\nInstalling preflight-pro exposes the universal preflight command in your shell.<\/p>\n<p>What it does: Unlimited scans and unlimited fixes, including deep reasoning remediation for complex multi-file architectural flaws, tenant isolation logic, and parametric SQL injections.<br \/>\nSetup: Requires an active PREFLIGHT_PRO_KEY or a saved key from preflight auth.<br \/>\nPowerShell:<\/p>\n<p>$env:PREFLIGHT_PRO_KEY=&#8221;PREFLIGHT-BETA-XXXXX&#8221;<br \/>\npreflight scan . &#8211;fix<\/p>\n<p>export PREFLIGHT_PRO_KEY=&#8221;PREFLIGHT-BETA-XXXXX&#8221;<br \/>\npreflight scan . &#8211;fix<\/p>\n<p>PreFlight supports both a terminal-first workflow and an IDE-first workflow. Both paths end with preflight init, because that wizard connects your editor, MCP clients, and Pro\/Beta key in one place.<\/p>\n<p>npm install -g preflight-pro<br \/>\npreflight init<br \/>\nThen scan any project from its root:<\/p>\n<p>Install the global CLI command. The VSIX gives you the in-editor UI, but the extension still uses the global preflight command to start The Eye daemon and run fixes.<\/p>\n<p>npm install -g preflight-pro<\/p>\n<p>Download and install the PreFlight Companion VSIX extension:<\/p>\n<p>Run the setup wizard once:<\/p>\n<p>Open your project in the IDE. The extension starts The Eye automatically, watches file saves, and surfaces PreFlight alerts in-editor.<\/p>\n<p>The Eye: The VS Code\/Cursor extension starts PreFlight&#8217;s local daemon automatically. It watches file saves and raises in-editor alerts when AI-generated code introduces a hard-block issue.<br \/>\nMCP bridge: preflight init can also wire preflight mcp into supported AI editors so agents can call PreFlight tools without leaving the coding flow.<\/p>\n<p>Free users get unlimited scans and 10 total patches across local fixes and proxy-backed AI fixes. After the 10 free patches are used, unlimited fixes require a Pro\/Beta key.<br \/>\nYou can add your key during preflight init, or activate it directly:<br \/>\npreflight auth PREFLIGHT-BETA-XXXXX<br \/>\nFor one terminal session, you can also set it manually:<br \/>\n$env:PREFLIGHT_PRO_KEY=&#8221;PREFLIGHT-BETA-XXXXX&#8221;<br \/>\nexport PREFLIGHT_PRO_KEY=&#8221;PREFLIGHT-BETA-XXXXX&#8221;<\/p>\n<p>Free Tier: Unlimited scans, 10 Free Patches (Local + Deep-Reasoning AI).<br \/>\nSolo Pro: $19\/mo for unlimited scans and fixes.<br \/>\nTeams: $49\/seat\/mo for team rollout, shared onboarding, and unlimited scans and fixes.<\/p>\n<p>PreFlight is now powered by deeper local analysis primitives:<\/p>\n<p>Micro-Fuzzer: Generates focused security payloads for risky data-flow paths, such as SQL injection, command injection, auth bypass, SSRF, and path traversal.<br \/>\nQuantized CPG (Code Property Graph): Builds a compact in-memory graph of syntax, control flow, and data flow so PreFlight can trace untrusted input into dangerous sinks instead of relying on brittle string matching.<br \/>\nThe Eye daemon: Runs locally through the CLI\/extension workflow and watches file saves so issues appear while the AI coding session is still active.<\/p>\n<p>Tri-State Risk Score Engine<br \/>\nThis is the core PreFlight signal. Every scan resolves into one of three clear outcomes so you know whether to stop, review, or ship.<\/p>\n<p>Score<br \/>\nMeaning<br \/>\nWhat It Catches<\/p>\n<p>\ud83d\udd34 Hard Block<br \/>\nStop immediately. This change is unsafe to ship.<br \/>\nExposed frontend secrets, leaking database service roles, command execution, SQL injection, or missing Supabase Row Level Security (RLS).<\/p>\n<p>\ud83d\udfe1 High-Risk Drift<br \/>\nReview carefully. The code may be structurally wrong even if it runs.<br \/>\nStructural state inconsistencies, un-idempotent webhooks, weak validation, or open CORS contexts.<\/p>\n<p>\ud83d\udfe2 Pass<br \/>\nSafe to continue. No blocking structural risk was detected.<br \/>\nStandard local edits matching your expected stack rules.<\/p>\n<p>PreFlight runs fixes in a strict sequence:<\/p>\n<p>Phase 1: Offline Local AST Sweep<br \/>\nPreFlight completes an ultra-fast offline structural pass first and applies any deterministic local fixes it can resolve safely.<br \/>\nPhase 2: PreFlight Pro Deep Reasoning Handoff<br \/>\nRemaining SQL, fuzzer, and complex architectural flaws are handed off through the secure proxy-backed reasoning path when a patch requires deeper context.<\/p>\n<p>The first 10 patch applications are free across both phases. After that, a PREFLIGHT_PRO_KEY is required.<\/p>\n<p>PreFlight can run directly in the terminal, through the VS Code\/Cursor extension, or as an MCP server for AI-native editors.<br \/>\nStart the MCP server locally:<\/p>\n<p>Available MCP tools include:<\/p>\n<p>scan_project<br \/>\npreflight_fix<br \/>\naudit_dependencies<\/p>\n<p>scan_project remains free and unlimited. preflight_fix shares the global 10-patch free allowance before a PREFLIGHT_PRO_KEY is required.<br \/>\nPost-Fix Verification Loop<br \/>\nPreFlight is designed to be used as a closed loop, not a one-shot scanner:<\/p>\n<p>Generate or modify code with your AI coding assistant.<br \/>\nRun preflight scan . to classify the change under the Tri-State Risk Score.<br \/>\nIf PreFlight returns Hard Block, stop and repair the structural issue before moving forward.<br \/>\nIf PreFlight returns High-Risk Drift, run preflight scan . &#8211;fix and inspect every proposed fix before applying it.<br \/>\nRe-run preflight scan . after each accepted fix to confirm the repository settles into Pass.<br \/>\nShip only after the final verification pass is green and the structural receipt matches the architecture boundary you intended.<\/p>\n<p>This verification loop is the product: scan, review, patch, re-scan, then deploy with confidence.<br \/>\n<br \/><br \/>\n<br \/><a href=\"https:\/\/github.com\/av29nassh-sketch\/PreFlight\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stop AI Coding Drift before it becomes production technical debt. PreFlight is a local-first safety gate for AI-generated code, built to catch unsafe auth, RLS, SQL, SSRF, command execution, dependency, and secret-handling changes before they get committed. Website: https:\/\/preflight-vibe.vercel.app Choose Your Remediation Depth PreFlight runs in two distinct tiers depending on what your codebase needs. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5944,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[676],"tags":[],"class_list":["post-5943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-ai"],"_links":{"self":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts\/5943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5943"}],"version-history":[{"count":0,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts\/5943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/media\/5944"}],"wp:attachment":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}