Give the agent Stoffel docs access
Before a large implementation task, install the Stoffel skills and connect the live docs MCP server so the agent can use current docs instead of training-data guesses. Install the skills:https://docs.stoffelmpc.com/.well-known/agent-skills/index.jsonhttps://docs.stoffelmpc.com/.well-known/mcphttps://docs.stoffelmpc.com/.well-known/mcp/server-card.json
Start with the implementation boundary
Before asking an agent to write code, describe the boundary the Stoffel program must implement:- Which values are secret.
- Which values are public.
- Who supplies each input.
- Who receives each output.
- Whether each output is an opened value, client-output share, public commitment, curve-encoded value, or signature-related artifact.
- Which backend is selected and why.
- Which command proves the program is valid.
- Which command proves local MPC works.
- Which artifacts and configs are required before deployment.
Backend selection context
Give the agent the backend decision in terms of value representation and output boundary. Use HoneyBadgerMPC when:- the program computes over secret integers, fixed-point values, or field-compatible shares;
- the main cost questions are multiplication count, multiplication depth, comparisons, and reveal boundaries;
- public parameters can stay public while private inputs remain ordinary MPC shares;
- the outside system consumes an opened result or client-output shares from private computation.
- the program needs public commitments to secret shares;
- the backend must use a curve that matches an external verifier or protocol;
- public transcript bytes must become curve-field challenges;
- the outside system consumes a commitment, curve-encoded value, opened scalar response, or signature-related artifact.
Prompt template
HoneyBadgerMPC agent guidance
Ask the agent to inspect circuit shape before optimizing code:- Count secret × secret multiplications.
- Separate multiplication count from multiplication depth.
- Keep public weights, thresholds, normalization factors, and lookup tables public when possible.
- Treat comparisons, bit decomposition, and nonlinear functions as expensive until measured.
- Use
MpcOutputwhen a client should receive result shares instead of opening the result to the host application. - Size preprocessing for the largest expected input shape if the program runs on a network deployment.
ClientStore.get_number_clients()ClientStore.take_share(...)ClientStore.take_share_fixed(...)Mpc.has_capability("client-output")MpcOutput.send_to_client(...)Share.add,Share.mul,Share.mul_scalar- opened values via
.reveal(),Share.open(...), oropen_fixed()where appropriate
AVSS agent guidance
Ask the agent to keep the cryptographic transcript explicit:- Choose the curve based on the external verifier or protocol.
- Keep transcript bytes public until they become a scalar challenge with
Crypto.hash_to_field(..., Mpc.curve()). - Use
get_commitment(0)when the outside system needs a public commitment or public key point. - Persist long-lived key shares with
LocalStoragewhen the workflow requires stable key material. - Do not persist or reuse per-signature nonces unless the protocol explicitly requires and protects that state.
- Minimize openings; open scalar responses only when the protocol boundary requires it.
Share.random()LocalStorage.exists(...)LocalStorage.store(...)LocalStorage.load(...)LocalStorage.load_share(...)secret_key.get_commitment(0)Mpc.curve()Crypto.hash_to_field(...)Crypto.point_to_sec1(...)MpcOutput.send_to_client(...)
Common corrections to give the agent
- Do not use AVSS for generic private arithmetic unless the task needs commitments or curve-compatible artifacts.
- Do not reveal intermediate secret values just to make the program easier to write.
- Do not turn public transcript material into secret shares earlier than necessary.
- Do not assume a curve selector applies to HoneyBadgerMPC.
- Do not stop after writing code; run the relevant validation command and report the real output.