Hold AI-written code accountable
SpecLeft turns declared behaviour into machine-verifiable tests, surfacing missing behaviour before AI-written code reaches production. Offline-first. Zero telemetry. Open Source.
The Problem
Why SpecLeft exists
AI coding agents are good at finishing tasks — and just as good at silently skipping behaviour. CI stays green, tests pass, and missing intent slips into production.
Intent Erosion
When behaviour isn’t explicitly specified, agents fill the gaps with assumptions. Over time, implementation drifts away from what you actually meant.
Green CI, Missing Behaviour
Tests only verify what exists. SpecLeft surfaces behaviour that was declared — but never implemented.
Traceability Pipeline
The lifecycle of a SpecLeft verified feature
Explicit Intent
Define features in markdown-based specs that both humans and LLMs can parse with 100% reliability.
Behavioral Traceability
Establish a verifiable link from behavioral specifications to implementation code and test scenarios.
Gap Analysis
Automatically surface unimplemented behavior or orphaned tests that no longer map to intent.
The Workflow
Define Features
Write behavior specs in Markdown. AI agents use these as constraints.
Define Traceability
Map spec scenarios to implementation tests to establish direct traceability of intent.
Verify Implementation
Run tests to see which parts of the spec are satisfied vs unimplemented.
# Scenario: Block login without token
# - Status: Implemented
UNIMPLEMENTED tests/auth/test_login.py::test_recovery_code
→ spec_id: 2.4.1 [Recovery Logic]
Coverage: 84% implemented
Warning: AI agent modified line 42 without updating spec state.
What SpecLeft does not do
No Inference: We never guess intent. It must be explicit in your specification artifacts.
No Auto-Gen: We don't write implementation code for you. We define the boundary.
No SaaS: Everything runs locally or in your private CI. No external APIs used.
No Telemetry: Your code and specs never phone home. Determinism is private.
Quick Install
pip install specleft
specleft init
specleft doctor
specleft status
Note: SpecLeft currently supports pytest as the primary test framework. Support for Node.js is exploratory. Please raise an issue in the GitHub Repo if you'd like support for other languages sooner.