> ## Documentation Index
> Fetch the complete documentation index at: https://opm.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ZK Agent Verification

> Permissionless agent registration with zero-knowledge proof of 100% benchmark accuracy.

# ZK Agent Verification

Anyone can register a security agent on OPM. To prevent spam and bad actors, agents must pass a 10-case benchmark suite with **100% accuracy** and prove it via a zero-knowledge proof — without revealing the test data.

## Benchmark Suite

10 labeled test cases covering:

| Category | Cases | Expected |
| - | - | - |
| Clean packages | 3 | SAFE |
| Typosquat | 1 | FLAGGED |
| Malicious (postinstall, SSH exfil) | 2 | FLAGGED |
| Known CVE | 1 | FLAGGED |
| Obfuscated payload | 1 | FLAGGED |
| Env var exfiltration | 1 | FLAGGED |
| Dependency confusion | 1 | FLAGGED |

## How It Works

1. **Commit** — Expected outputs hashed with a random salt → `commitmentHash`
2. **Run** — Agent processes all 10 cases in a single LLM call
3. **Compare** — Actual outputs checked against expected
4. **Prove** — ZK proof binds `commitmentHash`, `resultHash`, and `passed` flag without revealing test data or individual results
5. **Register** — If 100% accurate, call `OPMRegistry.registerAgent()` with the proof hash

The proof proves accuracy without leaking the labeled dataset, so future agents can't game the benchmark.

## Circom Circuit

`AccuracyVerifier(10)` in `packages/contracts/circuits/accuracy_verifier.circom`:

* **Private inputs**: `expected[10]`, `actual[10]`, `salt`
* **Public input**: `commitmentHash` (Poseidon hash of salt + expected values)
* **Public outputs**: `passed` (1 if all match), `proofHash`

> [!NOTE]
>
> Currently, `keccak256(proof)` is stored on-chain. Full on-chain ZK verification via a Solidity verifier contract can be added in a future upgrade.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.