SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.18384 · 2025

Dynamic Risk Assessments for Offensive Cybersecurity Agents

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2505.18384.json · badge: /api/ran/2505.18384.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
boyiwei/dynamic-risk-assessment canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
get_examples Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/run_evaluation.py
code served (permissive licence) · get_code("07105a13d005394c")
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 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 json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test_data.json")

# Write sample data to the JSON file
sample_data = [
    {"task_id": 1, "name": "task_one", "content": "example content 1"},
    {"task_id": 2, "name": "task_two", "content": "example content 2"},
    {"task_id": 3, "name": "task_three", "content": "example content 3"}
]

with open(json_file, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "json_file": json_file
}
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 1, 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
get_low_confidence_task_list Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/success_task_freq.py
code served (permissive licence) · get_code("080a31e60f425571")
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
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
analysis_dir = os.path.join(temp_dir, 'analysis', 'successful_tasks_lists')
os.makedirs(analysis_dir, exist_ok=True)

# Create some test files with the prefix "test_prefix"
test_file_1 = os.path.join(analysis_dir, 'test_prefix_file1.txt')
test_file_2 = os.path.join(analysis_dir, 'test_prefix_file2.txt')
other_file = os.path.join(analysis_dir, 'other_file.txt')

# Write test data to files
with open(test_file_1, 'w') as f:
    f.write('task_dir_1\ntask_dir_2\ntask_dir_3\n')

with open(test_file_2, 'w') as f:
    f.write('task_dir_2\ntask_dir_3\n')

with open(other_file, 'w') as f:
    f.write('task_dir_1\n')

# Create weighted_tasks dictionary mapping task names to weights
weighted_tasks = {
    'task_dir_1': 0.5,
    'task_dir_2': 0.7,
    'task_dir_3': 0.9,
}

# Change to temp directory so the function can find 'analysis/successful_tasks_lists'
original_cwd = os.getcwd()
os.chdir(temp_dir)

# Define ARGS
ARGS = {
    'prefix': 'test_prefix',
    'weighted_tasks': weighted_tasks,
}

# Note: The function uses os.walk on 'analysis/successful_tasks_lists' 
# which is now accessible from temp_dir
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
grade_benchmark Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/grade_benchmark.py
code served (permissive licence) · get_code("c4b3d2103d4bce94")
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. The image it ran in was not recorded. If your copy returns the same type 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 json
import tempfile
import shutil

# Create a temporary directory structure for the test
temp_dir = tempfile.mkdtemp()
log_dir = os.path.join(temp_dir, 'logs', 'test_task')
os.makedirs(log_dir, exist_ok=True)

# Create some test JSON files
json_files_data = [
    {'finish_reason': 'solved'},
    {'finish_reason': 'solved'},
    {'finish_reason': 'failed'},
    {'finish_reason': 'timeout'},
    {'finish_reason': 'solved'},
]

for i, data in enumerate(json_files_data):
    json_path = os.path.join(log_dir, f'task_{i}.json')
    with open(json_path, 'w') as f:
        json.dump(data, f)

# Temporarily modify the working directory for this setup
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'task_name': 'test_task'
}

# Note: The function will look in 'logs/' + task_name = 'logs/test_task'
# which now exists in our temp directory at temp_dir/logs/test_task
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 — a tuple output has no array shape of its own; none is stated
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
pass_at_k Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/grade_benchmark.py
code served (permissive licence) · get_code("31dac9f8d6c131b8")
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 float64, ndim 0, 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 numpy as np

def pass_at_k(n, c, k):
    """
    n: total number of iterations (for single task)
    c: number of tasks solved (for single task)
    k: k in pass@k"""
    if n - c < k:
        return 1.0
    else:
        return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))

# Construct valid arguments for pass_at_k
# The function takes three numeric parameters:
# n: total number of iterations
# c: number of tasks solved (should be <= n)
# k: k value for pass@k calculation

