A Data-Isolated Agent Harness for Analytical Workflows

Fredrik A. DahlarXiv 2026

TL;DR

How do you let a cloud-hosted LLM build complex data analyses when your actual data is far too sensitive to ever leave your local machine? This paper introduces an "agent harness" where AI models design and debug analytical workflows against an empty database shell, which the local system then freezes into a static, model-free pipeline to run safely on private records. It gives you the reasoning power of frontier models with zero risk of leaking rows, results, or execution errors to an external server.

What Problem Does This Paper Address?

Imagine you are working with sensitive medical records or proprietary financial tables. You would love to have a frontier LLM write your SQL queries, chain together analysis tools, and format reports. However, sending private records—or even the intermediate results and error logs—to an external API violates data privacy. Hosting open-weights models locally avoids the data leak, but requires serious GPU infrastructure and locks you out of the most capable commercial models.

The core challenge is figuring out how to use externally hosted LLMs to construct and debug multi-step data workflows without the models ever seeing a single row of private data.

Methods

The author designs a local software coordinator—the agent harness—that enforces a strict wall between constructing a procedure and executing it. Tools are exposed via the standard Model Context Protocol (MCP), and domain rules are supplied as written instructions called "Skills."

Figure 1. Pipeline development (above the dashed line) and routine replay (below). Rounded boxes denote activities, with colour identifying the actor; document and cylinder shapes denote information artifacts and databases. The MCP tools read the database and read and write the workspace in each context. The pipeline includes the canonical task and the executable procedure. Development-time replay and host acceptance of revisions are omitted for clarity.

Instead of one free-wheeling agent, the harness splits LLM duties into three distinct roles (all using OpenAI’s gpt-6.2-sol in the case studies):

  • LLM1 (Task Specifier): Chats with the user to turn a vague request into a precise "canonical task" complete with typed parameters (like date ranges or player names).
  • LLM2 (Workflow Explorer): Builds the pipeline by calling MCP tools one by one against an empty database built only from approved table schemas. Even with zero rows, queries still return column names and types, letting LLM2 catch syntax errors, check tool interfaces, and abandon dead-end approaches.
  • Freezing & Model-Free Replay: Once LLM2 stages the final outputs, the local host traces the dependency graph backward ($K = R \cup \text{ancestors}(R)$), discarding failed or unused tool calls. It locks the surviving steps into a YAML pipeline. When run on the real private database, no LLMs are called—even reporting, exporting, and error handling are purely local and deterministic.
  • LLM3 (Local Editor): If you want a minor tweak (like stripping quotation marks or changing a default threshold), re-running LLM2 might accidentally rewrite the whole query logic. Instead, LLM3 edits the YAML pipeline directly without tool or data access, making the smallest possible change.

Datasets

No datasets were used to train models. To evaluate the generic harness without risking real institutional secrets, the author built a case study in chess—a domain with rich relational complexity (linking game metadata, move sequences, and engine evaluations) and low privacy stakes. Both test applications run against a private SQLite collection of the author's own chess games, containing game metadata, standard algebraic notation (SAN) moves, position features, and stored Stockfish centipawn evaluations. No new public benchmarks were introduced.

Key Insights and Ideas

  • Empty schemas still give rich compiler-like feedback: You don't need mock or anonymized data for an agent to debug a workflow. Propagating empty, typed tables through MCP tools is enough for LLM2 to verify column names, data types, and symbolic references between steps.
  • Straight-line pipelines can still do dynamic work: The frozen pipeline has no if statements or loops at the orchestration level, making it dead simple to inspect. Yet it remains flexible because data-dependent logic happens inside SQL and the tools—for instance, dynamically generating $N$ move columns based on a user parameter.
  • Surgical edits need a separate role: Separating discovery (LLM2) from minor revision (LLM3) prevents the classic LLM annoyance where asking for a tiny formatting tweak causes the model to silently alter your underlying statistical definitions.

Key Results

The author demonstrated the harness on two distinct analytical workflows:

  1. Statistical Aggregation (Pawn Endings): Asked to stratify game outcomes by the engine evaluation of the first pawn-only endgame position reached, the harness produced a 3-step pipeline. Local replay identified 745 qualifying games across three strata, showing mean scores rising from 0.113 in "worse" positions to 0.971 in "better" positions.
  2. Dataset Preparation & Pruning: Asked to build an anonymized blitz dataset with $N=10$ opening half-moves, LLM2 made 14 tool calls against the empty database (hitting 3 SQL errors and 1 unused preview). The freezing step cleanly pruned this messy trace down to a 10-step executable pipeline, exporting 3,064 rows and 15 columns.
  3. Surgical Revision & Parameterized Replay: When SAN moves showed up with unwanted quotes (e.g., "Nc3"), LLM3 updated a single trim expression while leaving the other 9 steps untouched. Re-running that exact pipeline locally with new parameters (start_date="1. jan 2025", ply_count=4) required zero LLM calls and output a reshaped table of 1,158 rows and 9 columns:
Summary of rows and columns produced across initial run, LLM3 revision, and parameterized replay.

Limitations and Future Work

  • Logic bugs hide in empty tables: An empty database catches syntax and type mismatches, not semantic traps—like a bad SQL JOIN that silently multiplies rows once real data flows through. Small public test datasets with known answers are still needed to validate analytical logic.
  • Human-in-the-loop side channels: The system does not guarantee formal cryptographic noninterference. Because the human analyst sees the private results, they could inadvertently leak sensitive insights back to the external LLM in follow-up prompts.
  • Scope of evidence: The paper demonstrates feasibility through two case studies in a single domain rather than measuring success rates across hundreds of tasks. Future work includes benchmarking this harness directly against asking a baseline LLM to simply write a standalone Python or SQL script from the same schema descriptions, alongside a planned open-source GitHub release.

Summary updated

BibTeX
@misc{dahl2026data,
  author = {Fredrik A. Dahl},
  title = {{A Data-Isolated Agent Harness for Analytical Workflows}},
  year = {2026},
  eprint = {2611.39978},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.39978},
}
Figure