Graph-powered safety layer for AI coding agents built on FalkorDB
pip install guard-cli==0.1.1 Copy PIP instructions
A high-velocity, graph-native regression prevention engine built on FalkorDB. Guard selects the exact minimal subset of tests to run after an AI coding agent modifies code, measures a multi-factor Trust Score, and deterministically triggers hard fallbacks to full test suites when graph confidence drops.
uv tool install guard-cli # Or with embedded FalkorDB support on Python 3.12+: # uv tool install "guard-cli[embedded]" 2. Initialize in your Repository cd /path/to/your/repo guard init guard init auto-detects your Python environment, sets up FalkorDB (server, docker, or embedded), ingests static call graphs & dynamic test coverage, and configures agent integrations (Claude Code Stop hook, AGENTS.md, .gitignore).
guard doctor Verifies backend connectivity, graph integrity, git freshness, and integration settings.
Evaluated against pallets/flask (494 tests) across 24 held-out mutants under a frozen protocol (evals/split.json, PLAN.md).
All metrics are evaluated and reported as Paired Metrics (Escape Rate $\leftrightarrow$ Fallback Rate $\leftrightarrow$ Savings Ratio):
Key Result: Guard achieved a 0.0% Escape Rate while delivering 67.3% Test-Time Savings compared to run-all, completely eliminating the 17.6% escape rate of naive heuristics.
When AI coding agents (Claude Code, Cursor, Codex, OpenCode) modify complex codebases, running the entire test suite on every step slows iteration cycles to a crawl. Conversely, naive heuristics introduce catastrophic silent escapes:
Guard's Core Thesis: Code relationships and test executions form a graph topology. By indexing static AST relationships and per-test dynamic coverage contexts inside FalkorDB, Guard computes exact dependency subgraphs, measures empirical test confidence, dynamically widens around ambiguous dynamic dispatch, and enforces hard overrides when evidence is absent.
Guard operates as a deterministic, graph-native verification pipeline connecting static code structure, dynamic coverage telemetry, and autonomous agent loops:
+-----------------------+ | AI Agent Git Diff | +-----------+-----------+ | v +-----------------------+ | AST Diff Analyzer | -> Identifies modified functions & test files +-----------+-----------+ | v +-----------------------+ | FalkorDB Graph Engine| -> Queries COVERED_BY edges, call paths, +-----------+-----------+ and dynamic dispatch topology | v +-----------------------+ | Decision Engine | -> Evaluates hard overrides & Trust Score +-----------+-----------+ | +---------+---------+ | | Trust >= 0.8 Trust (:File): Static structural hierarchy. (:Test)-[:DEFINED_IN]->(:File): Static test placement. (:Function)-[:CALLS {source: 'static', confidence: 0.6, last_verified_sha}]->(:Function): Multi-hop static call graph. (:File)-[:IMPORTS {source: 'static', confidence: 0.6}]->(:File): Module import topology. (:Function)-[:COVERED_BY {source: 'coverage'|'miss_repair', confidence, evidence_count, last_verified_sha}]->(:Test): Verified dynamic execution evidence connecting modified functions directly to covering tests. (:Test)-[:FAILED_IN {source: 'test_run', error_message}]->(:Run): Historical test failure records. Decision Engine & Trust Model Guard evaluates code changes using a strict two-stage process: Hard Safety Overrides followed by the Empirical Trust Score Policy.
Before computing continuous scores, Guard enforces three non-bypassable guardrails:
When no hard overrides force run-all, Guard computes the composite trust metric:
$$\text{Trust} = 0.5 \cdot \text{EvidenceRatio} + 0.3 \cdot \text{Freshness} + 0.2 \cdot (1 - \text{UncertainRatio})$$
Guard integrates seamlessly into autonomous coding workflows:
Initializes Guard in a repository, detects backends, and configures integrations:
guard init [--backend server|docker|embedded] [--skip-coverage] Backends & Platform Support Guard supports three FalkorDB backend topologies:
no embedded build for this platform, use Docker or a server and guides you to use --backend docker or --backend server instead of failing with a build error. guard doctor Verifies system health, backend reachability, graph counts, and settings:
guard doctor [--fix] guard run Executes agent pre-completion test verification on the current working tree diff:
guard run [--repo /path/to/repo] guard check Computes the test selection decision without executing tests (outputs JSON schema v1.0 or text):
guard check [--repo /path/to/repo] [--json] guard hook Manages Claude Code and agent hook configurations:
guard hook install [--shared] guard hook status guard hook uninstall guard feedback Repairs the graph after an unexpected failure:
guard feedback --function "src/flask/helpers.py::url_for" --test "tests/test_helpers.py::test_url_for" Documentation & Visualizations Additional architectural diagrams, interactive visualizations, and test reports are available in the docs/ directory:
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.




