In the race to build the ultimate AI coding assistant, the industry has settled on a shared, deeply flawed paradigm. Let’s call it Generate-and-Pray.
Whether you are using Cursor, GitHub Copilot, Cline, or custom wrapper scripts, the flow is identical:
- You prompt the LLM.
- The LLM generates a code patch.
- The tool writes that patch directly to your filesystem.
- You, the human, are forced to be the verification layer. You review the diff, run the compiler, catch hallucinated package imports, execute the test suite, and rollback when things inevitably blow up.
This is chaotic, exhausting, and unsafe.
I wanted an assistant that acts like a senior engineer. Someone who tests and compiles their code before showing it to me. So, I built Kode: a contrarian, verification-first AI coding agent.
Here is why we need to shift from generation to verification, and the engineering details of how Kode does it.
The Thesis: No Generation Without Verification
Kode is built on a simple rule: The LLM is the generative engine, but a local Go orchestrator is the security layer.
Every time the model generates a patch, it passes through a static, pre-compiled Go binary (kode.exe) that executes 9 deterministic verification gates in under 50 milliseconds before a single byte touches your active filesystem. If a gate fails, the patch is rejected, and the compiler-grade error is fed back to the LLM to self-correct.
┌─────────────────────────┐
│ User Prompt │
└────────────┬────────────┘
▼
┌─────────────────────────┐
│ LLM Generates Patch │
└────────────┬────────────┘
▼
┌─────────────────────────┐
│ 9 Verification Gates │◀───┐ (Self-Correction Loop)
└────────────┬────────────┘ │
│ │
[Pass]? ├─(No)────────────┘
│
(Yes)
▼
┌─────────────────────────┐
│ Write to Filesystem │
└─────────────────────────┘
By shifting safety-checks left directly into the editor, the user is never the debugger.
Under the Hood: The 9 Verification Gates
To make pre-write verification viable, checks must run near-instantaneously. Here is how the compiled Go engine enforces safety:
- AST Syntax Gate: Parses modified files using official Tree-sitter bindings (precision AST parser), falling back to regex heuristics when CGo is unavailable. Parse error = hard block.
- Imports Gate: Cross-references every generated import path against the local dependency graph. No more hallucinated npm or Go packages.
- Calls Gate: Validates that function and method call sites map to real, existing symbols with matching signatures.
- Blast Radius Gate: Walks the dependency graph backward. If the patch affects more files downstream than your threshold allows, it's blocked.
- Architecture Gate: Enforces module boundaries (e.g. database layers are blocked from importing route handlers).
- Security Gate (SAST): Runs a compiled local SAST engine over the AST to block SQL injections, XSS, and hardcoded credentials.
- Sandbox Replay Gate: Ephemerally executes code in a CPU-bounded sandbox to trap infinite loops, memory leaks, and rogue sockets.
- QR Code Tunnel Gate: Boots a secure public dev tunnel for local web servers and prints a QR code in your terminal so you can preview layout changes instantly on your phone.
- Browser E2E Gate: Generates and runs headless Playwright scripts on your dev server, capturing UI recordings and rolling back if console errors are caught.
3 Killer Features No Incumbent Offers
Building a verification engine opened the door to capabilities that standard extension wrappers simply cannot implement:
1. Ghost Branches (Survival of the Fittest)
Why run one prompt when you can run three? Kode can spawn parallel git worktrees (Ghost Branches) to explore different implementation paths. Each path runs through the Verification pipeline and test suites. Kode evaluates the results, scores them, and automatically merges the highest-scoring candidate back into your workspace.
2. Blindfold Mode (Enterprise Privacy)
For corporate developers, sending proprietary code to third-party LLMs is a compliance nightmare. Blindfold Mode performs a local AST parse and SHA-256 obfuscates all identifiers (variable names, types, functions, packages) before payloads leave your machine. A local mapping table translates them back on response. The cloud model sees your code's logic, but never its intellectual property.
3. Hands-Free Voice Programming (kode voice)
No typing required. Just run kode voice, speak your task, and the local mic captures and transcribes it using Whisper. The text is immediately fed into the Plan-Generate-Verify pipeline.
Open Source Licensing: The MIT + AGPLv3 Hybrid Model
To protect against SaaS wrappers while retaining enterprise-friendly local execution, Kode adopts a dual-license model:
- MIT License: The core developer tooling (CLI, TUI, internal modules, and web app) is fully permissive.
-
AGPLv3 License: The cloud-ready LLM gateway and routing proxy server (
cmd/gateway/andinternal/gateway/) require any hosted SaaS wrappers to open-source their orchestration code.
Getting Started
Kode is a Bring Your Own Key (BYOK) platform. It compiles to a lightweight ~10MB Go binary with zero external runtime dependencies.
Installation
- macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.sh | bash
- Windows (PowerShell):
irm https://raw.githubusercontent.com/sicario-labs/kode/master/script/install.ps1 | iex
- Termux (Android): Build and compile on ARM64 Termux:
pkg install golang nodejs git clang make
go build -o bin/kode ./cmd/kode
cd third_party/opencode && npm install
Once installed, scaffold your configuration with:
kode init
And start a task loop:
kode loop "add JWT validation to the login route"
Check out the full repository and contribute at github.com/sicario-labs/kode. We'd love to hear your thoughts on shifting the AI coding paradigm from generation to verification!
Top comments (0)