InData: Towards Secure Multi-Step, Tool-Based Data Analysis

Karthikeyan K, Raghuveer Thirukovalluru, Bhuwan Dhingra, David Edwin CarlsonarXiv 2025 · DOI

Standard Large Language Model (LLM) data analysis typically involves the model generating Python or SQL code to be executed directly on a database. While effective, this approach introduces significant security and privacy risks. For instance, transmitting sensitive medical or financial records to external LLM providers can lead to data leaks. Conversely, executing LLM-generated code locally risks data corruption or the unintentional running of malicious scripts.

The InData Framework

To mitigate these risks, researchers have proposed Indirect Data Engagement (InData). In this model, the LLM is prohibited from viewing raw data or writing arbitrary code. Instead, it must interact with the data through a vetted "secure barrier" consisting of predefined, atomic tools such as get_mean or filter_rows.

The InData paradigm: LLMs interact with sensitive data through a secure barrier of predefined tools.

The framework employs an agentic loop:

  1. Observation: The LLM receives a query and a library of 100 tool descriptions.
  2. Action: The LLM selects and calls a single tool.
  3. Execution: A secure local environment runs the tool. If a new dataset is created, the LLM receives only the filename, keeping the underlying data hidden.
  4. Iteration: The LLM uses the tool's output to inform its next action, repeating the process until a final answer is reached or a turn limit is exceeded.

The InData Dataset

The study introduces a comprehensive benchmark to evaluate this paradigm, featuring:

  • 114 Tabular Datasets: Sourced from Kaggle across diverse domains.
  • 100 Predefined Tools: Atomic functions for data manipulation and reporting.
  • 2,063 Questions: Categorized by difficulty based on the number of sequential tool calls required: Easy (<5), Medium (5–10), and Hard (>15).
  • Hard+: A robust test set featuring minor syntactical perturbations to column names (e.g., changing patient_id to patient id) to test model robustness.

Results and Key Insights

The benchmarking of 15 open-source LLMs (ranging from 0.6B to 120B parameters) revealed a significant "reasoning gap." While top-tier models perform well on simple tool selection, their accuracy drops sharply when complex, multi-step composition is required.

Performance comparison between direct Python code generation and multi-step tool calling across different model sizes and task difficulties.

Key findings include:

  • The "Reasoning Wall": As the number of required steps increases, models are more likely to hallucinate tools or lose logical coherence. The best-performing model, gpt-oss-120b, achieved 97.3% accuracy on Easy tasks but fell to 69.6% on Hard tasks.
  • Tool-Calling vs. Code-Generation: Even the most capable models performed significantly worse when restricted to tool calls compared to direct Python code generation (e.g., 94.0% vs. 69.6% on Hard tasks). This suggests that multi-step tool reasoning is a distinct and more challenging capability than standard code generation.
  • The Scale Cliff: Performance is heavily dependent on model size. Models under 20B parameters often failed to solve hard tasks entirely, with Qwen3-1.7B achieving only 7.5% accuracy on Hard questions.
  • Brittleness: Models are highly sensitive to surface-level variations. On the Hard+ set, minor changes to column names caused the top model's accuracy to drop from 69.6% to 61.0%.

Discussion and Future Work

The InData benchmark highlights that current LLMs struggle with long-chain tool composition. While providing logical "hints" (correct Python logic) can improve performance, the inherent lack of flexibility in a predefined toolset remains a challenge. Future research should explore dedicated "planning stages"—where the model writes a high-level plan before execution—and supervised fine-tuning specifically designed to enhance multi-step reasoning in secure, tool-based environments.

Summary updated

BibTeX
@misc{k2025indata,
  author = {Karthikeyan K and Raghuveer Thirukovalluru and Bhuwan Dhingra and David Edwin Carlson},
  title = {{InData: Towards Secure Multi-Step, Tool-Based Data Analysis}},
  year = {2025},
  eprint = {2511.11933},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.11933},
}
Figure