Blog
hedwigaihedwigaihedwigai

How it works

How AI harnesses work, shown on one research workbook

A language model only writes text. Everything that turns that text into work, like looking something up, saving a draft, stopping when it is done or asking a person before it does something risky, is done by the program around the model. That program is the harness.

hedwigAI’s MCP server gives the agent you already use (Claude, ChatGPT, Cursor or any other MCP client) a harness built for one job: drafting a spreadsheet or a Word document from primary sources, and keeping it current. You call it with tools such as create_workbook, read_workbook and update_workbook. Behind those tools, a run does the research with its own harness.

Below are the six terms you need, each shown on one real workbook from our own account: early-stage US AI companies that filed an SEC Form D in the last 30 days, researched on 28 September 2026.

The two runs that wrote the workbook, as the workbook records them
First run (version 1)After review (version 4)
Model calls112120
Wall clock12 min 39 s11 min 50 s
Prompt tokens4,774,8126,165,991
Prompt tokens per call42,63251,383
Tokens written12,63814,485
Companies kept, each cited to its Form D77
Corrections a person asked for afterwards13—

Term 1 of 6

The agent loop

The harness runs the loop: it calls the model, carries out the tools the model asks for, hands back the results, and calls the model again. It stops when the work is done, when a person is needed, or when a limit is reached.

One sentence started this workbook. From there the run went round its loop 112 times in 12 min 39 s, against a limit of 40 minutes. Your agent does not have to wait through that: update_workbook answers at once with a run id, and stop_run ends a run early.

create_workbook({
  instruction: "Early-stage AI companies in the US that filed a Form D in the last 30 days.",
  folder: "Sales/Funds"
})

Term 2 of 6

Tool calling

The model asks for an action by naming a tool and its arguments. The harness checks the request, runs it and returns the result, and the model writes with that result in front of it.

There are two levels here. Your agent calls hedwigAI’s MCP tools, 33 of them, from list_workbooks to link_workbook. Inside the run, the model calls data programs in a shell. Every company in this workbook came from one such call, and the call is written into the document next to what it found:

$ funding search "Meadow AI"
  SEC Form D accession 0002156007-26-000002, filed 2026-09-25
$ ucc search "Meadow AI"
  searched CO, CT; 0 active filings found

Term 3 of 6

Context management

The model sees only what the harness puts in front of it: your instructions, the conversation so far and the tool results. When that fills the window, older material is compacted, and the harness decides what is kept.

The first run read 4,774,812 prompt tokens across 112 calls, about 42,632 a call. It could not have held the whole run at once, so it compacts as it goes. What it can never lose is the draft itself, which lives in a file and not in the conversation.

Your agent has the same problem with a finished workbook, and the tools are built for it. list_sections with a few words returns only the sections they are about, and an address for that set. get_sections reads just those. pick_table returns one table as rows and columns. Your agent never has to load a 20-page document to change one figure.

list_sections({ workbook, prompt: "OpsMate AI and Perceptiq profiles" })
  → address "72e736f3b8db2e1f591109d5"
    Companies › Company Profiles › OpsMate AI, Inc.   0.92
    Companies › Company Profiles › Perceptiq Inc.     0.90
get_sections({ address: "72e736f3b8db2e1f591109d5" })

Term 4 of 6

Checkpointing

A harness saves the state of the work outside the model, so that an interruption costs nothing and a bad step can be undone.

In a workbook every write is a new version, and the one before is kept. This workbook has four. Version 2 came from a correction list pasted in starting at item 5. The run wrote nothing new and finished in 10 seconds. Version 3 restored version 1, and version 4 is the full correction run. Nothing was lost along the way.

Two rules stop work being overwritten. write_workbook and commit_workbook take the base_version you read, and are refused if the workbook has moved since. A run stopped halfway keeps what it had written as a new, unfinished version.

Term 5 of 6

Permissions and sandboxing

The harness sets what the agent can touch, meaning which tools, files and actions it may use, and where code runs.

A run’s shell can read your connected drives and the data programs, and can write only to its own /tmp. No tool deletes a workbook: removing a folder moves its workbooks up a level.

Every tool tells your MCP client what it does before it runs. Reading tools are marked read-only. The tools that start a billed run, which are create_workbook from a sentence, update_workbook and answer_question, are marked as reaching the open web, so a client that asks before such calls will ask you.

Term 6 of 6

Guardrails, and what they miss

A harness can check inputs, outputs and tool requests, and can pause for a person to approve a step. These checks still miss errors, and this workbook shows that.

