The open-source safety visor for AI-assisted development. Scans code quality, secrets, and vulnerabilities before and after every AI edit — directly in your editor.
Your AI assistant doesn't know if a file is a disaster waiting to happen. ailinter gives it a pre-flight checklist. Every file gets a 0–100 quality score, and the AI is told whether to Go Ahead, Proceed with Care, or Stop & Refactor — before it generates a single line.
AI is 60% more likely to introduce defects in code with high complexity, deep nesting, or brain methods. Frontier LLMs fix only ~20% of quality issues without guidance. With MCP-augmented guidance, fix rates reach 90–100%.
Quick Start
# Install (Go)
go install github.com/ailinter/ailinter/cmd/ailinter@latest
# Scan a file
ailinter check src/main.go
# Initialize a project with .ailinter.toml + AGENTS.md
ailinter init
# Start MCP server for any AI assistant
ailinter mcp
13 languages with full detector coverage. 12 additional formats with structural and secret scanning.
Language
Extensions
Detectors
Go
.go
17/17
Python
.py
17/17
JavaScript
.js
17/17
TypeScript
.ts, .tsx
17/17
Java
.java
17/17
C/C++
.c, .cpp, .h, .hpp
17/17
Rust
.rs
17/17
Ruby
.rb
17/17
Swift
.swift
17/17
Kotlin
.kt, .kts
17/17
C#
.cs
17/17
Config formats also scanned for secrets: .env, Dockerfile, Makefile, .npmrc, etc.
Default Thresholds
Metric
Go
Python
JS/TS
Java
Nesting depth
4
4
3
4
Cyclomatic complexity
9
9
9
9
Function LOC
80
70
60
70
File LOC
1000
600
700
600
Max function args
4
4
4
5
Customize via .ailinter.toml.
Installation
Go Install
go install github.com/ailinter/ailinter/cmd/ailinter@latest
Pre-built Binaries
Linux, macOS, and Windows binaries on the Releases page.
From Source
git clone https://github.com/ailinter/ailinter.git
cd ailinter && make build && make install
Verify
ailinter --version
ailinter rules list
Usage
CLI
ailinter check src/main.go # Single file
ailinter check --json src/main.go # JSON output
ailinter check --format markdown src/ # LLM-friendly output
ailinter check --format problems src/ # VS Code / CI integration
ailinter check --no-secrets src/ # Skip secret scanning
ailinter check --lang python script.py # Force language
ailinter init # Create .ailinter.toml + AGENTS.md
ailinter init --vscode # Also create .vscode/tasks.json
ailinter rules list # Show default thresholds
MCP Server
Start the MCP server: ailinter mcp
Tool
Purpose
analyze_code
Full structural analysis with 0-100 quality score
scan_for_secrets
269-rule secret detection across 100+ providers
get_refactoring_strategy
Exact step-by-step refactoring instructions
assess_file
Quick classification: Go Ahead / Proceed with Care / Stop & Refactor
list_hotspots
Frequently-changed files with low quality scores
set_config
Set persistent configuration
get_config
View current configuration
MCP Config
# Start as MCP server
ailinter mcp
OpenCode (opencode.json) · Claude Code (.claude/mcp.json) · Cursor (.cursor/mcp.json) · GitHub Copilot · Codex · Windsurf · Continue.dev — all supported via stdio MCP.
Architecture
graph TD
AI["AI Assistant<br>(Cursor / Copilot / Claude / OpenCode)"]
Server[/"ailinter MCP Server"\]
D1["17 Detectors\n(parser)"]
D2["269 Rules\n(betterleaks)"]
D3["8 Patterns\n(refactoring)"]
D4["25 Patterns\n(vulnerability)"]
AI -->|MCP Protocol| Server
Server --> D1
Server --> D2
Server --> D3
Server --> D4
style AI fill:#1E293B,stroke:#3B82F6,stroke-width:2px,color:#F3F4F6
style Server fill:#1E1B4B,stroke:#3B82F6,stroke-width:2px,color:#F3F4F6
Or via MCP: set_config("language", "python") · set_config("read_only", "true")
Development
make build # Build to bin/ailinter
make test # Run all tests
make test-cover # Tests with coverage
make bench # Run benchmarks
make lint # go vet
make fmt # Format code
make release # Cross-platform build