/odin-security:mermaid-to-proveriffrom ODIN Security
Translates cryptographic Mermaid sequence diagrams into ProVerif models for formal verification of secrecy, authentication, replay, and forward-secrecy properties.
Ships in ODIN Security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | A cryptographic Mermaid sequenceDiagram exists and the user asks for a ProVerif model or secrecy/authentication/replay/forward-secrecy verification. |
| Authority | Reversible local: writes only named .pv and report files; rollback is deleting uncommitted files. No remote mutation. |
| Side effect | A named .pv model file and verifier output; may execute ProVerif. |
| Done | The model type-checks, participant sends and receives match, reachability is established before security queries are trusted, and assumptions plus each query result are reported. |
sequenceDiagram block or file containing at least two named participants and at least one message between them.secrecy, authentication, replay, forward_secrecy. Defaults to all four if not specified..pv). Defaults to <diagram-name>.pv.Parse the Mermaid sequenceDiagram into an abstract syntax tree. Extract every named participant and every directed message (A->>B: label). Record message order. Identify cryptographic operation keywords in each label: encrypt, sign, hash, sharedkey, dh, pk, sk. If a label contains no recognized keyword, treat the message as a plaintext transfer over the channel type indicated by the arrow style (solid for public, dotted for private). Done when: every participant and message is extracted with its order and cryptographic keywords identified.
Define the Dolev-Yao cryptographic model in ProVerif based on the keywords found in the diagram. This stage establishes the primitive vocabulary that Stage 3 uses to map messages; without it, free-form Mermaid labels cannot be translated into valid ProVerif constructs.
Declare types: key, bitstring, and any protocol-specific types the labels reference.
Declare constructors for each cryptographic operation the diagram uses:
| Mermaid keyword | ProVerif constructor |
|---|---|
encrypt | fun enc(bitstring, key): bitstring |
pk | fun pk(key): key |
sk | fun sk(key): key (or free for long-term keys) |
sign | fun sign(bitstring, key): bitstring |
hash | fun hash(bitstring): bitstring |
sharedkey | fun sharedkey(key, key): key (or a KDF) |
dh | fun dh(key, key): key (Diffie-Hellman combine) |
Declare destructors for the inverse operations:
| Operation | ProVerif destructor |
|---|---|
| decrypt | reduc forall m: bitstring, k: key; dec(enc(m, k), k) = m |
| verify signature | reduc forall m: bitstring, k: key; getmsg(sign(m, k), pk(k)) = m |
If the diagram uses an operation with no standard Dolev-Yao primitive, stop and report the unsupported construct rather than inventing semantics.
Define channels: a public channel c for messages sent over public networks (the Dolev-Yao attacker controls these), and private channels for messages marked as authenticated or confidential in the diagram annotations. The attacker model is the standard Dolev-Yao attacker: it can intercept, modify, replay, and compose messages on public channels but cannot break cryptographic primitives.
Done when: all types, constructors, destructors, channels, and the attacker model are declared and cover every cryptographic keyword in the diagram.
Represent each participant as a let p = ... process in ProVerif. Map each actor declaration to new p:name;.
Convert each message into ProVerif process actions using the primitives from Stage 2:
A->>B: m over a public channel becomes out(c, m) in A's process and in(c, x: bitstring) in B's process.A->>B: encrypt(m, k) becomes out(c, enc(m, k)) and in(c, x: bitstring); let m = dec(x, k).A->>B: sign(m, sk_A) becomes out(c, sign(m, sk_A)) and in(c, x: bitstring); let m = getmsg(x, pk(sk_A)).out(c, hash(m)) with no destructor (hash is one-way).out/in pairs for the public values and a sharedkey or dh computation on each side.Emit event(e_sent(A, m)) before each out and event(e_received(B, m)) after each in, preserving the message order from the AST. These events anchor the reachability and authentication queries in Stage 4.
Write the .pv model file. Prefix it with a (* ADAPTED FROM: Trail of Bits mermaid-to-proverif skill; CC-BY-SA-4.0; https://github.com/trailofbits/skills *) comment block and a (* ASSUMPTIONS: <list of assumptions> *) block derived from the diagram annotations or human-supplied constraints.
Done when: every message is mapped to ProVerif process actions with events, and the .pv file is written with the attribution and assumptions blocks.
Append one reachability query query event(e_start) ... event(e_end) ... for each end-to-end message sequence before any security query, so reachability is established before security results are trusted.
Append security queries based on the requested properties:
secrecy: query secret ~m.; per sensitive message variable m.authentication: query event(e_received(A,m)) ==> event(e_sent(B,m)). per message variable m.replay: query not event(replay_attempted). per identified vulnerable transition.forward_secrecy: query secret ~m. @weak_agree ... per session-key-derived variable.Done when: reachability queries are appended for every end-to-end sequence and security queries are appended for every requested property.
Execute proverif <output>.pv. Collect the type-check result, all query results, and any WARNING or RESULT line.
Validate the output: type-check must succeed; participant sends and receives in ProVerif must correspond to the original diagram participants; each security query must be preceded by a proved reachability query; all assumptions listed in the file header must be acknowledged in the report.
Write the verification report to <output>_report.txt containing type-check status, participant correspondence confirmation, each reachability result, each security query result, and the assumption list.
Done when: ProVerif executes, the output is validated, and the report is written.
RESULT i: noninterference_interpreted_as_secrecy_not_proved or equivalent indeterminate. Do not report it as proved.verification_inconclusive and the concrete reason. Do not claim success..pv model file containing the converted protocol model, Dolev-Yao primitive declarations, assumption block, reachability queries, and security queries.<output>_report.txt containing:
SUCCESS or failure detail).RESULT classification.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-security31 skills in this plugin
/burpsuite-project-parserUse when asked to analyze a Burp Suite .burp project for audit items, request/response metadata, or captured traffic. Modes: parsed (default) and stream. Not for source or remote-system changes./chain-vulnerability-scannerUse when an Algorand, Cairo, Cosmos SDK, Solana, Substrate, or TON codebase needs vulnerability scanning with reachability-backed findings. Not for non-chain review: use security-review./codeql-security-analysisUse when building or reusing a CodeQL database, running CodeQL security analysis, or modeling project-specific sources and sinks. Not for manual vulnerability review: use security-review (mode: confirmed)./constant-time-analysisUse when reviewing cryptographic code for timing side-channels, statically in compiled output or at runtime with statistical timing tests. Not for known-answer vectors: use wycheproof./crypto-protocol-diagramUse when asked for a sequence diagram of cryptographic protocol semantics from code, prose, RFCs, papers, ProVerif, or Tamarin, or for code/spec divergence. Not for architecture: use diagramming-code./c-security-reviewUse when the user requests a userspace C or C++ security review with a threat model and severity filter and wants validated findings. Not for kernel or bare-metal code: use kernel-security.Other plugins' skills for the same job