This guide explains how to clone, compile, and run TorusGuard directly from source code using the Go toolchain.
Recommended for contributors, security researchers, and developers extending TorusGuard with custom rules or MCP tools.
Before building TorusGuard from source, verify you have the following installed:
- Go Compiler (1.25 or later):
go version # Expected: go version go1.25... or higher - Git:
git version
- Python 3.10+ (Optional): Required only if executing the Python harness validation suites (
harness/runner.py).
Clone the official TorusGuard repository:
git clone https://github.com/githubmofo/TorusGuard.git
cd TorusGuardTorusGuard's primary enforcement kernel is written in pure Go with zero external CGO runtime dependencies.
go build -o torusguard ./cmd/torusguardgo build -o torusguard.exe ./cmd/torusguardConfirm that the binary compiled successfully and outputs version v2.2.0:
./torusguard --version
# Output: torusguard v2.2.0 (pure go binary).\torusguard.exe --version
# Output: torusguard v2.2.0 (pure go binary)You can run any TorusGuard lifecycle command directly using your newly built binary:
# Launch the Interactive Command Center (menu-driven, zero arguments!)
./torusguard
# Run Hybrid First-Principles OCR Vision Scan on images & diagrams
./torusguard ocr-scan
# Scan a specific diagram or asset
./torusguard ocr-scan path/to/diagram.png
# Initialize a workspace in the current directory
./torusguard init
# Run an AST security audit against the workspace
./torusguard audit
# Inspect workspace diagnostic posture
./torusguard status
# Run SecurityReviewBench self-evaluating benchmark
./torusguard benchmark
# Synthesize STRIDE threat model & Mermaid DFDs
./torusguard threatmodel
# Run differential PR review on staged git changes
./torusguard review
# Launch native Model Context Protocol server (stdio JSON-RPC 2.0)
./torusguard mcpUse the --target or -t flag:
./torusguard audit --target /path/to/other/projectTorusGuard includes unit tests, integration suites, and performance benchmarks:
go test -v ./...go run ./cmd/torusguard benchmarkpython harness/runner.pyIf you want your locally compiled binary accessible everywhere across your terminal:
go install ./cmd/torusguardThis compiles and moves the torusguard binary into your $GOPATH/bin (or %USERPROFILE%\go\bin on Windows). Ensure this directory is present in your system PATH.