{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/the-dark-side-of-function-calling-pathways-to","title":"The Dark Side of Function Calling: Pathways to Jailbreaking Large Language Models","arxiv_id":"2407.17915","date":"2024-07-25","proceeding":null,"authors":["Zihui Wu","Haichang Gao","Jianping He","Ping Wang"],"abstract":"Large language models (LLMs) have demonstrated remarkable capabilities, but their power comes with significant security considerations. While extensive research has been conducted on the safety of LLMs in chat mode, the security implications of their function calling feature have been largely overlooked. This paper uncovers a critical vulnerability in the function calling process of LLMs, introducing a novel \"jailbreak function\" attack method that exploits alignment discrepancies, user coercion, and the absence of rigorous safety filters. Our empirical study, conducted on six state-of-the-art LLMs including GPT-4o, Claude-3.5-Sonnet, and Gemini-1.5-pro, reveals an alarming average success rate of over 90\\% for this attack. We provide a comprehensive analysis of why function calls are susceptible to such attacks and propose defensive strategies, including the use of defensive prompts. Our findings highlight the urgent need for enhanced security measures in the function calling capabilities of LLMs, contributing to the field of AI safety by identifying a previously unexplored risk, designing an effective attack method, and suggesting practical defensive measures. Our code is available at https://github.com/wooozihui/jailbreakfunction.","url_abs":"https://arxiv.org/abs/2407.17915v4","url_pdf":"https://arxiv.org/pdf/2407.17915v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"the-dark-side-of-function-calling-pathways-to","repo_url":"https://github.com/wooozihui/jailbreakfunction","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.17915","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.17915"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wooozihui/jailbreakfunction","reach":{"status":"ok"}}],"summary":{"ran":4,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"35ddaed528ecc1f3","entry":"harmful_classification","repo":"wooozihui/jailbreakfunction","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/wooozihui/jailbreakfunction/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"35ddaed528ecc1f3"}},{"code_sha256_prefix":"a8f7b0b99d7605e8","entry":"jailbreak_function_consturct","repo":"wooozihui/jailbreakfunction","repo_kind":"official","path":"attack.py","file_url":"https://github.com/wooozihui/jailbreakfunction/blob/HEAD/attack.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a8f7b0b99d7605e8"}},{"code_sha256_prefix":"e03301608c29586f","entry":"parse_json_and_convert_list","repo":"wooozihui/jailbreakfunction","repo_kind":"official","path":"utils.py","file_url":"https://github.com/wooozihui/jailbreakfunction/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e03301608c29586f"}},{"code_sha256_prefix":"5f6380c3e6245d3d","entry":"remove_tag","repo":"wooozihui/jailbreakfunction","repo_kind":"official","path":"utils.py","file_url":"https://github.com/wooozihui/jailbreakfunction/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5f6380c3e6245d3d"}},{"code_sha256_prefix":"ef00ac3e546a1e38","entry":"get_content_type","repo":"wooozihui/jailbreakfunction","repo_kind":"official","path":"utils.py","file_url":"https://github.com/wooozihui/jailbreakfunction/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ef00ac3e546a1e38"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}