ARGS = {
    "n": 10,      # total iterations
    "c": 3,       # tasks solved
    "k": 2        # k value for pass@k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
successful_task_freq Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/success_task_freq.py
code served (permissive licence) · get_code("cb323a230e975d41")
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
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
analysis_dir = os.path.join(temp_dir, 'analysis', 'successful_tasks_lists')
os.makedirs(analysis_dir, exist_ok=True)

# Create some test files with the prefix "test_"
test_file_1 = os.path.join(analysis_dir, 'test_run_1.txt')
with open(test_file_1, 'w') as f:
    f.write('path/to/task_a\n')
    f.write('path/to/task_b\n')
    f.write('path/to/task_a\n')

test_file_2 = os.path.join(analysis_dir, 'test_run_2.txt')
with open(test_file_2, 'w') as f:
    f.write('path/to/task_b\n')
    f.write('path/to/task_c\n')

# Change to temp directory so os.walk finds the files
original_dir = os.getcwd()
os.chdir(temp_dir)

try:
    ARGS = {
        'prefix': 'test_'
    }
finally:
    # Note: In actual execution, we'd need to handle cleanup
    # but for setup we just define ARGS
    pass

ARGS = {
    'prefix': 'test_'
}
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
successful_task_freq_intercode Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/success_task_freq.py
code served (permissive licence) · get_code("f9c8a8c734676590")
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
import shutil

# Create temporary directory structure for the function to work with
temp_dir = tempfile.mkdtemp()
analysis_dir = os.path.join(temp_dir, 'analysis', 'successful_tasks_lists')
os.makedirs(analysis_dir, exist_ok=True)

# Create sample files with the prefix "test_prefix"
# File 1: contains challenge references
file1_path = os.path.join(analysis_dir, 'test_prefix_batch1.txt')
with open(file1_path, 'w') as f:
    f.write('/some/path/challenge_0.txt\n')
    f.write('/some/path/challenge_5.txt\n')
    f.write('/some/path/challenge_10.txt\n')

# File 2: contains more challenge references
file2_path = os.path.join(analysis_dir, 'test_prefix_batch2.txt')
with open(file2_path, 'w') as f:
    f.write('/some/path/challenge_2.txt\n')
    f.write('/some/path/challenge_0.txt\n')
    f.write('/some/path/challenge_15.txt\n')

# Change to temp directory so relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

try:
    ARGS = {
        'prefix': 'test_prefix'
    }
finally:
    os.chdir(original_cwd)
    shutil.rmtree(temp_dir)
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
truncate_input_to_max_tokens Ran
ran on a synthesized input
boyiwei/dynamic-risk-assessment/analysis/convert_traj_to_chat.py
code served (permissive licence) · get_code("b5b40db141419585")
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 torch
from transformers import AutoTokenizer

# Create a minimal stand-in tokenizer that has the required methods
class StandInTokenizer:
    def __init__(self):
        pass
    
    def __call__(self, text):
        # Return a simple object with input_ids that counts words
        class TokenOutput:
            def __init__(self, text):
                # Simple tokenization: split by spaces and count
                self.input_ids = text.split() if text.strip() else []
        return TokenOutput(text)
    
    def decode(self, token_ids):
        # Join tokens back with spaces and add padding to match expected behavior
        decoded = ' '.join(token_ids)
        # Add 11 characters of padding to test the [:-11] slicing
        return decoded + '___padding_'

tokenizer = StandInTokenizer()

# Create test arguments
model_input = "This is a test input that will be tokenized for the truncation function"
system_prompt = "You are a helpful assistant"
max_input_tokens = 50

ARGS = {
    'tokenizer': tokenizer,
    'model_input': model_input,
    'system_prompt': system_prompt,
    'max_input_tokens': max_input_tokens
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
compute_pass_k_bootstrap Not yet run
unverified (harvested, no recorded run)
boyiwei/dynamic-risk-assessment/analysis/grade_benchmark.py
code served (permissive licence) · get_code("6c524fa2a0de7d8d")
How it ran

no invocation recorded.

compute_seq_length Not yet run
unverified (harvested, no recorded run)
boyiwei/dynamic-risk-assessment/analysis/compute_seq_length.py
code served (permissive licence) · get_code("05c8f2e36d06eee0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-23.

Repositories linked to this paper

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

Abstract

Foundation models are increasingly becoming better autonomous programmers, raising the prospect that they could also automate dangerous offensive cyber-operations. Current frontier model audits probe the cybersecurity risks of such agents, but most fail to account for the degrees of freedom available to adversaries in the real world. In particular, with strong verifiers and financial incentives, agents for offensive cybersecurity are amenable to iterative improvement by would-be adversaries. We argue that assessments should take into account an expanded threat model in the context of cybersecurity, emphasizing the varying degrees of freedom that an adversary may possess in stateful and non-stateful environments within a fixed compute budget. We show that even with a relatively small compute budget (8 H100 GPU Hours in our study), adversaries can improve an agent's cybersecurity capability on InterCode CTF by more than 40\% relative to the baseline -- without any external assistance. These results highlight the need to evaluate agents' cybersecurity risk in a dynamic manner, painting a more representative picture of risk.

For agents

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

get_harvested_code_for_paper("2505.18384")
get_code_for_paper("2505.18384")
have("2505.18384")

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

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

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

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

Connect an agent — have() is free.