SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.23643 · 2026

Less Effort, Shorter Proofs: Reinforcement Learning for Security Protocol Analysis in Tamarin

Matthias Cosler, Bernd Finkbeiner, Mohamed Ghanem, Cas Cremers, Niklas Medinger

arXiv · PDF · Open in the Atlas

Code that ran

16 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 14 failures of our instrument; 2 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2605.23643.json · badge: /api/ran/2605.23643.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
niklasmedinger/Tamarin-ML-API canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
MatCos/TamRL canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
add_dashes_to_arguments Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/etc/tamarin-troop.py
pointer only (licence: GPL-3.0) · get_code("2242a44f3f7b7332")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

add_double_dashes_to_arguments Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/etc/tamarin-troop.py
pointer only (licence: GPL-3.0) · get_code("ac554b856fdbcd2f")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

color Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/regressionTests.py
pointer only (licence: GPL-3.0) · get_code("85c53052d0602d48")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_commands Ran
ran; our contract draft was wrong, not the code
MatCos/TamRL/eval/tamarin_wrapper.py
code served (permissive licence) · get_code("28aae34a5d50f267")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

# Create a temporary file to act as the model path
temp_model_file = tempfile.NamedTemporaryFile(delete=False, suffix=".model")
temp_model_path = temp_model_file.name
temp_model_file.close()

