TL;DR
Verifying complex security protocols like 5G and WPA2 using symbolic model checkers normally requires months of expert human effort to guide the proof search. This paper introduces a reinforcement learning (RL) framework for the Tamarin prover that automates this process using Monte Carlo Tree Search (MCTS) and a Transformer-based heuristic. The system finds more proofs automatically than standard methods and generates significantly shorter, more interpretable proofs without requiring human-engineered heuristics.
What Problem Does This Paper Address?
Symbolic security protocol verification tools, such as Tamarin, are excellent at analyzing real-world protocols under a Dolev-Yao adversary model (where the attacker can intercept, modify, and inject messages). However, because they perform unbounded verification, the problem is inherently undecidable. Tamarin often gets lost in infinite search spaces, resulting in non-terminating proof attempts.
To fix this, human experts must manually inspect failed proofs and spend weeks or months writing custom, protocol-specific heuristics (called "tactics") to guide the tool. The authors address this bottleneck by asking: Can we use reinforcement learning and tree search techniques—similar to AlphaZero and AlphaProof—to automate proof search in symbolic protocol verification?
Methods
To build an RL agent for Tamarin, the authors had to overcome several architectural challenges:
- A Stateless REST API for Tamarin: Tamarin is traditionally an automated model checker without a programmatic interface for external search algorithms. The authors extended Tamarin to act as a stateless REST server. An external client manages the proof tree and queries Tamarin to execute proof steps and validate final proofs.
- Graph Search via MCTS: Instead of standard tree search, the framework models the proof space as an AND/OR graph to deduplicate identical constraint systems reached via different paths. A Monte Carlo Tree Search algorithm explores this graph, balancing exploration and exploitation using a modified PUCT rule.
- Transformer-Based Neural Guidance: A Transformer encoder processes the tokenized set of applicable proof methods (abstracting away the massive full constraint system to ensure scalability). A policy head outputs a probability distribution over which proof method to apply next, while a value head estimates the distance to a complete proof.
- Mid-Search Subproof Learning: Unlike theorem-proving systems that only learn from fully completed proofs, this framework extracts training examples from successful subproofs mid-search. This online self-play loop makes training feasible from scratch on individual protocols without massive pretraining datasets.
Datasets
The framework was evaluated on 16 case studies compiled from Tamarin's main repository and recent high-profile publications. The authors categorized them into three tiers:
- Classical Models: Simple protocols solved easily by default heuristics (e.g., FOO Eligibility, NAXOS, Tutorial).
- Complex Models: Protocols requiring moderate human guidance (e.g., WireGuard, Signal, 5G Handover EPS N26).
- State-of-the-Art Models: Massive real-world protocol models where finding human heuristics originally took months of effort (e.g., 5G AKA, SPDM, WPA2).
Key Insights and Ideas
- State Abstraction is Key for Scalability: Early experiments using Graph Neural Networks (GNNs) on the full constraint state ran into severe scalability issues. Abstracting the state to just the set of applicable proof methods proved highly effective and aligned perfectly with how human heuristics operate.
- Learning from Partial Success: Security protocol verification steps are computationally heavy. By training on partial subproofs rather than waiting for a full root-to-leaf proof, the agent establishes a tight feedback loop, allowing it to learn and improve dynamically during a single protocol analysis.
- Graph Deduplication Matters: Merging duplicate states (turning the search tree into a DAG) reduced the explored search space by 2% to 25% depending on the protocol.
Key Results
- More Lemmas Solved Automatically: On state-of-the-art models, the RL agent substantially outperformed Tamarin's baseline heuristics. For example, it solved 73 out of 85 lemmas on WPA2 (compared to the baseline's 43) and 9 out of 20 lemmas on 5G Handover XN (compared to the baseline's 3), nearly matching the performance of complex, human-engineered tactics.
- Drastically Shorter Proofs: The RL agent consistently found much tighter proof paths. For the 5G Handover model, the RL agent produced proofs up to 500 times shorter than the baseline heuristics, making the resulting proofs far easier for humans to interpret and maintain.
- Time Efficiency: While training and searching takes between 4.5 to 20 hours for massive state-of-the-art models, it completely automates what used to be months of manual human engineering.
Limitations and Future Work
- Existential Lemmas: The agent struggles with existential lemmas (proving that a certain valid execution trace exists). Solutions for these are deep in the search tree, and because existential proofs rarely generate contradictory subproofs, the agent receives very little mid-search training data.
- Computational Overhead: Tamarin's constraint solver is slow; single node expansions can take up to 90 minutes on massive models like SPDM, severely limiting how much of the search space the RL agent can explore.
- Transfer Learning: The authors note it is still an open question whether an agent trained on one protocol can effectively transfer its knowledge to accelerate the verification of an entirely different protocol.
Summary updated