{"id":34820439,"url":"https://github.com/graph-com/cka-agent","last_synced_at":"2025-12-25T14:29:28.174Z","repository":{"id":327171151,"uuid":"1104697934","full_name":"Graph-COM/CKA-Agent","owner":"Graph-COM","description":"Official Implementation of the CKA-Agent, \"The Trojan Knowledge: Bypassing Commercial LLM Guardrails via Harmless Prompt Weaving and Adaptive Tree Search\".","archived":false,"fork":false,"pushed_at":"2025-12-22T03:21:58.000Z","size":357,"stargazers_count":126,"open_issues_count":1,"forks_count":31,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T18:33:56.718Z","etag":null,"topics":["jailbreak","llms","red-teaming","safety"],"latest_commit_sha":null,"homepage":"https://cka-agent.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Graph-COM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T15:05:43.000Z","updated_at":"2025-12-22T13:52:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Graph-COM/CKA-Agent","commit_stats":null,"previous_names":["graph-com/cka-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Graph-COM/CKA-Agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FCKA-Agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FCKA-Agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FCKA-Agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FCKA-Agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Graph-COM","download_url":"https://codeload.github.com/Graph-COM/CKA-Agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FCKA-Agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28031159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jailbreak","llms","red-teaming","safety"],"created_at":"2025-12-25T14:28:00.375Z","updated_at":"2025-12-25T14:29:28.161Z","avatar_url":"https://github.com/Graph-COM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CKA-Agent: Bypassing LLM Guardrails via Harmless Prompt Weaving and Adaptive Tree Search\n\n\u003ca href=\"https://arxiv.org/abs/2512.01353\" target=\"_blank\"\u003e\n    \u003cimg alt=\"arXiv\" src=\"https://img.shields.io/badge/arXiv-CKA_Agent-red?logo=arxiv\u0026style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://cka-agent.github.io/\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Website\" src=\"https://img.shields.io/badge/🌎_Homepage-blue.svg?style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Graph-COM/CKA-Agent\" target=\"_blank\"\u003e\n    \u003cimg alt=\"GitHub code\" src=\"https://img.shields.io/badge/💻_Code_GitHub-black.svg?style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"#cite\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Cite\" src=\"https://img.shields.io/badge/📖_Cite!-lightgrey?style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.python.org/\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Python\" src=\"https://img.shields.io/badge/Python-3.12-blue?style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\n\n## 🔥 Latest Results on Frontier Models (Dec 2025)\n\nCKA-Agent demonstrates consistent high attack success rates against the latest frontier models, including **GPT-5.2**, **Gemini-3.0-Pro**, and **Claude-Haiku-4.5**. The results are summarized below:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"2\"\u003eModel\u003c/th\u003e\n      \u003cth colspan=\"4\" align=\"center\"\u003eHarmBench\u003c/th\u003e\n      \u003cth colspan=\"4\" align=\"center\"\u003eStrongREJECT\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eFS ↑\u003c/th\u003e\n      \u003cth\u003ePS ↑\u003c/th\u003e\n      \u003cth\u003eV ↓\u003c/th\u003e\n      \u003cth\u003eR ↓\u003c/th\u003e\n      \u003cth\u003eFS ↑\u003c/th\u003e\n      \u003cth\u003ePS ↑\u003c/th\u003e\n      \u003cth\u003eV ↓\u003c/th\u003e\n      \u003cth\u003eR ↓\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e🟢 GPT-5.2\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.889\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.079\u003c/td\u003e\n      \u003ctd\u003e0.024\u003c/td\u003e\n      \u003ctd\u003e0.008\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.932\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.056\u003c/td\u003e\n      \u003ctd\u003e0.006\u003c/td\u003e\n      \u003ctd\u003e0.006\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e🟣 Gemini-3.0-Pro\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.881\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.087\u003c/td\u003e\n      \u003ctd\u003e0.000\u003c/td\u003e\n      \u003ctd\u003e0.032\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.951\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.037\u003c/td\u003e\n      \u003ctd\u003e0.006\u003c/td\u003e\n      \u003ctd\u003e0.006\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e🟠 Claude-Haiku-4.5\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.960\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.024\u003c/td\u003e\n      \u003ctd\u003e0.008\u003c/td\u003e\n      \u003ctd\u003e0.008\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003e0.969\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003e0.025\u003c/td\u003e\n      \u003ctd\u003e0.006\u003c/td\u003e\n      \u003ctd\u003e0.000\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003e **Metrics:** FS = Full Success, PS = Partial Success, V = Vacuous, R = Refusal. Results collected in December 2025.\n\n## Overview\nThis repository contains the official implementation of **CKA-Agent**, a novel approach to bypassing the guardrails of commercial large language models (LLMs) through **harmless prompt weaving** and **adaptive tree search** techniques. \n\n![CKA-Agent](./assets/comparsion.png)\n\n\n## Environment Setup\nInstall uv\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\nCreate env\n```bash\nuv venv --python 3.12\nsource .venv/bin/activate\nuv pip install vllm --torch-backend=auto\nuv pip install accelerate fastchat nltk pandas google-genai httpx[socks] anthropic\n```\n\n## Experiment Configuration\n\nConfigure your experiments by modifying the `config/config.yml` file. You can control the following aspects:\n\n1.  **Test Dataset**: Choose from available datasets like `harmbench_cka` or `strongreject_cka`.\n2.  **Target Models**: Select black-box or white-box models such as `gpt-oss-120b` or `gemini-2.5-xxx`.\n3.  **Jailbreak Methods**: Enable and configure various implemented baseline methods.\n4.  **Evaluations**: Define evaluation metrics and judge models like `gemini-2.5-flash`.\n5.  **Defense Methods**: Apply different defense mechanisms as needed.\n\nFor detailed configuration instructions and examples, please refer to the [configuration README](config/README.md).\n\n### Running Experiments\n\nThe `run_experiment.sh` script executes `main.py` to run the entire experiment pipeline (jailbreak and evaluation) by default.\n\n```bash\n./run_experiment.sh\n```\n\nYou can modify the `run_experiment.sh` script or directly pass arguments to `main.py` to run specific phases:\n\n-   `full`: Runs the entire pipeline (default).\n-   `jailbreak`: Runs only the jailbreak methods.\n-   `judge`: Runs only the evaluation on existing results.\n-   `resume`: Resumes an interrupted experiment.\n\n**Example (running only the jailbreak phase):**\n```bash\npython main.py --phase jailbreak\n```\n\n\n## Cite\nIf you find this repository useful for your research, please consider citing the following paper:\n\n```bibtex\n@misc{wei2025trojan,\n      title={The Trojan Knowledge: Bypassing Commercial LLM Guardrails via Harmless Prompt Weaving and Adaptive Tree Search}, \n      author={Rongzhe Wei and Peizhi Niu and Xinjie Shen and Tony Tu and Yifan Li and Ruihan Wu and Eli Chien and Pin-Yu Chen and Olgica Milenkovic and Pan Li},\n      year={2025},\n      eprint={2512.01353},\n      archivePrefix={arXiv},\n      primaryClass={cs.CR},\n      url={https://arxiv.org/abs/2512.01353}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fcka-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraph-com%2Fcka-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fcka-agent/lists"}