ARGS = {
    'model': temp_model_path,
    'executable': '/usr/bin/prover',
    'ram': None,
    'cores': 4,
    'lemmas': ['lemma_one', 'lemma_two', 'lemma_three'],
    'preprocess_flags': ['flag1', 'flag2'],
    'tam': '--timeout 30'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extractexclude Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/manual/filter.py
pointer only (licence: GPL-3.0) · get_code("3d037295fa1d28e5")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

filterinput Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/manual/filter.py
pointer only (licence: GPL-3.0) · get_code("524e718089af0ac5")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

getColorQuality Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/regressionTests.py
pointer only (licence: GPL-3.0) · get_code("aad03ee127de0e35")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_sinusoidal_positional_encoding Ran
ran, honoured the contract we drafted
MatCos/TamRL/src/models/utils.py
code served (permissive licence) · get_code("c046ae398def14ec")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (8, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "seq_len": 8,
    "d_model": 4,
    "device": torch.device("cpu")
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
includefile Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/manual/filter.py
pointer only (licence: GPL-3.0) · get_code("0e682454dc085471")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

mean_pooling Ran
ran; our contract draft was wrong, not the code
MatCos/TamRL/src/models/utils.py
code served (permissive licence) · get_code("62a99b2d6369003d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create test tensors
batch_size = 2
seq_length = 3
hidden_dim = 4

# Create output tensor (batch_size, seq_length, hidden_dim)
out = torch.randn(batch_size, seq_length, hidden_dim)

# Test case 1: with padding mask
padding_mask = torch.tensor([
    [False, False, True],   # batch 0: first 2 tokens are real, last is padding
    [False, True, True]     # batch 1: first token is real, last 2 are padding
])

ARGS = {
    "out": out,
    "padding_mask": padding_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parseTest Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/regressionTests.py
pointer only (licence: GPL-3.0) · get_code("d2c8d290524cfd7f")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rename_quantified Ran
ran, honoured the contract we drafted
MatCos/TamRL/src/dtypes/fol_tree.py
code served (permissive licence) · get_code("73624e17f433c69d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Any

# Construct a formula represented as a dict tree structure
# The function processes formulas with quantifiers (Forall, Exists) and renames variables

def create_simple_formula():
    """Create a simple formula: Forall x. P(x)"""
    return {
        'name': 'Forall',
        'vars': [
            {'name': 'x'}
        ],
        'args': [
            {
                'name': 'P',
                'args': [
                    {'name': 'x', 'args': []}
                ]
            }
        ]
    }

def create_complex_formula():
    """Create a more complex formula: Forall x. Exists y. Q(x, y)"""
    return {
        'name': 'Forall',
        'vars': [
            {'name': 'x'}
        ],
        'args': [
            {
                'name': 'Exists',
                'vars': [
                    {'name': 'y'}
                ],
                'args': [
                    {
                        'name': 'Q',
                        'args': [
                            {'name': 'x', 'args': []},
                            {'name': 'y', 'args': []}
                        ]
                    }
                ]
            }
        ]
    }

# Test with simple formula
f = create_simple_formula()

ARGS = {
    'f': f
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
render Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/misc/cleandot/tamarincleandotlib.py
pointer only (licence: GPL-3.0) · get_code("c012b7f362c66aab")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

report_results Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/etc/tamarin-troop.py
pointer only (licence: GPL-3.0) · get_code("60866a1f307ba993")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

run_tamarin Ran
ran; our contract draft was wrong, not the code
MatCos/TamRL/eval/tamarin_wrapper.py
code served (permissive licence) · get_code("c89cd3781f1a9d1d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import signal
import subprocess

def run_tamarin(cmd, timeout, silent, log):
    process = subprocess.Popen(cmd, cwd=os.path.dirname(os.path.realpath(__file__)), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, start_new_session=True, shell=True)
    try:
        output, errors = process.communicate(timeout=timeout)
        'if not silent:\n            pp = pprint.PrettyPrinter(indent=4)\n            pp.pprint(output.decode("utf-8"))'
        if 'Maude returned warning' in str(output):
            return ('AssociativeFailure', '')
        elif 'CallStack' in str(output) or 'internal error' in str(output):
            print(output)
            return ('TamarinError', '')
        proof_results = [line for line in str(output).split('\\n') if 'steps' in line]
        if len(proof_results) >= 1:
            for line in proof_results:
                if 'verified' in line:
                    return (line, True)
                if 'falsified' in line:
                    return (line, False)
            print('Scripting error')
            print(cmd)
            print(output)
            print(proof_results)
            raise ValueError
        else:
            print('Scripting error')
            print(cmd)
            print(output)
            print(proof_results)
            raise ValueError
    except subprocess.TimeoutExpired:
        os.killpg(os.getpgid(process.pid), signal.SIGTERM)
        return ('timeout', '')

ARGS = {
    'cmd': 'echo "test output with 5 steps verified"',
    'timeout': 10,
    'silent': True,
    'log': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subsequences Ran
ran; our contract draft was wrong, not the code
niklasmedinger/Tamarin-ML-API/misc/cleandot/tamarincleandotlib.py
pointer only (licence: GPL-3.0) · get_code("79638e88412d139d")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

abbreviate Not yet run
unverified (harvested, no recorded run)
niklasmedinger/Tamarin-ML-API/misc/cleandot/tamarincleandotlib.py
pointer only (licence: GPL-3.0) · get_code("03aac3723778b306")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, niklasmedinger/Tamarin-ML-API, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_lemma Not yet run
unverified (harvested, no recorded run)
MatCos/TamRL/eval/tamarin_wrapper.py
code served (permissive licence) · get_code("f4e775bacbe0f922")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 18 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Tools like Tamarin and ProVerif have achieved notable success in analyzing and verifying complex real-world protocols such as EMV, 5G, and WPA2, even detecting zero-day exploits. Despite these successes, verifying such protocols remains a time-consuming, challenging task, often requiring significant human effort and expertise. In this paper, we present a reinforcement learning (RL) framework inspired by AlphaZero and AlphaProof that implements a new style of proof search for Tamarin. We have developed a stateless API for Tamarin that acts as a classical RL environment. We guide a Monte Carlo Tree Search (MCTS) by a neural heuristic that learns from completed subproofs. We evaluate our framework on 16 case studies, ranging from classical protocol models to challenging state-of-the-art protocol models from recent publications. Our method finds more proofs automatically than Tamarin's standard search and produces shorter proofs than both the standard and human-engineered heuristics. Our pipeline is applicable out of the box to assist Tamarin users in active research, reducing the human effort required. Moreover, our standardized interface provides a programmatic way for users to interact with Tamarin. Finally, our work demonstrates the promising potential of adapting RL-based methods to the Tamarin domain.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2605.23643")
get_code_for_paper("2605.23643")
have("2605.23643")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2605.23643.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2605.23643.svg)](https://syntology.ai/paper/2605.23643)

Connect an agent — have() is free.