Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

EVM Audit Skills

A deterministic, evidence-gated EVM smart-contract audit Skill suite for Codex and ZCode.

It combines evidence-backed Project Analysis and Context Analysis, candidate-only Deep Audit, proof-gated findings, and confirmed-only reporting.

  • evm-audit-master is the default entry point.
  • Evidence-backed Project Analysis routing keeps uncertainty visible.
  • Only proven CONFIRMED findings reach the Final Report.

Quick Start

1. Install and make the Skills discoverable

Clone the suite and run the installer with your agent's name (zcode or codex):

git clone https://github.com/iavl/evm-audit-skills
cd evm-audit-skills
./install.sh zcode

For an existing checkout, run ./install.sh from that directory instead. The script symlinks each Skill package into the agent's skills directory and copies the ZCode worker agent files into ~/.zcode/agents/ as regular files (ZCode does not register symlinked agent definitions). It is safe to re-run and verifies the result; it refuses to replace entries it did not create. See QUICKSTART.md for the focused start guide.

2. Open the target repository

Open the local smart-contract project, or provide its repository URL.

3. Ask the agent to run the Master Skill

Audit this smart-contract repository using evm-audit-master:
https://github.com/owner/repo

GitHub issue creation is opt-in. Ask the agent to file confirmed Medium+ findings only when you explicitly want issue creation.

Model policy

Every stage and every worker agent runs on the host's default model. The suite performs no stage-, agent-, or provider-level model or effort selection: worker agent templates pin no model/thoughtLevel frontmatter, and there is no per-run model profile artifact. To audit with a different model, change the host/session model itself; the pipeline behavior is otherwise identical.

Parallel Orchestration

On ZCode, the Master Skill fans the middle of the pipeline out to one worker agent per Domain per stage — four stage-aligned waves (Domain Context on the flash worker, Initial Review and Deep Audit on the deep worker, Proof on the proof worker) with controller-owned merge barriers and confirmed-only fan-in. The worker agent definitions are installed by ./install.sh zcode (a new ZCode session is required for them to register); the audit itself never modifies your agent configuration. On Codex the same workflow runs sequentially in one session — the runtime provides no sub-agent dispatch, and no parallelism is simulated. Either way the evidence gates are identical. See Sequential and orchestrated execution.

How It Works

Instead of asking one model to read the entire codebase and guess vulnerabilities, the audit progressively narrows a large security checklist into a small set of evidence-backed findings.

Project Analysis
→ Context Analysis
→ Initial Review
→ Deep Audit
→ Vulnerability Validation
→ Final Report
                      all security checks
                              │
                              ▼
                    Project Analysis
                              │
                              ▼
                     Context Analysis
                              │
                              ▼
                       relevant checks
                              │
                              ▼
                      Initial Review
                         /        \
              proven irrelevant   candidate
                                     │
                                     ▼
                              Deep Audit
                                 /       \
                              safe     suspicious
                                          │
                                          ▼
                          Vulnerability Validation
                                      /        \
                                   safe      confirmed
                                               │
                                               ▼
                                         Final Report
Public phase Internal stage ID What it does
Project Analysis RECON, ROUTING Understands the audit scope, build environment, dependencies, protocol features, and applicable security checks.
Context Analysis DOMAIN_RESOLUTION, DOMAIN_CONTEXT Resolves protocol-specific facts such as oracle usage, permissions, assets, and liquidation assumptions.
Initial Review SCREEN Separates checks that are provably irrelevant from checks that require deeper investigation.
Deep Audit DEEP_REVIEW Analyzes candidate vulnerabilities against real code paths, state transitions, invariants, and economic assumptions.
Vulnerability Validation PROOF Uses traces, invariants, calculations, or PoCs to prove or disprove suspicious issues.
Final Report REPORT Re-validates the audit state and reports only confirmed findings.

The key rule throughout the pipeline is:

uncertain → investigate further
uncertain ≠ safe

This prevents incomplete analysis from silently becoming a clean audit. For a detailed walkthrough of every phase, see Audit Workflow.

Safety Guarantees

UNKNOWN ≠ ABSENT

incomplete compilation
→ cannot establish trusted absence

Initial Review (`SCREEN`)
→ CANDIDATE or NOT_APPLICABLE_CONFIRMED

SUSPICIOUS
→ Vulnerability Validation (`PROOF`) required

CONFIRMED
→ Final Report only

stale artifacts
→ rejected

Uncertainty is never silently filtered, incomplete artifacts cannot claim a clean audit, and stale review artifacts are not reused. See Audit Runtime for implementation-level details.

Audit Output

Runs default to one managed output subtree inside the audited project:

/path/to/project/.evm-auditor-work/AUDIT-REPORT.md

Pass --output-dir <path> at initialization for a custom project-local or external location (--run-dir remains a legacy alias). The managed subtree is excluded from audit scope discovery, compilation fingerprints, source snapshots, and PoC build-tree copies; everything outside it remains authoritative input. AUDIT-REPORT.md contains only CONFIRMED findings; supporting Project Analysis, Context Analysis, Initial Review, Deep Audit, and Vulnerability Validation artifacts remain beside it. Users who do not want the output appearing as untracked files may add .evm-auditor-work/ to their .gitignore.

For a workspace with incompatible Solidity build profiles, initialize with a validated compilation plan:

python3 scripts/audit_run.py init <workspace> \
  --audit-root <workspace> --build-root <workspace> \
  --compilation-plan compilation-plan.json

The plan runs each declared target serially and aggregates coverage into one lineage-bound Feature Map. A failed target or uncovered scope file keeps the run conservative; it never becomes an absence or a reason to relabel UNKNOWN as PRESENT.

Using Individual Domain Skills

Use evm-audit-master by default. When the audit scope is already known, use an individual Domain Skill from the Skill Catalog.

Development & Internals

For maintainers, contributors, and advanced users who want to understand or extend the repository.

Architecture & Documentation

Repository Layout

  • skills/ — directly usable Skill packages
  • data/ — canonical security knowledge
  • domains/ — Domain configuration
  • scripts/ — audit runtime and maintenance tooling
  • evm_audit_runtime/ — shared pure runtime logic
  • schemas/ — artifact schemas
  • docs/ — architecture and runtime documentation
  • development/ — benchmarks and maintenance fixtures
  • tests/ — runtime and regression tests

Knowledge Base

data/canonical-checks.json is the authoritative checklist source. Generated Skill Markdown is derived output and should not be edited directly. See Knowledge Maintenance for editing and generation rules.

Development & Validation

See the Development Guide.

License

The repository is licensed under the MIT License in LICENSE. Source provenance and pinned upstream revisions are documented in docs/knowledge-lineage.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages