Show HN: ShellMind-Guard – Multi-file security and concurrency verifier in Rust ShellMind Guard, a Rust-based open-source verifier released on Hacker News' Show HN, traces cross-file taint and guard invariants with an O(V + E) Guard-Set Lattice across 18 source languages and ecosystems, using 17 Tree-sitter AST grammars plus Move's structural parser and .sql schema analysis. The tool ships 177 cataloged verification rules, fingerprints 13,000+ files at over 1 GB/s with BLAKE3 and SQLite WAL while re-linking the global call graph in under 80 ms, and proves exploitability inside isolated cross-OS sandboxes (Linux bwrap, macOS sandbox-exec, Windows WSL2/Job Object) with zero AI API cost. Its author positions ShellMind Guard against regex/single-file SAST scanners and LLM-only code scanners, which it says burn tens of thousands of tokens per scan and cannot execute deterministic data-flow proofs. Deterministic Multi-File Security, Business-Logic, Concurrency & Frontier Domain Verifier Traces cross-file taint and guard invariants via an $O V + E $ Guard-Set Lattice across 18 source languages & ecosystems + SQL migrations 17 Tree-sitter AST grammars : TypeScript, JavaScript, Go, Python, Rust, PHP, Java, C , Kotlin, Swift, Dart, C, C++, Ruby, Bash/Shell, Terraform/HCL, and Solidity—plus Move's structural parser and .sql schema analysis —alongside isolated Hardware/Firmware smg-hw , Web3 + revm Concrete Oracle smg-web3 , Post-Quantum Crypto-Agility smg-pqc , and Confidential TEE smg-enterprise verification—then proves exploitability inside an isolated Cross-OS sandbox Linux bwrap , macOS sandbox-exec , Windows WSL2/Job Object with zero AI API cost. Architecture system-architecture · Verification Engine 177 Rules the-6-layer-universal-verification-engine · Frontier Domains frontier-verification-domains-hw--web3--pqc--enterprise · Benchmarks & Ground Truth verified-performance-benchmarks--ground-truth-evidence · Quickstart quickstart · CLI Reference 23 Commands cli-command-reference · AI Agent MCP model-context-protocol-shellmind-guard-mcp · Blueprint Modern software—especially high-velocity, AI-assisted full-stack codebases—suffers from vulnerabilities that span multiple files and execution layers: a route in routes/checkout.ts delegates to services/ledger.ts , which mutates a balance in db/queries.ts without an authentication middleware, ownership filter, or SELECT ... FOR UPDATE transaction lock. Conventional security tools fail on these bugs in two predictable ways: 1. Regex / Single-File SAST Scanners lack cross-file call-graph and middleware-order semantics, burying engineering teams under hundreds of false positives while missing multi-hop business-logic and race-condition flaws. 2. LLM-Only Code Scanners burn tens of thousands of tokens per scan, hallucinate findings on sanitized paths, cannot execute deterministic data-flow proofs, and cannot verify whether a concurrency bug is actually exploitable at runtime. ShellMind Guard solves both problems with a deterministic, systems-engineered architecture: - Two-Phase Incremental Ingestion BLAKE3 + SQLite WAL : Fingerprints 13,000+ files at 1 GB/s, caching per-file Tree-sitter AST summaries in SQLite while always re-linking the global cross-file call graph in RAM <80 ms so edits to a shared middleware auth.ts immediately invalidate downstream routes routes.ts . - $O V + E $ Guard-Set Lattice Solver:$O V $ path enumeration—terminating in linear time even on cyclic enterprise call graphs. - Universal 6-Layer + Cloud-Native Static & Taint Engine 177 Cataloged Rules : Covers hardcoded secrets, CORS/JWT/TLS/Dockerfile/Terraform/Kubernetes/CI-CD misconfigurations, offline lockfile advisories, cross-file SQL/Command/Path/SSRF/XSS/ZipSlip taint with sanitizer disproof, missing auth/PKCE/state-machine/transaction locks, IDOR missing ownership filters, and frontend-to-backend API/OpenAPI/GraphQL contract drift. - Cross-OS Isolated Exploit Prover smg-sandbox : Boots your service inside an isolated OS sandbox Linux bwrap --unshare-all , macOS sandbox-exec Seatbelt , or Windows WSL2 bwrap + Win32 Job Object with optional --sandbox-mem-mb RLIMIT AS / --cgroup-v2 , --sandbox-tls loopback rustls , --mock-shims , fast UNBOOTABLE diagnostics, and process-group reaper and fires barrier-synchronized 12-way Last-Byte Sync concurrent HTTP/HTTPS bursts tokio::sync::Barrier + tokio::task::JoinSet corroborated by JSON ledger state-anomaly proofs, WireDiffProxy TCP mutation counters, and DbStateSnapshot conservation diffs. - Isolated Frontier Verification Domains hw · web3 · pqc · enterprise : Zero-overhead on standard Web/AppSec repos—auto-activates smg-hw Tnum / SparseOctagon /CMSIS-SVD/IRQ/Linker W^X on firmware/kernel code and smg-web3 tree-sitter-solidity , Foundry/Hardhat, in-process revm v43.0.3 concrete EVM oracle, Solana Anchor, Sui/Aptos Move on Web3 repos, plus opt-in smg-pqc Shor/Grover/BHT, Mosca HNDL, CycloneDX 1.5 Static CBOM and smg-enterprise remote Nitro/TDX/SEV-SNP TEE attestation & enclave admission control . - Native Model Context Protocol shellmind-guard mcp Server: Exposes deterministic, zero-token-overhead security verification over stdio JSON-RPC 2.0 for Claude Code, Cursor, AntiGravity, Windsurf, OpenCode, and Z-Code . flowchart TD subgraph Surfaces "Access Surfaces smg / shellmind-guard — 23 Subcommands " C1 "CLI & CI Merge Gate\nsmg scan · replay · rules · explain · hook" C2 "60fps Interactive TUI\nsmg ui · Proxy TUI ratatui " C3 "Read-Only MCP Server\nsmg mcp JSON-RPC 2.0 Stdio " end subgraph Core "ShellMind Guard Core Engine 12 Rust Crates · 1T == 16T Deterministic " A1 "Incremental Ingestion smg-core \nWalkParallel · BLAKE3 · POSIX/NFC" A2 "Polyglot AST & Linker smg-graph \n17 Tree-sitter Grammars · Move · SQL · HCL" A3 "Formal & Lattice Core smg-graph::formal \nO V+E Guard Lattice · 2-CFA/SSA · CDCL · SMT" A4 "Frontier Domains Zero-Overhead Routing \nsmg-hw · smg-web3 revm · smg-pqc · smg-enterprise" DB "SQLite WAL + SMG2 Cache\nPostcard AST Blobs · Offline OSV DB" end subgraph Provers "Runtime Provers, Live Lab & Actionable Outputs" P1 "Cross-OS Exploit Prover smg-sandbox \nLinux bwrap · macOS Seatbelt · Win WSL2/Job" P2 "Live Lab & Dynamic Suite smg-dynamic \nSafeHttpClient · DAST · SQLi · Nuclei · MITM · TLS · OCI" P3 "Reports & Auto-Patcher smg-report · smg-ai \nSARIF 2.1.0 · CycloneDX/OpenVEX · HTML · CEGIS" end C1 & C2 & C3 -- A1 A1 -- DB A1 -- A2 -- A3 A2 -- A4 A3 & A4 -- |"Static Findings"| P3 A3 -- |"--boot-cmd / replay"| P1 C1 -- |"Live Lab / OCI"| P2 P1 & P2 -- |"PROVEN / MITIGATED"| P3 Inside the core engine, every parsed file is lowered once into a bounded CFG & symbol summary and dispatched across three parallel formal verification engines before priority-ranked deduplication: flowchart LR SRC "Source & Specs\n17 ASTs · Move · SQL\nSVD · .ld · Foundry" -- PARSE "Single-Pass CST & Arena\nDepth-Capped Walk\nCross-File Import Linker" PARSE -- E TAINT "1. Guard Lattice & Taint\nMonotone Worklist O V+E \nDominator Guards · 2-CFA/SSA" PARSE -- E MEM "2. Typestate & Abstract Math\nAlloc/Free/UAF · Pointer Alias\nTnum · Octagon · CDCL/SMT" PARSE -- E CONC "3. Concurrency & Lock Graph\nGo Struct Mutex · Rust .await\nISR vs Task ABBA Deadlocks" E TAINT & E MEM & E CONC -- DEDUP "Canonical Family Deduplicator\nProven Confirmed Heuristic" DEDUP -- STATIC OUT "Verified Static Findings\nShortest Unguarded Witness" When --boot-cmd or smg replay is invoked on a concurrency finding SMG-RACE-001 , smg-sandbox never relies on raw HTTP 200 counts alone—it aligns final request bytes on an in-process barrier and cross-checks three state oracles: sequenceDiagram participant CLI as smg-sandbox Prover participant BAR as tokio::sync::Barrier 12x participant APP as Sandboxed App bwrap / Seatbelt / WSL2 participant ORA as WireDiffProxy & State Oracles CLI- APP: Boot service inside isolated net/fs namespace + optional WireDiffProxy par 12 Concurrent Workers CLI- APP: Connect & write HTTP/1.1 request prefix N - 1 bytes, holding final byte CLI- BAR: bar.wait until all 12 TCP sockets are primed end BAR-- CLI: Simultaneous release CLI- APP: Flush final 1 byte '}' across all 12 sockets in microsecond window APP- ORA: Concurrent DB/Redis writes UPDATE / INSERT / DECR APP-- CLI: 12 HTTP responses status codes + JSON ledger bodies CLI- ORA: Evaluate 3 Oracles Ledger Post-State + WireDiffProxy + DbStateSnapshot Note over CLI,ORA: Overdraft <0 or Lost Update 12x amount=80 - same balance=10 = Sandbox: PROVEN Note over CLI,ORA: Distinct arithmetic steps 920..40, min = 0 = SerializedSolvent SuspectUnverified Note over CLI,ORA: 1x 200 OK + 11x 409/429 Lock Rejections = Sandbox: MITIGATED Instead of enumerating all simple paths between routes and sinks which degrades to 1. Initialization: Entry route nodes are initialized with their route-registration and router-level middleware guards; interior nodes start at top $\top = \mathcal{U}$ . 2. Fixed-Point Convergence: A worklist algorithm propagates guard sets in$O V + E $ time. Because$\mathcal{U}$ is finite and intersection is monotone, convergence is guaranteed on arbitrary cyclic graphs. 3. Shortest Witness Extraction: When a reachable sink$s$ requires guard$g \notin \mathcal{G} {\text{out}} s $ , a guard-avoiding multi-source BFS reconstructs the shortest unguarded witness chain$ r \to f 1 \to \dots \to s $ in$O V + E $ time. ShellMind Guard keeps static confidence tiers Confidence enum strictly distinct from runtime sandbox verification status VerificationStatus enum so static mathematical proofs are never conflated with live HTTP exploit execution: | Field / Badge | Value | Engine Origin | Exact Meaning & Required Evidence | |---|---|---|---| | Runtime Status --boot-cmd / smg replay | Sandbox: PROVEN VerificationStatus::Proven | smg-sandbox | Target service was booted inside an isolated OS sandbox and a live HTTP/HTTPS exploit probe succeeded e.g. unauthenticated 200 mutation, cross-tenant User B IDOR read, or concurrent race violating ledger/wire/DB invariants . | | Runtime Status | Sandbox: MITIGATED VerificationStatus::Mitigated | smg-sandbox | Live sandbox probe was deterministically blocked by runtime controls 401 / 403 auth gate, 409 / 429 lock/idempotency rejection . | | Static Confidence smg scan , no server booted | Confidence::Proven Static-Proven / Bytecode-Proven | smg-hw , smg-web3 , smg-graph | Defect is proven mathematically or via in-process bytecode execution without booting an HTTP server: e.g. Tnum / SparseOctagon /SVD register OOB & cyclic stack proofs 349 Static-Proven on zephyr , revm concrete EVM exploit execution, Trojan-Source CVE-2021-42574 Bidi overrides, or malicious binary Pickle REDUCE opcodes. | | Static Confidence | Confidence::Confirmed | smg-graph , smg-web3 | Complete cross-file AST + Guard-Set Lattice witness path from an entry point to a sink with no dominating guard or matching sanitizer bit. | | Static Confidence | Confidence::Heuristic | All static crates | Intra-procedural or pattern-level risk lacking full caller/environment certainty filterable via --min-confidence confirmed . | Every rule ID below maps 1-to-1 to RULE CATALOG https://github.com/qira-dev/ShellMind-Guard/blob/main/crates/smg-graph/src/rules.rs 177 built-in rules, CI-enforced against drift via tests/readme catalog sync.rs https://github.com/qira-dev/ShellMind-Guard/blob/main/tests/readme catalog sync.rs ; inspect any rule offline with smg explain