REJECT_OVER_DEPTH, REJECT_TOO_MANY_KEYS, and so on). It never truncates and never repairs: no silent mangling, no ambiguous half-processing. It is strictly additive over the frozen Layer 1: it changes no hash and adds no cryptographic primitive.
Apache-2.0 open source. Install via
pip install algovoi-substrate-guard or npm install @algovoi/substrate-guard. Python and TypeScript reject the same hostile inputs with the same code and compute the same profile_ref, byte for byte. This is the lite tier: a structural validator plus a content-addressed profile. It is not cryptography, and not rate limiting or replay windows. Those live in the runtime verifier layer.How it works
Two pieces, both using the RFC 8785 JCS canonicalisation and SHA-256 already in the substrate:profile_refcontent-addresses the limits in force. The same discipline as Policy Binding: a record can carry theprofile_refit was admitted under, so a verifier can prove which bounds were enforced, not just that “some validation happened.” Key order does not matter (JCS sorts), so the reference is invariant to how the profile was constructed.guard(value, profile)validates in a single pass: structural bounds first (cheap, fail fast), then the canonical-size bound last, on an already-bounded value, so the size check cannot itself blow up.
Default profile guard-receipt-v1
The default profile addresses to
sha256:a4791b13c67a16109b85ef67fc65700ea902b6ad40dad44d8556632c3d5524a6. Pin it, or content-address your own profile.
What a verifier can check
No issuer call. No registry lookup. No AlgoVoi service. RFC 8785 JCS, SHA-256, and a JSON parser are the entire dependency. Every bound is a pure structural property of the parsed value (depth, count, length), so independent implementations enforce it identically. The guard enables rejection; acting on a mismatch is a runtime decision, not a property of the construction.
Use
Conformance
Thesubstrate_guard_v1 vector set (15 vectors) is published in the public corpus,
chopmob-cloud/algovoi-jcs-conformance-vectors,
with Python and Node runners. It covers the two profile_ref vectors, the accept controls (including the safe-integer boundary), one isolated rejection per bound (each value exceeds exactly one limit by one, and must reject with the named code), and the key-order invariance of profile_ref. Python and TypeScript reproduce every value byte for byte.
Honest scope
A deterministic structural validator plus a content-addressed profile. It is not cryptography, and it is not rate limiting or replay windows. Rate limiting and replay protection stay in the runtime verifier layer, and are never claimed as a property of the substrate. This page documents the open, lite tier of the AlgoVoi hardening layer.Lite vs commercial
The decision chain
Substrate Guard composes in one line with everything already built on the canonicalisation substrate. Callguard(value) before your existing reference construction, for example before an Agent Passport reference, a Spend Guardrail (lite) decision, or a Compliance Gate (lite) verdict. Because it changes no hash, every reference downstream gets the protection for free, with no format change.
Adopters
If you build onalgovoi-substrate-guard, pin ==0.1.0, anchor a canonical profile_ref hash from substrate_guard_v1 (for example a4791b13… for guard-receipt-v1), and keep the NOTICE, you qualify for a free v0 licence key for algovoi-mandate-auditor. The gate is scripts/check_v0_adoption.py (dependency + canonical hash anchor + NOTICE + version pin, all four pass, then ISSUE_V0_KEY). Apply: email [email protected].
Relationship to the open substrate
Substrate Guard (lite) sits directly in front of the open JCS Canonicalisation Substrate and composes with Policy Binding, Compliance Gate (lite), Spend Guardrail (lite), and the Retention Chain. It uses the same RFC 8785 JCS and SHA-256 primitives, with no additional cryptographic dependencies.Specification
Substrate Guard is the resource-bounds edition of input validation. It anchors to the existing input-validation section of IETF Internet-Draftdraft-hopley-x402-retention-chain (§7.5, the same section the adversarial_isolation_v1 set anchors to), where the prior set covers malformed input and Substrate Guard covers well-formed but resource-hostile input. No new draft section is asserted. The normative byte-level artifact for this construction is the published substrate_guard_v1 conformance set. Additive over the frozen canonicalisation substrate, sole AlgoVoi authorship.