Skip to main content

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.

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

Requires Python 3.12 or later.

pip install full-repo-refactor

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

full_repo_refactor-0.2.1.tar.gz (49.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

full_repo_refactor-0.2.1-py3-none-any.whl (259.1 kB view details)

Uploaded Python 3

File details

Details for the file full_repo_refactor-0.2.1.tar.gz.

File metadata

  • Download URL: full_repo_refactor-0.2.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.7

File hashes

Hashes for full_repo_refactor-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3e2bc9a557aff578a3c0516199bb26d4e9e2d6ad5b93583856b2cb3cf7222ca6
MD5 7dad7cf162f4cfe64ca20785e5a902e2
BLAKE2b-256 ee2d9df9cf8561ab437bcd5bea43b7c1c2dc1b3e50e784d9c00fb1ff5888bf27

See more details on using hashes here.

Provenance

The following attestation bundles were made for full_repo_refactor-0.2.1.tar.gz:

Publisher: publish.yml on fastfedora/full-repo-refactor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file full_repo_refactor-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for full_repo_refactor-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0230ad9cd9f6dc87cb93aa9b105fb0aac7b2ea0dc8bb1b254fdc0b52aa18a840
MD5 f5ae30da1de0e08a078ea3157ac88e22
BLAKE2b-256 1fe39b0fd71d22aef3d20e1d5c79e047d9cadef13e1ed1c074f6a22828985130

See more details on using hashes here.

Provenance

The following attestation bundles were made for full_repo_refactor-0.2.1-py3-none-any.whl:

Publisher: publish.yml on fastfedora/full-repo-refactor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page