Every company in version 1 was real and cited to its own Form D. A person reading it against the filings still found 13 things to fix:

  • The summary said all seven companies had raised equity. Three had raised through SAFEs, and one through revenue participation interests, which are not equity.
  • One filing was under Rule 506(c), not 506(b).
  • Investor counts were wrong in four of the seven filings.
  • Business descriptions had been cited to a form that gives only an industry group.

Version 4 made each fix as its own cited change, and lowered the confidence of every row it touched. No automatic check caught these errors. A person did.

What the harness does do is notice when the world moves. recheck_sources re-reads every source the document cites, and a workbook whose source has changed is marked stale. It then asks one question, and answer_question takes a person’s yes or no before anything is rewritten. The answer is kept, so the same question is never asked twice.

Drafting the .xlsx or .docx itself

Research usually ends in a file someone opens in Excel or Word, and the harness edits that file rather than a copy of it. checkout_workbook puts the workbook in your agent’s shell. For a spreadsheet that means current.xlsx, which the xlsx program edits the way Excel does, recalculating every formula on save. commit_workbook saves it as the next version.

link_workbook goes further and makes a file in Google Drive or Dropbox the document of record. Every run starts from the file as it stands, including edits someone made in Excel since, and writes back over it in place. A spreadsheet keeps its formulas, formats and untouched sheets. A Word document keeps its styles, headers and footers.

A spreadsheet workbook, edited from your agent. The sheet and cell names here are only an example.

checkout_workbook({ workbook })
$ xlsx current.xlsx insert-rows Companies 9 + set Companies!A9 "Perceptiq Inc."
$ xlsx current.xlsx errors
commit_workbook({ workbook, base_version, note: "Added Perceptiq from its Form D" })

Try it on your own question

Add hedwigAI to your MCP client from mcp.hedwigai.com, or sign in with a work email and start a workbook from one sentence. Writing a workbook yourself with create_workbook or write_workbook costs nothing. Only runs are billed.

  • Figures are what read_workbook reports for the workbook: model calls, prompt and completion tokens and wall clock for each run, and its list of versions. Both runs were started on 28 September 2026.
  • UCC lien searches covered Colorado and Connecticut only. All seven companies are Delaware corporations, and Delaware was not searched. The workbook says so.

More head-to-head evals

Leads with a reason to write: hedwigai ask, Apollo and treg on one brief40 leads each, every one checked: the right person, an inbox that accepts, and a dated reason to write.
MeasureaskApollotreg
Usable leads13 of 407 of 406 of 28
Cost per usable lead$0.037$0.27$0.23
Read the comparison
Self-hosted decisions for ask: Perplexity's open Decider in place of jev on 92 company questionsThe decisions inside hedwigai ask made by Perplexity's open Decider on two NVIDIA RTX 3090s, against jev.
Measureask with jevask with Decider
Questions right, of 928989
Wrong answers12
Read the comparison
Clinical decisions: jev and ask on System One, PubMedQA, SciFact and a 370-decision setEdgeEvals' System One board, PubMedQA, SciFact, and a clinical set built to System One's rules.
Measurejevask
Our 370 clinical decisions, right94.6%93.0%
PubMedQA, right (best EdgeEvals scored: 62.2%)77.0%74.4%
Read the comparison
Executive lookup for US-listed companies: Claude Opus 5.5 and ask on 95 questionsWho runs a public company, and how to email them: a frontier model from memory against hedwigai ask.
MeasureaskClaude Opus 5.5
Questions right, of 955963
Small companies right, of 20139
Read the comparison
Rental comps: floor-plan rents and amenities on 14 listings, five assistants comparedRent per floor plan and amenities for US rentals: hedwigai realestate-us against Claude, GPT, Gemini and Perplexity with web search.
Measurerealestate-usBest of four assistants
Floor-plan rents right, of 262623
Amenities claimed the listing doesn't state12129
Read the comparison
Company screening from SEC filings: jev, Vela 2.0 and ask on 92 yes/no questionsYes-or-no questions about public companies, answered by two decision models alone and by hedwigai ask.
Measureaskjev
Right, of the questions answered98%79%
Wrong answers, of 92219
Read the comparison
Defect localization in industrial images: four frontier models and a trained localizerFour frontier models asked to put a box around what they just described.
MeasureTrained localiserBest of four frontier models
Mean overlap with the defect (IoU, 0 to 1)0.4210.109
Read the comparison