SuperAPI AI Directory

SmartBench

SmartBench is an evidence-constrained code diagnostics workbench that adopts an architecture in which deterministic static analysis owns source-code facts, the LLM only proposes hypotheses, and parsers/validators decide whether a hypothesis can be bound back to real operations, thereby suppressing hallucinations at the architectural level. It supports Python 3.10+ and Git, provides deterministic analysis, evidence-gated LLM review, cross-branch inspection, and other features, has already found bugs in real open-source projects, and comes with a 25-case regression benchmark. It is currently a public beta and is not a production-grade SAST replacement.

Open website

About this tool

SmartBench is an evidence-constrained code diagnostics workbench designed to suppress the hallucination problem of large language models in code analysis through architectural design. Its core principle is: deterministic analyzers own source-code facts, the LLM can only propose hypotheses, and parsers and validators decide whether a hypothesis can be bound back to real operations, types, and control flow. Anything that cannot be bound remains unknown or abstained and is never promoted to a finding. The trust boundary is the product: the model may be wrong, but it cannot turn a false claim into a finding.

Key capabilities

Bug categories SmartBench can currently detect include: null pointer dereference, resource leaks; command injection, path traversal, hardcoded secrets, SQL injection, security data flow, insecure randomness; broad exception catching, unused imports, TODO/FIXME; retries without backoff; project-level resource lifecycle analysis; YAML-declared state rules. Not yet covered: data races at detector granularity, arbitrary business logic or specification violations, full interprocedural taint analysis under dynamic dispatch, cross-repository/cross-service consequences, memory safety in Rust/C++ (these frontends are structural/heuristic). Precision and recall for unknown bugs have not yet been measured.

Usage

Requires Python 3.10+ and Git. Deterministic analysis (no LLM) can be run from the command line and supports the --fail-on parameter (none by default, info, warning, error); exit code 0 means clean, 1 means findings reached the threshold, 2 means an argument error or internal error. The Python library API returns a versioned smartbench.report/v1 envelope, with the JSON Schema located at smartbench/report-schema/v1.json. Evidence-gated LLM review runs the fusion pipeline via the quick command: AnalysisSession → deterministic rules → ProjectReader hypotheses → evidence parser → Proposer → source validator → Critique → Judge, enforcing the evidence gate throughout. Before submitting findings, you should check the active branch to avoid submitting already-fixed issues. Optional extras can be installed: python -m pip install -e ".[graph,rag]" adds a local vector index.

Applicable scenarios

SmartBench is suitable for controlled repositoryExperiments, architecture research, and portfolio demonstrations. It has produced runtime-verified bugs in real projects, accompanied by a 25-case benchmark corpus and language-neutral analyzers (resource lifecycle, state machines, data flow). The current target users are people evaluating the architecture or conducting controlled, human-reviewed repository audits, not direct use as a CI quality gate.

Limitations and Caveats

SmartBench is a public beta, not a production-grade SAST replacement. It can run controlled repository audits and reproduce known defect corpora, but it has not yet established precision or recall for general unknown bugs. A clean report means "no supported findings," not "no bugs." The normal workflow is read-only: SmartBench never edits the analyzed repository, opens issues or PRs, or contacts maintainers. Most built-in rules are still source heuristics; exception flow, asynchronous scheduling, dynamic dispatch, alias analysis, goroutine happens-before, and interprocedural channel aliasing are incomplete. The ProjectReader lifecycle analyzer only proves canonicalized defer-style cleanup. The Python frontend lowers directly invoked with and async with resources into explicit acquire, bind, and context-exit registration operations; indirect context manager expressions remain unknown. Latency and memory usage for large repositories have no published budget. Local vector/TF-IDF caches are not portable across all optional dependency changes. Repository content sent via quick is visible to the configured remote model provider. Repositories containing secrets or restricted code should not be sent to remote providers. Each completed run writes a redacted audit trajectory under ~/.smartbench/trajectories by default, which can be disabled with --no-trajectory or SMARTBENCH_TRAJECTORY=0. Do not submit findings upstream without repeated verification and human decisions.

Evaluation Data

Regression corpus 50/50 pass (25 before/after comparison cases, 50 minimal snapshots). 6/6 controlled real-world concurrency/resource lifecycle cases verified. 6 upstream reports: qscan, stunner, sniproxy, Robyn, go-imap, webdav. Go type evidence: 40,650 items; internal grounding rate increased from 22% to 81%. Deterministic path latency: p50 114 ms, p95 436 ms, max 763 ms (64 snapshots). In real-world scans, 12 open-source repositories produced 410 findings; after human verification, deterministic rules had zero real bugs, 3 of 4 initial submissions were wrong, and 1 was a valid observation (Robyn test hygiene). The main failure mode is the verifier's inability to resolve types across dependency boundaries, which drove the development of type checker adapters.

Roadmap

The next useful work is measurement rather than more surface features: report precision, recall, abstention rate, trial stability, latency, and provider cost on an expanded corpus; deepen language semantics (exception flow, async, aliasing, concurrency) without weakening the IR boundary; reduce the cost of language onboarding and expose a public API.