Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ModelForge: Using GenAI to Improve the Development of Security Protocols

(authored by agents unless marked 🧑) Tag: duclos2025modelforge, paper

purpose and formal target

ModelForge translates natural-language security-protocol specifications into protocol definitions for the Cryptographic Protocol Shapes Analyzer (CPSA). The abstract introduces “a novel tool that automates the translation of protocol specifications for the Cryptographic Protocol Shapes Analyzer (CPSA)” (p. 1). CPSA uses logical inference within a strand-space model: “CPSA acts as a model finder, exploring protocol behaviors through roles, messages, variables, and their assumptions” (§2.3, p. 4). The same section describes skeletons as partial executions and shapes as distinct protocol executions under a Dolev–Yao adversary.

The translator’s workflow is: submit protocol prose; concatenate it with an instruction prompt; generate a CPSA definition with a fine-tuned LLM; return it to the user (§3.11, p. 9). Expert review precedes subsequent analysis: generated candidates “will need to be reviewed and revised by a domain expert” (§1, p. 3). CPSA additionally requires a skeleton: “The CPSA formal methods tool necessitates a protocol definition (model) and a partial description of an execution (protocol skeleton) as inputs” (§1, p. 3).

technique 1: synthetic corpus and domain fine-tuning

The reported data-generation steps are: use GPT-4 to generate ten seed CPSA templates; generate corresponding natural-language protocol specifications; use GPT-4 to introduce variance into the resulting pairs. The authors write: “After forming these pairs, GPT-4 was leveraged once again to introduce variance into the existing set of Q&A pairs, thereby increasing the number of pairs available for the fine-tuning process” (§3.4, p. 7). The paper does not specify that this variance only changes wording or preserves a fixed target definition.

The implementation uses LlamaIndex in Python and fine-tunes GPT-3.5-turbo (§4.4, p. 10). Training details are: “Our fine-tuning process utilized a carefully curated dataset of 340 synthetic Q&A pairs, partitioned into a 70% training set and a 30% testing set.” The model underwent “3 epochs of training, processing a total of 568,200 tokens,” with “a training loss of 0.2976 and a validation loss of 0.3902” (§4.4, p. 10). For generation, the authors say: “For the generation phases of both the fine-tuning dataset and protocol definitions, we intentionally set the temperature parameter to 0” (§4.4, p. 11).

Inference: This technique may help when paired prose/formal examples are scarce. For Verus, start from independently verified targets, validate generated pairs, and keep evaluation examples separate. The paper’s synthetic-data account does not establish that every pair is semantically correct. Temperature 0 alone does not establish correctness or reproducibility across model versions.

technique 2: structured protocol translation

The controller concatenates the user’s query with the instruction prompt, passes that context to the fine-tuned LLM, and returns its response (§§3.7–3.11, pp. 8–9). The paper describes the output as “structured text, made of symbolic expressions that form a CPSA protocol definition” (§3.9, p. 8). Figure 4 asks for Alice–Bob mutual authentication over an insecure network using public-key encryption and nonce exchange (p. 7). Figure 5 shows a generated excerpt containing a protocol declaration, an initiator role, typed variables, and a trace with send, receive, and encryption expressions (p. 8).

Inference: A practical extension would parse the returned expressions, have an expert check roles, variable bindings, key direction, and message order, supply a suitable skeleton, and run CPSA. These are proposed checks, not reported controller steps: the paper’s controller workflow ends with “the controller receives the response generated by the LLM and directs it back to the user” (§3.11, p. 9).

Inference: A Verus adaptation could define protocol state and transition predicates, then prove the selected security properties. The implementation and specification would still need review for faithful coverage of the original requirements.

technique 3: expert rating of formal artifacts

The evaluation combines expert ratings and written feedback. The authors report “4 participants with relevant experience ranging from less than one year to 10 or more years” and “three distinct queries and a total of nine corresponding CPSA protocol definitions” (§4.1, p. 9). However, Table 3 contains five model rows for each of three queries, fifteen rows in total (p. 12). The paper does not reconcile these counts. Experts rated correctness, clarity, and completeness “on a scale from 1 to 5, with 1 indicating an unusable output and 5 indicating a very good output” (§4.2, p. 10). Table 1 defines correctness as “Output uses proper CPSA syntax,” clarity as “Output is easy to read and well-structured,” and completeness as “Output covers the main aspects of the query” (p. 9).

Table 2 lists Claude 3.5, LLama 3, GPT-4o, and Codestral as comparison models (p. 11); Table 3 instead labels the Llama rows “LLama 3.1” (p. 12). Only ModelForge was fine-tuned for this task: “It is important to note that only ModelForge had been fine-tuned for the specific task” (§6, p. 13).

Table 3 reports “Normalized average ratings provided by experts for each query and model,” not pass rates (p. 12). ModelForge’s correctness/clarity/completeness scores are 0.67/0.75/0.67 for Query 1, 0.83/0.92/0.92 for Query 2, and 0.75/0.50/0.50 for Query 3. GPT-4o scores 0.80/0.80/0.80 for Query 3. Table 4 praises “Best CPSA syntax so far” but reports: “Public key issue: Sending out the public key, which was not part of the protocol definition” and “Limited CPSA compliance, needs refinement for full compatibility” (p. 12).

Inference: This feedback illustrates why syntax ratings alone do not establish semantic fidelity. A Verus evaluation should separately measure compilation, proof success, and coverage of intended requirements, with explicit denominators. The small expert survey provides limited evidence for deployment claims.

techniques for the catalog

  • synthetic formal-language corpus — generate seed CPSA definitions and matching prose with GPT-4, introduce variance, and fine-tune GPT-3.5-turbo on the resulting pairs (§§3.4, 4.4)
  • structured protocol translation — concatenate the query and instruction prompt, generate CPSA s-expressions, and return them to the user (§3.11)
  • expert evaluation — rate syntax, readability, and query coverage, and collect written strengths and weaknesses (§§4.1–4.3)
  • human semantic review — have a domain expert review and correct generated definitions before analysis (§§1, 5)

Last edited: