Vyper Guard
Static security analyzer for Vyper smart contracts.
Vyper Guard scans .vy sources, runs a focused detector suite, and emits structured security reports for auditors, developers, and security teams. It is designed for fast local analysis with optional compiler-backed semantics and verification workflows.
Website: https://vyper-web.vercel.app
What's new in 0.7.0
Vyper Guard 0.7.0 expands real-world DeFi coverage with three new beta detectors and a critical compiler advisory:
- Oracle safety:
oracle_price_manipulationflags unguarded spot-price reads in state-changing functions (flash-loan price manipulation). - Sandwich protection:
missing_slippage_protectionflags swaps without minimum-output or deadline parameters. - Replay protection:
signature_replayflagsecrecoververification without nonce, deadline, chain-id, or consumed-signature binding. - Compiler advisories: new
vyper-2023-07-reentrancyCRITICAL advisory for Vyper 0.2.15–0.3.0 contracts that combine external calls with state writes (the Curve/stableswap incident defect class), feature-gated to keep precision high.
See the changelog for the complete release notes.
What's new in 0.6.0
Vyper Guard 0.6.0 is a precision and trust release for professional security workflows:
- Lower-noise analysis: improved call-target, mutability, timestamp, arithmetic, access-control, and legacy Vyper reasoning reduces avoidable findings on production contracts.
- Clearer trust signals: reports now identify semantic-engine provenance, detector maturity, degraded analysis, protocol assumptions, and reviewed audit attribution.
- Safer remediation: compiler-backed validation blocks writes when a generated patch does not validate, while governed baseline acceptances require ownership and rationale.
- Audit-focused output: concise terminal triage highlights actionable candidates while JSON, Markdown, SARIF, and HTML retain the full evidence set.
- Reproducible quality evidence: pinned production-contract corpora, detector quality gates, and an evidence-backed Curve DAO benchmark make current coverage and limitations explicit.
- CI-ready distribution: a reusable GitHub Action generates SARIF for code-scanning and regression workflows.
See the changelog for the complete release notes.
Who it is for
- Auditors and auditing companies
- Protocol and dApp developers
- Security and engineering teams
Primary use cases
- Pre-audit security scans
- CI security gates and regression checks
- Learning and reviewing Vyper security patterns
Features
- Vyper-focused static analysis for .vy contracts
- 25 built-in detectors with explicit supported, beta, and experimental maturity labels
- Always-on compiler advisories (
compiler_version_check) - Multiple report formats: CLI, JSON, Markdown, SARIF, HTML
- Verification workflows for unit and fuzz tests (
verify,test,fuzz) - Baseline suppression and baseline-diff for CI stability
- Optional remediation mode with tiered auto-fix controls
- Optional compiler-backed semantic mode (install
vyperextra) - Compiler semantics can also use a
vyperexecutable on PATH, with engine, version, and fallback provenance in reports - CFG-aware CEI analysis plus cyclomatic complexity metrics in reports and
stats - Project-wide graph for directory scans (imports, interfaces, call/state maps)
- Explorer and on-chain analysis workflows (
explorer,analyze-address) - Deterministic priority scoring with governance notes and explicit fallback controls (
--allow-ai-fallback)
Installation
Python 3.10+ is required.
pip install vyper-guard
Optional extras:
pip install vyper-guard[vyper] # compiler-backed semantics
pip install vyper-guard[monitor] # on-chain monitoring (web3 + aiohttp)
pip install vyper-guard[remediation] # GitHub remediation support
pip install vyper-guard[all] # all optional features
Verify:
vyper-guard --version
Quickstart
Analyze a contract:
vyper-guard analyze contract.vy
For the lower-noise supported and beta profile:
vyper-guard analyze contract.vy --detectors recommended
--detectors all preserves the complete legacy detector set, including
experimental rules. Detector maturity describes validation evidence, not issue
severity.
Verify static analysis plus tests:
vyper-guard verify contract.vy --unit-cmd "pytest -q"
Generate a machine-readable report:
vyper-guard analyze contract.vy --format json --output report.json
Generate a SARIF report for code scanning:
vyper-guard analyze contract.vy --format sarif --output report.sarif
Generate an HTML report:
vyper-guard analyze contract.vy --format html --output report.html
Command guide (when to use)
| Command | When to use |
|---|---|
| `analyze <file | dir>` |
| `verify <file | dir>` |
| `test <file | dir>` |
| `fuzz <file | dir>` |
analyze-address <addr> |
Analyze verified on-chain source from a block explorer. |
explorer <addr> |
Fetch explorer metadata (ABI, source, verification info). |
diff <before> <after> |
Compare security posture between revisions. |
| `stats <file | dir>` |
baseline / monitor |
Production monitoring flows for deployed contracts. |
Core commands
| Command | Purpose |
|---|---|
analyze <file> |
Analyze a single contract |
scan <file> |
Alias for analyze |
verify <file> |
Static analysis + unit/fuzz verification in one report |
test <file> |
Run unit tests and emit verification report |
fuzz <file> |
Run fuzz tests and emit verification report |
ast <file> |
Structural AST-oriented contract output |
flow <file> |
Function/call-flow visualization data |
fix <file> |
Remediation workflow |
stats <file> |
Contract metrics and graph artifacts |
diff <before> <after> |
Compare security posture between revisions |
explorer <address> |
Fetch verified source and ABI metadata |
analyze-address <address> |
Analyze explorer-fetched contract source |
detectors |
List detector catalog with severity/category |
benchmark [dir] |
Detector quality benchmark run |
baseline <address> |
Build monitor baseline profile |
monitor <address> |
Runtime monitoring and alerts |
help |
Full command catalog and usage hints |
Verification (unit + fuzz)
Use verify for a single report that includes static findings plus unit/fuzz results. Use test or fuzz to run them independently.
vyper-guard verify contract.vy --unit-cmd "pytest -q"
vyper-guard fuzz contract.vy --fuzz-cmd "your-fuzz-command"
You can also set defaults via environment variables:
export GUARDIAN_UNIT_CMD="pytest -q"
export GUARDIAN_FUZZ_CMD="your-fuzz-command"
Configuration
Configuration is loaded in this order:
- CLI flags
- Environment variables
.guardianrcin the current directory (or.guardianrc.yaml,.guardianrc.yml)~/.guardianrc
Create a starter config:
vyper-guard init
Example verification config:
verification:
unit_command: ["pytest", "-q"]
fuzz_command: ["your-fuzz-command"]
timeout_seconds: 600
max_output_chars: 20000
Explorer and LLM keys are read from environment variables:
export GUARDIAN_EXPLORER_API_KEY="..."
export GUARDIAN_LLM_API_KEY="..."
Output formats
Use --format and --output for structured reports:
vyper-guard analyze contract.vy --format json --output report.json
vyper-guard analyze contract.vy --format sarif --output report.sarif
vyper-guard analyze contract.vy --format html --output report.html
Supported formats: cli, json, markdown, sarif, html.
Security scoring
Each run produces a backward-compatible heuristic risk indicator from 0 to 100
and a grade. It measures detected heuristic risk, not contract safety or
deployment readiness. Structured reports also include analysis_trust with
compiler coverage, detector maturity, degradation reasons, and limitations.
Base score is 100 with severity-based deductions:
- CRITICAL: -40 points (capped at -50)
- HIGH: -20 points (capped at -40)
- MEDIUM: -8 points (capped at -20)
- LOW: -3 points (capped at -10)
- INFO: -1 point (capped at -5)
Additional trust penalty:
- Detector runtime failures: -10 each (capped at -30)
Detector catalog
missing_nonreentrantunsafe_raw_callunchecked_sendmissing_event_emissiontimestamp_dependenceinteger_overflowunprotected_selfdestructdangerous_delegatecallunprotected_state_changesend_in_loopunchecked_subtractioncei_violationtx_origin_authmissing_zero_address_checkweak_randomnesslocked_ethershadowed_state_variablemissing_input_validationunsafe_assemblymissing_return_valuedivision_before_multiplicationincorrect_erc20_returnoracle_price_manipulationmissing_slippage_protectionsignature_replay
Compiler advisories are always evaluated and reported as compiler_version_check findings.
Remediation
Use remediation mode for guided fixes:
vyper-guard analyze contract.vy --fix
Limit remediation scope by risk tier:
vyper-guard analyze contract.vy --fix --max-auto-fix-tier B
Dry-run remediation:
vyper-guard analyze contract.vy --fix-dry-run --fix-report remediation-report.json
License
MIT. See LICENSE.
Disclaimer
Vyper Guard is a static analysis aid and does not guarantee absence of vulnerabilities. Use it together with manual review, testnet validation, and professional audits for high-value deployments.
Metadata
Release files for vyper-guard 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vyper_guard-0.7.0.tar.gz | 180.1 kB | Without provenance | Details for vyper_guard-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vyper_guard-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for vyper_guard-0.7.0-py3-none-any.whl |
Total release size: 391.2 kB
Release files / vyper_guard-0.7.0.tar.gz
| Download URL | vyper_guard-0.7.0.tar.gz |
|---|---|
| Size | 180.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c636766cf35bcbf290c505ab68be56541528aff450fd7f483aba0c9c4e5a3f01
|
|
BLAKE2b-256 checksum How to use checksums |
f3094b83117799dc44437c57a7f41239e8240c6d2510eb5924e51f5a5955d8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / vyper_guard-0.7.0-py3-none-any.whl
| Download URL | vyper_guard-0.7.0-py3-none-any.whl |
|---|---|
| Size | 211.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8991e9088897a882d5d5b9237cea0b8dafecbf64d13ad161c5dee843be6fe65d
|
|
BLAKE2b-256 checksum How to use checksums |
5cc0ceaabf48bd316587e4ad2d8571dbfd473ee8b2fea748e2462aacccdb18ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for vyper-guard 0.7.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.