Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Require --ctf flag to run in enigma mode #769

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/keys.cfg:/app/keys.cfg \
sweagent/swe-agent-run:latest \
python run.py --image_name=sweagent/enigma:latest \
--ctf \
--model_name gpt4 \
--data_path /path/to/challenge.json \
--repo_path /path/to/repo \
Expand Down
1 change: 1 addition & 0 deletions docs/usage/enigma.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ We will run the following command,
```bash
python run.py \
--model_name gpt4 \
--ctf \
--image_name sweagent/enigma:latest \
--data_path ../LLM_CTF_Database/2018/CSAW-Finals/misc/leaked_flag/challenge.json \
--repo_path ../LLM_CTF_Database/2018/CSAW-Finals/misc/leaked_flag \
Expand Down
3 changes: 3 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class ScriptArguments(FlattenedAccess, FrozenSerializable):
raise_exceptions: bool = False
# Dump the entire config to the log
print_config: bool = True
# Run the agent in CTF mode (SWE-agent: EnIGMA)
ctf: bool = False

@property
def run_name(self) -> str:
Expand Down Expand Up @@ -515,6 +517,7 @@ def get_args(args=None) -> ScriptArguments:
config_file=CONFIG_DIR / "default.yaml",
),
actions=ActionsArguments(open_pr=False, skip_if_commits_reference_issue=True),
ctf=False,
)

# Nicer yaml dumping of multiline strings
Expand Down
1 change: 1 addition & 0 deletions tests/test_replay_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_ctf_traj_replay(test_ctf_trajectories_path, traj_rel_path, ctf_data_pat
"config/default_ctf.yaml",
"--raise_exceptions",
"--noprint_config",
"--ctf",
]
args, remaining_args = get_args(args)
main(**vars(args), forward_args=remaining_args)
Expand Down
Loading