Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/zunmax/fhevm-skill/fhevm-testinggit clone --depth 1 https://github.com/zunmax/fhevm-skillWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01910 |
| Opus 5 | $0.00000 | $0.00955 |
| Sonnet 5 | $0.00000 | $0.00382 |
| Haiku 4.5 | $0.00000 | $0.00191 |
Grade A, and why
fhevm-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FHEVM Hardhat Testing Rules
Setup
import { fhevm } from "hardhat";
import { FhevmType } from "@fhevm/hardhat-plugin";
Test Modes
| Mode | Command | Encryption | Speed |
|---|---|---|---|
| Mock | npx hardhat test |
Simulated | Fast |
| Local node | npx hardhat test --network localhost |
Simulated | Fast |
| Sepolia | npx hardhat test --network sepolia |
Real FHE | Slow |
Encrypting Values
const input = fhevm.createEncryptedInput(contractAddress, signer.address);
input.add64(1000n);
const encrypted = await input.encrypt();
/* encrypted.handles[0] - bytes32 handle (order matches add*() call order) */
/* encrypted.inputProof - shared proof for all handles */
Decrypt Functions - Three Different Signatures
/* euint types - FhevmType IS REQUIRED */
const val: bigint = await fhevm.userDecryptEuint(
FhevmType.euint64, handle, contractAddr, signer
);
/* ebool - NO FhevmType parameter */
const flag: boolean = await fhevm.userDecryptEbool(
handle, contractAddr, signer
);
/* eaddress - NO FhevmType parameter */
const addr: string = await fhevm.userDecryptEaddress(
handle, contractAddr, signer
);
This is the #1 testing mistake: adding FhevmType.ebool to userDecryptEbool by analogy with euint.
Public Decrypt - Same Pattern
const val = await fhevm.publicDecryptEuint(FhevmType.euint64, handle);
const flag = await fhevm.publicDecryptEbool(handle);
const addr = await fhevm.publicDecryptEaddress(handle);
/* No signer or contractAddress needed */
Custom Tasks
Custom Hardhat tasks MUST call await fhevm.initializeCLIApi() before using the fhevm API.
Tests auto-initialize - only tasks need this.
Never Use in Tests
fhevmjs- deprecated, use@fhevm/hardhat-plugin@fhevm/sdk- does not existfhevm.createInstance()- exists on the implementation class but NOT on the public typedHardhatFhevmRuntimeEnvironmentinterface; usefhevm.createEncryptedInput()directly
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 173 lines · 0 tokens per session scan A 5f240e66e794
fhevm-testing is a cursor rule published in the GitHub repository zunmax/fhevm-skill (2 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,910 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
root-decorator-tests
Cursor rule "root-decorator-tests" from dmno-dev/varlock, covering rule: root decorator test structure, description, rationale, requirements and example.
bun-test
When mocking entire modules, use mock.module(path, callback) (1) .
commit-checks
Run gofmt, go vet, and unit tests before committing Go files.
unit-testing
Python integration and unit testing — pytest patterns, test classes, workflow test tips.