Halo2
Halo2 ZK Circuits: A Practical Guide for Rust Developers
How Halo2 circuits are built in Rust, and where constraint mistakes tend to hide.
In Halo2, every advice cell you assign needs a gate, a lookup or a copy constraint behind it. AI agents review your chips, ZK Vanguard catches the cells nothing constrains, and Picus backs the result with formal verification.
For Halo2 circuits written in Rust. At RISC Zero, Picus in CI surfaced 35 issues during development.

Scout reads your chips, gates and layouter code in Rust, builds a threat model for the circuit, and reports what it finds. It works even before your crate compiles.
What your circuit must guarantee: which values reach the instance column, and what a valid proof should attest.
Selectors, rotations and the values passed between regions, read the way a reviewer would.
Scout sends each finding to ZK Vanguard or Picus, so your Halo2 findings arrive with tool output attached.
Two tools, one sequence: ZK Vanguard catches likely underconstrained signals; Picus proves their absence.
Detects underconstrained signals, witness leakage, non-deterministic dataflow and unused components in your PLONKish constraint system. Results in seconds to minutes.
// HALO2
Explore ZK Vanguard →Proves your gates, lookups and copy constraints fix every output for given inputs, or returns two distinct witnesses that satisfy them all.
// HALO2
Explore Picus →In Halo2, witness assignment and constraints live in different parts of your Rust code, and most bugs sit in the gap between them.
| Vulnerability | What happens | Covered by |
|---|---|---|
| Assigned, never constrained | An advice cell filled in a region that no enabled gate, lookup or copy constraint touches. | ZK Vanguard + Picus |
| Missing copy constraint | A value reassigned in a new region instead of copied, so the two cells can diverge. | Picus |
| Unbound public output | A result never tied to the instance column, so the verifier never checks it. | ZK Vanguard |
| Selector on the wrong rows | A gate never enabled where its region assigns values, or one that queries the wrong rotation. | Scout + Picus |
| Missing range check | A value used in arithmetic or a lookup without a range check wraps around the field. | ZK Vanguard |
| Witness and gate disagree | Your assignment code computes one value while the gate only enforces a weaker relation. | ZK Vanguard |
Some Halo2 bugs are fully constrained and still wrong: Scout reviews that logic against your threat model.
Scout flags a cell your chip assigns in one region and reuses in another without a copy constraint. Picus verifies the circuit and returns the evidence: two distinct witnesses that satisfy every gate.

Your chips, gates and layouter stay in Rust, as they are. Determinism is a property of your constraint system, not of the commitment scheme, so the result holds whether you build on KZG or IPA.
// 001
Your Halo2 crate on GitHub.
// 002
Halo2 circuits are translated into LLZK, the intermediate representation ZK Vanguard analyzes.
// 003
ZK Vanguard and Picus run in GitHub Actions, so every change to your chips is checked during development.
Writing Halo2 with a coding agent? AuditHub MCP brings the same tools into your session.
Halo2 circuits keep changing after the audit: a new chip, a tighter gate, a cheaper layout. AuditHub rechecks each change in CI, and the audit still gives you a signed expert review.
Before audit
During audit
After audit






RISC Zero integrated Picus into its CI to verify the determinism of its zkVM circuits. Each issue was mitigated during development, and new changes are checked as the codebase evolves.
An advice cell that no gate, lookup or copy constraint fully determines. A prover can fill it with another value and still produce a valid proof.
Yes. Picus returns verified when every output is uniquely determined by the inputs, unsafe with two distinct witnesses when it is not, or unknown when it can give neither.
ZK Vanguard runs first and catches likely underconstrained signals in seconds to minutes. Picus follows and proves their absence, or returns a concrete counterexample.
No. They check your circuits continuously between audits, and the audit gives you a signed expert review.
Still have questions? Contact us
Halo2
How Halo2 circuits are built in Rust, and where constraint mistakes tend to hide.
ZK Security Audits
Why underconstrained signals and witness leaks break ZK circuits, and how to check for them.
Formal Verification
What a formal proof guarantees about a contract or circuit, and which questions it leaves open.
Run ZK Vanguard and Picus on your Halo2 circuits today.