Full repository refactoring setting for Control Arena
Project description
Full Repository Refactor
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 or later):
pip install full-repo-refactor
Then create a .env file:
# Provider API keys
OPENAI_API_KEY=<your key here>
ANTHROPIC_API_KEY=<your key here>
# Trusted and untrusted models--use versions to record the exact model in the transcripts
TRUSTED_MODEL=openai/gpt-4.1-nano-2025-04-14
UNTRUSTED_MODEL=anthropic/claude-sonnet-4-20250514
# Model overrides when using SWE agents (e.g., `--swe-agent` for the CLI). If not specified, the
# `UNTRUSTED_MODEL` or `TRUSTED_MODEL` will be used
CLAUDE_CODE_MODEL=anthropic/claude-sonnet-4-20250514
CODEX_MODEL=openai/gpt-5.1-2025-11-13
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
full-repo-refactor
# Run getting started scenario in default model (honest)
full-repo-refactor --config=scenarios/getting-started
# Run getting started scenario in attack mode
full-repo-refactor --config=scenarios/getting-started --eval-mode attack
# Run with a different dataset from `github:fastfedora/full_repo_datasets` and limit main tasks
full-repo-refactor --dataset side-tasks-3/mixed-20 --main-task "refactor_single_file"
# Run with verbose logging and limit to 3 samples
full-repo-refactor --config=scenarios/getting-started --verbose --limit 3
# View help
full-repo-refactor --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:
full-repo-refactor --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 full_repo_refactor-0.2.2.tar.gz.
File metadata
- Download URL: full_repo_refactor-0.2.2.tar.gz
- Upload date:
- Size: 49.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a0eb62b66e83e4e7121930b06fbe002f3b6b9a2cefc62136d21b449cf877095
|
|
| MD5 |
ed4a132cc4ed981342eea2f359f76e3f
|
|
| BLAKE2b-256 |
fb90074e4c05cac9ff747ee01cd661d2cc60b81c4eddad11ce248920a81070a9
|
Provenance
The following attestation bundles were made for full_repo_refactor-0.2.2.tar.gz:
Publisher:
publish.yml on fastfedora/full-repo-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
full_repo_refactor-0.2.2.tar.gz -
Subject digest:
2a0eb62b66e83e4e7121930b06fbe002f3b6b9a2cefc62136d21b449cf877095 - Sigstore transparency entry: 958688833
- Sigstore integration time:
-
Permalink:
fastfedora/full-repo-refactor@97ad0cde1ee42b500c6f760783aa5b4d4daa275c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/fastfedora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97ad0cde1ee42b500c6f760783aa5b4d4daa275c -
Trigger Event:
release
-
Statement type:
File details
Details for the file full_repo_refactor-0.2.2-py3-none-any.whl.
File metadata
- Download URL: full_repo_refactor-0.2.2-py3-none-any.whl
- Upload date:
- Size: 259.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4296734af93704c6152fd63fb4fb8628fdc1ec133b79a481e020199dbdaaa002
|
|
| MD5 |
70723789f85ce78c4d20338d454da87d
|
|
| BLAKE2b-256 |
c618c82f0c27c8425f8f999a527b07c4d77e4ce4703d2d6dcec4688971a43f48
|
Provenance
The following attestation bundles were made for full_repo_refactor-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on fastfedora/full-repo-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
full_repo_refactor-0.2.2-py3-none-any.whl -
Subject digest:
4296734af93704c6152fd63fb4fb8628fdc1ec133b79a481e020199dbdaaa002 - Sigstore transparency entry: 958688892
- Sigstore integration time:
-
Permalink:
fastfedora/full-repo-refactor@97ad0cde1ee42b500c6f760783aa5b4d4daa275c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/fastfedora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97ad0cde1ee42b500c6f760783aa5b4d4daa275c -
Trigger Event:
release
-
Statement type: