Repository navigation
Releases
Releases · Pantronux-Research/sak-guard
SAK-Guard v0.2.0-alpha.2 — Fewer false positives for pathlib joins
Fixed
- SAK-Guard no longer reports recognized
pathlibjoins as possible division by zero. The advisory still applies to numeric division and cases where the operand type is unclear. - Added regression tests for path joins, numeric division, and ambiguous operands.
Verification
- GitHub CI passed on Python 3.10–3.14.
- The wheel and source distribution passed
twine check, and the installed wheel passed a smoke test.
This is an alpha release. See the detection envelope for what SAK-Guard checks and where its coverage ends.
sak-guard 0.2.0a1
Second alpha. Replaces the analysis engine with an abstract interpreter and adds two rule families. Not a stability release: read the detection envelope before treating a passing result as a release decision.
Highlights
PS-SOL-4: reviews the message or transaction that reaches a signing shape, and records whether an enforced comparison gates it.PS-SOL-5: records caller-derived amounts reaching a transfer without an independent upper bound, and swap-shaped calls without a known positive minimum-output or slippage value.- Abstract-interpreter engine (
dataflow.py): merges both branches of a conditional, seedstryhandlers from the entry state, iterates loops to a bounded fixpoint, and ends a path atraise/returnso a rejecting branch contributes no fact - Per-file process isolation (
worker.py): only the analyzer runs; submitted code is never executed.
Behaviour changes
PS-SOL-2is now four named rules:2acommitment,2bsimulation gating,2cblockhash freshness (Medium),2dmissingawait.- Exit code
2is now distinct: usage, IO, parse and incomplete-analysis errors, separate from1(findings at or above threshold). reports[].passedis independent of the CLI threshold, and an incomplete report is alwayspassed: false.- Each file is analysed in its own process roughly 0.1 s of startup per small file. The README documents how to scope the pre-commit hook.
Correctness
- An internal analysis error can no longer produce a clean verdict; it surfaces as a critical finding with exit code
2. - Quadratic analysis paths are linear now: an 8,000-term expression chain that previously exceeded ten seconds completes in about one second.
finallyon normal completion, andbreakversus loopelse, now follow Python semantics.- Facts are keyed by access path, so a check on one field cannot authorize a different field.
Known limitations
This is an alpha heuristic guardrail. A passing result means the configured checks completed without reportable evidence at the selected threshold, it does not certify a transaction or a deployment.
- Analysis covers the call shapes, sources and sinks documented in the detection envelope. Code reaching a sink through a shape outside that contract is not reported.
- No cross-file or full interprocedural analysis; behaviour spanning modules is not followed.
- Dynamic constructs reflection,
getattr, dynamic imports, monkey-patching, custom descriptors, callbacks can hide sources, sinks and mutation. - Libraries exposing an operation under a different name, or through an unannotated or unresolved receiver, may fall outside the current envelope.
- Conservative false positives are expected and deliberate.
- Signing and amount rules are proxies, not complete authorization or economic policy. Runtime controls remain necessary.
Full details: CHANGELOG.md
Tests: 499 passing across Python 3.10–3.14 (1 skipped on 3.10/3.11, where the parser cannot build the deep-chain fixture).