Before I let my agent sign anything, I make it prove the verdict — building MintGuard for zkVerify Agent Games
AgentGames An honest build log: a pre-signing guard for BSC agent transactions, built and deployed in one day for the Wildcard track. Every number below comes from runs I actually did. Where something is still open, I say so. The problem in one sentence My AI agent holds a wallet and signs transactions for me — free NFT mints on BSC, mostly — and until this week it checked nothing before signing.…
Before trusting any agent to sign transactions, the MintGuard was created to verify the transaction before it is signed. MintGuard is a tool that analyzes a transaction and returns one of three possible results: ALLOW, REVIEW, or BLOCK. It assigns a risk score and provides a list of reasons for its decision. The tool was built and deployed in just one day for the Wildcard track, and it is now available at https://mintguard-psi.vercel.app.
The source code for MintGuard is publicly available on GitHub at https://github.com/arukh89/mintguard.
MintGuard takes a transaction as input, specifically the chainID, to address, calldata, and value. It then analyzes the transaction and provides a verdict based on a set of predefined rules. Some examples of rules include:
* Reward unverified contracts with a high risk score (+40 points)
* Raise an alarm if an unlimited approval is found (+45 points)
* Any approval above zero is also considered a risk (+10 points)
* Adding a setApprovalForAll(true) instruction to the transaction also raises the risk score (+40 points)
* Including a multicall() instruction in the transaction adds another +20 points to the risk score
* Transactions containing calldata selectors that are unknown to the system also incur a +25 point penalty
* Transactions that carry any value above 0.1 BNB on BSC also receive a +20 point penalty
The MintGuard is designed with specific rules to ensure it operates in a fail-closed manner, meaning that any unknown or unverified elements will trigger a higher risk score. The tool is deterministic, meaning that given the same inputs, it will always provide the same verdict. It does not rely on external reputation lists, allowlists, or model calls. Instead, it follows a pure function approach, where the input directly determines the output.
The design of MintGuard is governed by three rules that were established before any code was written:
1. Fail closed: The tool should never silently trust any unknown or unverified elements.
2. Deterministic: The same input should always result in the same verdict.
3. Checkable claim: The tool must prove that its verdict is based on the input and the recorded chain facts.
The tool's verdict can be checked using a separate endpoint /verify, which recomputes the verdict from the input and the stored chain facts. It also generates an HMAC receipt, which can be verified using the provided key to ensure the integrity of the verification process.
Before building MintGuard, the author tested the tool using two real cases: a free mint and an unlimited approval to an unverified contract. The free mint was approved (ALLOW) with a risk score of 0, while the unlimited approval received a BLOCK verdict with a risk score of 85. The tool correctly identified both situations and provided a clear explanation for its decisions.
The tool's runtime is based on standard library-only dependencies, ensuring that it runs efficiently and securely in production. The deployment process on Vercel serverless was straightforward, with only a minor issue related to missing project settings that was quickly resolved.
The verification process using Groth16 cryptographic proofs is also part of the zkVerify half of the Agent Games. The tool has successfully generated proofs for real verdicts, demonstrating that the agent checks its transactions before signing them. The proof covers the encoded verdict but does not include the Sourcify lookup or selector decoding, which happen outside the circuit.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.