A SQL injection in dead code is noise. A SQL injection reachable from 47 callers including your auth endpoint is critical. Cartomancer bridges the gap between "pattern matches" and "this matters."
Every PR goes through an 11-stage pipeline. Each stage adds context that makes the next one smarter.
opengrep
3000+ rules + your custom YAML rules. Baseline-aware: only flags new findings in the diff.
cartog
Blast radius, caller graphs, domain detection. Knows if a finding touches auth or payment flows.
severity matrix
Findings auto-upgrade based on blast radius, domain tags, and caller count. Per-rule overrides.
LLM
High-severity findings explained by Ollama or Claude. Suggested fix as diff + AI agent prompt.
GitHub API
Categorized inline comments, off-diff caution banners, summary with actionable counts.
Cartomancer posts structured, review-quality comments — not a noisy wall of linter output.
“Our SAST tool floods us with 500 findings per PR and we've learned to ignore it.”
Cartomancer ranks by structural impact — so the top of the list is what actually matters.
“CodeRabbit is great but we can't ship our code to a third-party SaaS.”
Self-hosted, single binary, air-gap capable with Ollama. Your code never leaves your infra.
“Our reviewers keep missing that a change in a utility cascades into the payment flow.”
Blast radius fromcartogsurfaces the callers automatically, inline on the PR.
“We have team-specific conventions that no off-the-shelf linter knows about.”
Drop YAML rules in.cartomancer/rules/and markdown context inknowledge.md— the LLM uses both.
Cartomancer combines static analysis, code graph intelligence, and LLM reasoning into one pipeline.
Every finding is enriched with caller count, transitive impact depth, and domain tags (auth, payment, data). A bug in a utility used by 2 callers is not the same as one used by 47.
Findings auto-upgrade based on structural context. A Warning in an auth-reachable function becomes Critical. Per-rule min_severity / max_severity overrides for your team's needs.
High-severity findings are explained by Ollama (local) or Claude (production). Each gets a suggested fix as a unified diff and an AI agent prompt for automated remediation.
Inject your team's conventions, architecture docs, and security policies into every LLM prompt via .cartomancer/knowledge.md. The LLM knows your codebase, not just the pattern.
Drop YAML rule files in .cartomancer/rules/ and they're auto-discovered. Encode team-specific business rules alongside opengrep's 3000+ built-in patterns.
Every finding is fingerprinted. Cartomancer compares against the base branch baseline to distinguish genuinely new issues from pre-existing ones. False positives can be dismissed.
Inline comments on diff lines, caution banners for off-diff findings, summary with actionable counts. Runs as CLI or webhook server for full automation.
All scans and findings are stored in SQLite. Browse history, search by rule/severity/file, track trends across branches. Dismissals are fingerprint-based and survive line shifts.
Written in Rust. No Python, no Docker, no language servers required. cargo install and you're reviewing PRs. Air-gap capable when using Ollama.
Cartomancer is not a replacement for these tools. It adds the structural layer they don't have.
| Capability | CodeRabbit | SonarQube | Opengrep alone | Cartomancer |
|---|---|---|---|---|
| Static analysis rules | LLM-based | proprietary | 3000+ open | 3000+ open + custom |
| Blast radius | none | none | none | cartog graph |
| Severity escalation | none | static | static | structural + per-rule |
| LLM analysis | yes | no | no | conditional + knowledge |
| Custom team rules | learning | yes | yes | YAML auto-discover |
| Self-hosted / local | SaaS only | yes | yes | single binary |
| Regression detection | no | yes | baseline flag | fingerprint-based |
| Cost | paid | paid (enterprise) | free | free / MIT |
Findings are escalated based on where they sit in your codebase, not just what pattern they match.
| Condition | Effect |
|---|---|
| Blast radius ≥ 4× threshold | Critical |
| Blast radius ≥ threshold | Error (minimum) |
Domain: auth or payment |
Critical |
| Callers ≥ 10 | Error (minimum) |
Per-rule min_severity |
Floor before escalation |
Per-rule max_severity |
Ceiling after escalation |
Default blast_radius_threshold = 5. Configurable in .cartomancer.toml.
No — not unless you explicitly configure the Anthropic provider. The default LLM backend is Ollama running locally. Cartomancer itself is a binary on your box; only GitHub API calls leave the machine (PR metadata + posting comments). Fully air-gap capable.
Static analysis: anything opengrep supports (Python, JS/TS, Go, Java, Rust, Ruby, C, C#, PHP, Kotlin, Swift, etc.). Blast radius via cartog: Python, TypeScript/JavaScript, Rust, Go, Ruby, Java. If cartog doesn't know your language yet, you still get static analysis + LLM — just without the structural escalation layer.
Those are LLM-first: they read your diff and guess at issues. Cartomancer is analysis-first: opengrep's deterministic rules find real patterns, cartog's call graph measures impact, and the LLM is used surgically to explain and suggest fixes for the findings that already passed the structural bar. Fewer hallucinations, cheaper runs, and you can ship it on your own infra.
Yes. LLM deepening is conditional — you still get the full opengrep scan, cartog enrichment, severity escalation, and GitHub comments without it. Turn it off entirely by setting the deepening threshold above critical.
The number of transitive callers of the function containing the finding, computed from cartog's call graph. Combined with domain tags (auth, payment, data) it turns static severity into structural severity: a Warning in a 47-caller auth path becomes Critical; an Error in dead code stays quiet.
Pass --dry-run — the full pipeline runs and the review is printed to stdout instead of posted. Great for first-time evaluation and CI previews.
Yes. Invoke cartomancer review <owner/repo> <pr> from GitHub Actions, GitLab CI, or any job runner with access to GITHUB_TOKEN. The webhook server (cartomancer serve) is optional — use it when you want instant reviews without wiring CI.
It's a young project, shipping incrementally. The pipeline works end-to-end, has tests, and produces useful reviews today. Expect the CLI surface to stabilize before 1.0. File an issue or PR — feedback shapes the roadmap.
Know which bugs matter before you merge. Open source, single binary, zero config.
src/api/users.rs· just nowUnsanitized user input reaches a SQL query. Escalated from Warning to Critical — this function sits in the
authdomain and has 23 callers includinglogin()andverify_payment().Blast radius · 23 callers across 7 files
Suggested fix · unified diff
AI agent prompt · copy-paste to Claude / Cursor