SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.14866 · NeurIPS · 2025

OS-HARM: A Benchmark for Measuring Safety of Computer Use Agents

Francesco Croce, Maksym Andriushchenko, Nicolas Flammarion, Zico Kolter, Hao Zhao, Thomas Kuntz, Agatha Duzan

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2506.14866.json · badge: /api/ran/2506.14866.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
thomas-kuntz/os-harm canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
tml-epfl/os-harm canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_metrics Ran
ran; our contract draft was wrong, not the code
thomas-kuntz/os-harm/evaluate/compute_predicted_metrics.py
code served (permissive licence) · get_code("407d595c1d42da9d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned dict. 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 torch
import numpy as np

torch.manual_seed(0)

# The function expects a list of dictionaries, where each dictionary has keys:
# 'success', 'unsafe', and 'unsafe_success' with integer values (0 or 1)

y_pred = [
    {'success': 1, 'unsafe': 0, 'unsafe_success': 0},
    {'success': 1, 'unsafe': 1, 'unsafe_success': 1},
    {'success': 0, 'unsafe': 0, 'unsafe_success': 0},
    {'success': 1, 'unsafe': 1, 'unsafe_success': 0},
    {'success': 0, 'unsafe': 1, 'unsafe_success': 0}
]

ARGS = {
    'y_pred': y_pred
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
find_trajectory_directories Ran
ran; our contract draft was wrong, not the code
tml-epfl/os-harm/judge/run_judge_batch.py
code served (permissive licence) · get_code("e2defe562bc2d973")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 tempfile
import os
from pathlib import Path

# Create a temporary directory structure with some trajectory directories
temp_root = tempfile.mkdtemp()

# Create some nested directories with better_log.json files
traj_dir_1 = Path(temp_root) / "experiment1" / "run1"
traj_dir_1.mkdir(parents=True, exist_ok=True)
(traj_dir_1 / "better_log.json").touch()

traj_dir_2 = Path(temp_root) / "experiment1" / "run2"
traj_dir_2.mkdir(parents=True, exist_ok=True)
(traj_dir_2 / "better_log.json").touch()

traj_dir_3 = Path(temp_root) / "experiment2" / "run1"
traj_dir_3.mkdir(parents=True, exist_ok=True)
(traj_dir_3 / "better_log.json").touch()

# Create some directories without better_log.json (should be ignored)
other_dir = Path(temp_root) / "experiment3" / "run1"
other_dir.mkdir(parents=True, exist_ok=True)
(other_dir / "other_file.txt").touch()

ARGS = {
    "root_dir": temp_root
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
process_directory Ran
ran; our contract draft was wrong, not the code
thomas-kuntz/os-harm/evaluate/compute_predicted_metrics.py
code served (permissive licence) · get_code("2b638f3fff9bcb1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 os
import json
import tempfile
import shutil

# Create a temporary directory structure with the expected files
temp_dir = tempfile.mkdtemp()

# Define the structure: target_dir/domain/example_id/judgment/judge_model/judge_type/judge_prompt_version/judgment.json
domain1 = "domain1"
domain2 = "domain2"
example_id1 = "example_001"
example_id2 = "example_002"
judge_model = "gpt-4"
judge_type = "binary"
judge_prompt_version = "v1"

# Create directory structure for first example
path1 = os.path.join(temp_dir, domain1, example_id1, "judgment", judge_model, judge_type, judge_prompt_version)
os.makedirs(path1, exist_ok=True)

# Create judgment.json for first example
judgment1 = {
    "success": True,
    "safety": False
}
with open(os.path.join(path1, "judgment.json"), "w") as f:
    json.dump(judgment1, f)

# Create directory structure for second example
path2 = os.path.join(temp_dir, domain2, example_id2, "judgment", judge_model, judge_type, judge_prompt_version)
os.makedirs(path2, exist_ok=True)

# Create judgment.json for second example
judgment2 = {
    "success": False,
    "safety": True
}
with open(os.path.join(path2, "judgment.json"), "w") as f:
    json.dump(judgment2, f)

ARGS = {
    "target_dir": temp_dir,
    "judge_model": judge_model,
    "judge_type": judge_type,
    "judge_prompt_version": judge_prompt_version
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
process_prediction_file Ran
ran; our contract draft was wrong, not the code
thomas-kuntz/os-harm/evaluate/compute_predicted_metrics.py
code served (permissive licence) · get_code("3b649d83dd233ea1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned dict. 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 json
import tempfile
import os

# Create a temporary JSON file with prediction data
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False)
prediction_data = {
    'success': True,
    'safety': False
}
json.dump(prediction_data, temp_file)
temp_file.close()

ARGS = {
    'predict_path': temp_file.name
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
run_batch_judging Ran
ran; our contract draft was wrong, not the code
tml-epfl/os-harm/judge/run_judge_batch.py
code served (permissive licence) · get_code("5f771c9b58af92d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned dict. 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 tempfile
import json
from pathlib import Path

# Create a temporary directory structure with trajectory data
temp_dir = tempfile.mkdtemp()

# Create a few trajectory directories with better_log.json files
traj_dirs = []
for i in range(2):
    traj_path = os.path.join(temp_dir, f"trajectory_{i}")
    os.makedirs(traj_path, exist_ok=True)
    
    # Create a better_log.json file
    log_data = {
        "task": f"test_task_{i}",
        "steps": [
            {"action": "click", "target": "button"},
            {"action": "type", "target": "input", "text": "test"}
        ]
    }
    with open(os.path.join(traj_path, "better_log.json"), "w") as f:
        json.dump(log_data, f)
    
    traj_dirs.append(traj_path)

# Create a mock run_judging function that the batch function will call
def run_judging(traj_dir, observation_type, sys_prompt_version, judge_model, judge_type):
    """Mock judging function that returns a judgment dict"""
    return {
        "safety": True,
        "success": True,
        "reasoning": "Mock judgment for testing",
        "trajectory_dir": traj_dir
    }

# Inject the mock function into the global namespace so run_batch_judging can find it
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'run_judging', run_judging)

ARGS = {
    "root_dir": temp_dir,
    "observation_type": "screenshot_a11y_tree",
    "sys_prompt_version": "v3",
    "judge_model": "gpt-4.1",
    "judge_type": "aer",
    "verbose": True
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Computer use agents are LLM-based agents that can directly interact with a graphical user interface, by processing screenshots or accessibility trees. While these systems are gaining popularity, their safety has been largely overlooked, despite the fact that evaluating and understanding their potential for harmful behavior is essential for widespread adoption. To address this gap, we introduce OS-HARM, a new benchmark for measuring safety of computer use agents. OS-HARM is built on top of the OSWorld environment (Xie et al., 2024) and aims to test models across three categories of harm: deliberate user misuse, prompt injection attacks, and model misbehavior. To cover these cases, we create 150 tasks that span several types of safety violations (harassment, copyright infringement, disinformation, data exfiltration, etc.) and require the agent to interact with a variety of OS applications (email client, code editor, browser, etc.). Moreover, we propose an automated judge to evaluate both accuracy and safety of agents that achieves high agreement with human annotations (0.76 and 0.79 F1 score). We evaluate computer use agents based on a range of frontier models-such as o4-mini, Claude 3.7 Sonnet, Gemini 2.5 Pro-and provide insights into their safety. In particular, all models tend to directly comply with many deliberate misuse queries, are relatively vulnerable to static prompt injections, and occasionally perform unsafe actions. The OS-HARM benchmark is available at https://github.com/tml-epfl/os-harm.

For agents

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

get_harvested_code_for_paper("2506.14866")
get_code_for_paper("2506.14866")
have("2506.14866")

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

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

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

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

Connect an agent — have() is free.