SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.10198 · 2024

From Allies to Adversaries: Manipulating LLM Tool-Calling through Adversarial Injection

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2412.10198.json · badge: /api/ran/2412.10198.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
anonymous-lgtm/toolcommander canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
clear_cache_decorator Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/utils.py
code served (permissive licence) · get_code("63c9d2322eee62a3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import gc

torch.manual_seed(0)

def clear_cache():
    import gc
    gc.collect()

def clear_cache_decorator(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        clear_cache()
        return result
    return wrapper

# Create a simple function to decorate
def sample_function(x, y=10):
    """A simple function that performs some computation."""
    result = x + y
    return result

# Decorate the function
decorated_func = clear_cache_decorator(sample_function)

# Define ARGS - the function takes a single parameter 'func' which should be a callable
ARGS = {
    'func': sample_function
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
data_dict_to_idxs Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/evaluate.py
code served (permissive licence) · get_code("26a671465d6d3f16")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

ARGS = {
    'data_dict': {
        'asr_detail': {
            'item_0': {
                'retrieved': True,
                'called': True,
                'finished': True,
                'attack_target': 'dos',
                'dos': True,
                'utc': False
            },
            'item_1': {
                'retrieved': False,
                'called': True,
                'finished': False,
                'attack_target': 'utc',
                'dos': False,
                'utc': True
            },
            'item_2': {
                'retrieved': True,
                'called': False,
                'attack_target': 'dos',
                'dos': False
            }
        }
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_eat_other_response Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/utils.py
code served (permissive licence) · get_code("09dbda0cade0d1b2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'another': 'search'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_tool_json Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/toolbench.py
code served (permissive licence) · get_code("78c303cdd20b9bc3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import os
import tempfile
import shutil

# Create a temporary directory structure with test JSON files
temp_dir = tempfile.mkdtemp()

# Create category subdirectory
category_dir = os.path.join(temp_dir, "tools")
os.makedirs(category_dir, exist_ok=True)

# Create a sample JSON file for testing
test_json_content = {
    "name": "test_tool",
    "version": "1.0",
    "description": "A test tool"
}

json_filename = os.path.join(category_dir, "my_tool.json")
with open(json_filename, 'w') as f:
    json.dump(test_json_content, f)

# Define ARGS with parameters for load_tool_json
ARGS = {
    "tool_root_dir": temp_dir,
    "category": "tools",
    "tool_name": "my_tool"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
loss_calculator_wrapper Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/utils.py
code served (permissive licence) · get_code("e639e9c332c5469a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function loss_calculator_wrapper takes a target tensor
# Looking at the body:
# - target is used with .repeat([embedding.shape[0], 1])
# - This means target should be a 1D or 2D tensor
# - embedding.shape[0] is the batch dimension
# - The repeat suggests target has shape [1, dim] or similar
# - current_target becomes [embedding.shape[0], dim]

# Create a small target tensor for the embedding dimension
# Using dim=4 as specified, and making it 2D with shape [1, 4]
target = torch.randn(1, 4)

ARGS = {
    "target": target
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
standardize Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/toolbench.py
pointer only (licence: MIT); the stored copy get_code serves, from OceannTwT/Tool-Planner, is pointer only (licence: NONE) · get_code("e6d1b09cb3624d3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from OceannTwT/Tool-Planner, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

standardize_category Ran
ran; our contract draft was wrong, not the code
anonymous-lgtm/toolcommander/toolbench.py
pointer only (licence: MIT); the stored copy get_code serves, from lkutschka/notation-matters, is pointer only (licence: NOASSERTION) · get_code("04eed77ef8a3068b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lkutschka/notation-matters, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

generate_batch_oai Not yet run
unverified (harvested, no recorded run)
anonymous-lgtm/toolcommander/llm.py
code served (permissive licence) · get_code("7b2d4c6e3c00ff7e")
How it ran

no invocation recorded.

token_gradients Not yet run
unverified (harvested, no recorded run)
anonymous-lgtm/toolcommander/mcg.py
code served (permissive licence) · get_code("01aca5c155fa5652")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
standardize 4 other papers
3 dated earlier, 1 later
2403.07714 (2024-03)
StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Models
2406.03807 (2024-06)
Tool-Planner: Task Planning with Clusters across Multiple Tools
2410.08197 (2024-10)
From Exploration to Mastery: Enabling LLMs to Master Tools via Self-Driven Interactions
and 1 more not named here
standardize_category 2 other papers
1 dated earlier, 1 later
2403.07714 (2024-03)
StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Models
2605.29676 (2026-05)
Notation Matters: A Benchmark Study of Token-Optimized Formats in Agentic AI Systems

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Tool-calling has changed Large Language Model (LLM) applications by integrating external tools, significantly enhancing their functionality across diverse tasks. However, this integration also introduces new security vulnerabilities, particularly in the tool scheduling mechanisms of LLM, which have not been extensively studied. To fill this gap, we present ToolCommander, a novel framework designed to exploit vulnerabilities in LLM tool-calling systems through adversarial tool injection. Our framework employs a well-designed two-stage attack strategy. Firstly, it injects malicious tools to collect user queries, then dynamically updates the injected tools based on the stolen information to enhance subsequent attacks. These stages enable ToolCommander to execute privacy theft, launch denial-of-service attacks, and even manipulate business competition by triggering unscheduled tool-calling. Notably, the ASR reaches 91.67% for privacy theft and hits 100% for denial-of-service and unscheduled tool calling in certain cases. Our work demonstrates that these vulnerabilities can lead to severe consequences beyond simple misuse of tool-calling systems, underscoring the urgent need for robust defensive strategies to secure LLM Tool-calling systems.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2412.10198")
get_code_for_paper("2412.10198")
have("2412.10198")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2412.10198.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2412.10198.svg)](https://syntology.ai/paper/2412.10198)

Connect an agent — have() is free.