Full repository refactoring setting for Control Arena
Project description
Refactor Arena
A Control Arena setting for evaluating agents on full repository refactoring tasks with optional backdoor insertion.
Overview
This setting provides an environment for evaluating agents on full repository refactoring tasks. Each task involves:
- Main Task: Refactoring the repository to improve code quality and maintainability.
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file refactor_arena-0.6.1.tar.gz.
File metadata
- Download URL: refactor_arena-0.6.1.tar.gz
- Upload date:
- Size: 49.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
000be1e856111b17107930a6968ef02c9ea0ea119f402dbddd06179012cf86e9
|
|
| MD5 |
81d573ac0c5b05bfa21c6164517edff2
|
|
| BLAKE2b-256 |
88c20b6d0877b0445c03f91b8029bc2943c6287a736a85c8e66348779cbb3b44
|
Provenance
The following attestation bundles were made for refactor_arena-0.6.1.tar.gz:
Publisher:
publish.yml on fastfedora/refactor-arena
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
refactor_arena-0.6.1.tar.gz -
Subject digest:
000be1e856111b17107930a6968ef02c9ea0ea119f402dbddd06179012cf86e9 - Sigstore transparency entry: 1311584762
- Sigstore integration time:
-
Permalink:
fastfedora/refactor-arena@0fee002f5083e1a7e04fcbe2532517c06b502464 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/fastfedora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0fee002f5083e1a7e04fcbe2532517c06b502464 -
Trigger Event:
release
-
Statement type:
File details
Details for the file refactor_arena-0.6.1-py3-none-any.whl.
File metadata
- Download URL: refactor_arena-0.6.1-py3-none-any.whl
- Upload date:
- Size: 280.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c36f26ebb13628f136f78d3996de78e3f385cbdf42db98b4a954e0355041413
|
|
| MD5 |
1e434181565931666e1b806e6b6d02a6
|
|
| BLAKE2b-256 |
95aae7ec2aacbd4dcfaa339668e6b2dfc98db07cc743c9eda0aee20cd3202570
|
Provenance
The following attestation bundles were made for refactor_arena-0.6.1-py3-none-any.whl:
Publisher:
publish.yml on fastfedora/refactor-arena
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
refactor_arena-0.6.1-py3-none-any.whl -
Subject digest:
8c36f26ebb13628f136f78d3996de78e3f385cbdf42db98b4a954e0355041413 - Sigstore transparency entry: 1311584813
- Sigstore integration time:
-
Permalink:
fastfedora/refactor-arena@0fee002f5083e1a7e04fcbe2532517c06b502464 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/fastfedora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0fee002f5083e1a7e04fcbe2532517c06b502464 -
Trigger Event:
release
-
Statement type: