diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b6246bc5..8b912a79 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +doc// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3 { "name": "exploitflow_devenv", diff --git a/examples/cybersecurity/1_picoctf_static_flag.py b/examples/cybersecurity/1_picoctf_static_flag.py new file mode 100644 index 00000000..aa889355 --- /dev/null +++ b/examples/cybersecurity/1_picoctf_static_flag.py @@ -0,0 +1,42 @@ +from cai import CAI, Agent +import pentestperf as ptt + +client = CAI() + +english_agent = Agent( + model="qwen2.5:14b", + name="A file listing tool", + instructions="You only speak English. If another language is detected, invoke transfer_to_spanish_agent.", + # instructions="You only speak English.", + # tool_choice="required", # not working with ollama and qwen2.5 +) + +spanish_agent = Agent( + name="Spanish Agent", + instructions="You only speak Spanish.", +) + + +def transfer_to_spanish_agent(): + """Transfer spanish speaking users immediately.""" + return spanish_agent + + +english_agent.functions.append(transfer_to_spanish_agent) +messages = [{"role": "user", "content": "Hola, cómo estás?"}] + + +response = client.run(agent=english_agent, messages=messages, debug=True) +print(response.messages[-1]["content"]) + + +# # PentestPerf setup for "picoctf_static_flag" +# ctf = ptt.ctf( +# "picoctf_static_flag", +# subnet="192.168.9.0/24", +# container_name="ancient", +# ip_address="192.168.9.52", +# ) +# ctf.start_ctf() +# flag = ctf.get_flag() +# ctf.stop_ctf() diff --git a/setup.cfg b/setup.cfg index 6c267f93..3775a6b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,7 @@ install_requires = tqdm pre-commit instructor + pentestperf @ git+https://gitlab:gldt-1NfZ2XRWdHNip4K45auL@gitlab.com/aliasrobotics/alias_research/pentestperf@main python_requires = >=3.10 [tool.autopep8]