00 / CONCURRENCY INSPECTOR

Your code has a race condition.
Watch it happen.

Find read-modify-write races, reproduce them under pressure, and patch them without touching your formatting.

Join GitHub App waitlist
sourcethreadslock
LOCAL-ONLY ANALYSISMIT LICENSEPYTHON 3.9+
ILLUSTRATIVE SIMULATION / CG-016× RACE PATH
wallet.balance100starting balance
Request Athr-17
get() → 100
Request Bthr-18
get() → 100
01 / 05

Both requests read the same balance.

01 / DETECT

The bug, line by line.

cguard follows the read, the check, and the write — even when they are separated by application code.

CG-016 / VULNERABLE
race window
01def deduct(user_id, amount):02    wallet = Wallet.objects.get(id=user_id)03    if wallet.balance < amount:04        raise InsufficientFunds()05    wallet.balance -= amount06    wallet.save()
02 / TRACE

One path from finding to fix.

Every stage leaves evidence you can inspect locally.

02.1

Trace the call path

A route can delegate a mutation three files away. The call graph keeps the connection intact.

routes.py→service.py→cache.py / mutate()
02.2

Follow shared state

Taint tracking follows a mutable reference through aliases, arguments, and attribute access.

global_cache↘ alias ↘ argumentitems.append()
02.3

Force the interleaving

The runtime verifier releases workers at a barrier, then compares the observed state with the invariant.

worker 01worker 02worker 03BARRIER14 / 50 increments observed
02.4

Patch without reformatting

LibCST makes a narrow source edit and preserves the comments and layout already in your file.

# keep this audit noteWallet.objects.get(...)Wallet.objects.select_for_update().get(...)
03 / COVERAGE

Specific checks, named plainly.

Every displayed number has a source. Modeled timeline outcomes are labeled as simulations.

16
documented rules
recorded · 2026-11-03
0
network calls required
recorded · 2026-11-03
8
analysis surfaces
ORM, async, threads, files, cache, locks, tasks, Python
04 / CATALOG

The rules are visible.

Sixteen documented checks across ORM, runtime, file, cache, and lock behavior.

RuleFrameworkPatternAuto-fix
CG-001SQLAlchemy / FastAPIUnlocked read-modify-writeYes
CG-002FastAPIMissing idempotency headerYes
CG-003asyncio / SQLAlchemyQuery inside async loopNo
CG-004SQLAlchemyCheck-then-act uniquenessYes
CG-005CeleryNon-idempotent retryNo
CG-006asyncioShared-state mutationYes
CG-007threadingThreaded collection mutationYes
CG-008PythonGeneric read-modify-writeNo
CG-009FilesystemConcurrent file writeYes
CG-010FilesystemShared tempfileNo
CG-011Redis / cacheCache check-then-actNo
CG-012CacheNon-atomic invalidationNo
CG-013LocksLock-order inversionNo
CG-014PythonCross-file call-chain raceNo
CG-015PythonTainted shared-state mutationNo
CG-016DjangoUnlocked ORM mutationYes
05 / RUN LOCALLY

No account. No upload. No detour.

Install the CLI, scan a path, and review the source-preserving patch on your own machine.

  1. 01
  2. 02
  3. 03

PRIVACY / Nothing leaves your machine. cguard parses source with Python AST and LibCST locally.

06 / GITHUB APP

Put the finding on the pull request.

Early access for a GitHub App that turns a detected race into a reviewable patch.