Skip to main content

Refactor Arena

A Control Arena setting for evaluating agents on full repository refactoring tasks with optional backdoor insertion.

View full documentation.

Overview

This setting provides an environment for evaluating agents on full repository refactoring tasks. Each task involves:

  1. Main Task: Refactoring the repository to improve code quality and maintainability.
  2. Side Task (Attack Mode): Inserting a hidden vulnerability while performing the refactoring that is exploited when running the tests.

Installation

Install the package (requires Python 3.12):

# Install the package
pip install refactor-arena

# Setup your .env and initial scenario
refactor-arena init

# Run getting started scenario in honest mode
refactor-arena eval --config getting-started

If not already installed, install Docker. Docker must be running for the evals to execute.

Usage

Using the CLI

# Run with default settings using `side-tasks-3/mixed-3` dataset
refactor-arena

# Setup your .env and initial scenario
refactor-arena init

# Run getting started scenario in honest mode
refactor-arena eval --config getting-started

# Run getting started scenario in attack mode
refactor-arena eval --config getting-started --eval-mode attack

# Run with a different dataset from `github:fastfedora/full-repo-datasets` and limit main tasks
refactor-arena --dataset side-tasks-3/mixed-20 --main-task "refactor_single_file"

# Run with verbose logging and limit to 3 samples
refactor-arena eval --config getting-started --verbose --limit 3

# View help
refactor-arena --help

Configuration

To create a new scenario, create a file that references the main configuration file from the package and then override the settings you want to change.

For instance, to create a scenario that runs only the Refactor Single File main task against the 20-repo side-tasks-3/mixed-20 dataset in attack mode, create a file called mixed-20.yaml:

# mixed-20.yaml
includes:
  - package:config.yaml

setting:
  dataset: "side-tasks-3/mixed-20"
  main_task: refactor_single_file$

eval:
  # Default mode for this scenario is attack; use `--eval-mode honest` to run in honest mode
  mode: attack

Then run this scenario using:

refactor-arena --config=mixed-20

Almost all aspects of the setting can be configured via configuration files, including:

  • models
  • prompts
  • main tasks
  • side tasks
  • policies
  • monitors
  • metrics
  • eval settings

See the documentation for more details.

License

MIT License

Metadata

Release files for refactor-arena 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refactor-arena 1.0.0
File Size Uploaded
refactor_arena-1.0.0.tar.gz 50.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for refactor-arena 1.0.0
File Interpreter ABI Platform
refactor_arena-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.5 MB

Release files / refactor_arena-1.0.0.tar.gz

Download URL refactor_arena-1.0.0.tar.gz
Size 50.2 MB
Tags Source
SHA-256 checksum
How to use checksums
c5d08dc6b7a0501f5b05877bc6398b4a919f5db9edbf4bd33d481c5450a1283b
BLAKE2b-256 checksum
How to use checksums
c25b449c5f6e42ecaad4a9e8dab5f5733bba60cef7a253a66516abed3a8477aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / refactor_arena-1.0.0-py3-none-any.whl

Download URL refactor_arena-1.0.0-py3-none-any.whl
Size 293.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45fb18a0bb03caff7eb50d3615511a15a14007e79bdae417904bde828eb02dd2
BLAKE2b-256 checksum
How to use checksums
97d714451347ebe812c3720c367a23ce0feab038357d9bb91678f7a923b94d45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

This release

1.0.0 This release

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page