Skip to content
senn-techsenn-tech
Back to blog
OpenAIAI & Development
AI in production2026-12-03· By Franz Senn

Microsoft FreeHand: an agent harness with a single bash tool

In early December 2026 Microsoft published FreeHand, a coding agent that promises very little: a system prompt of just over 200 words, measured 202 in version 0.1.1, and a single tool (bash), and a meter that shows the model after every step how much context, time and money it has spent. The team removed the sandbox, the approval prompts and the tool selection, so the model makes those decisions. The authors report best scores on five benchmarks against the providers' own first tools, and they add that with smaller models the first-party harnesses win again. On 3 December 2026 we ran freehand-ai 0.1.1 in a throwaway container against our own gateway: one small programming task was fixed after 6 rounds and the test was green.

An agent harness is the program around a language model that builds the working loop. It sends the conversation to the model, runs the tools the model asks for, writes the results back and decides what stays in the context for the next round. Claude Code, Codex CLI and Gemini CLI are harnesses built by the model providers. FreeHand is the extreme case, because it hands those decisions to the model.

Microsoft wordmark
FreeHand sits in the GitHub organisation microsoft/FreeHand under the MIT licence. The publisher is Microsoft Research (AgentOpt series), measured on 3 December 2026. (source: Wikimedia Commons, file Microsoft logo (2012).svg, Public domain (trademark: Microsoft))

What FreeHand leaves to the model

The README compares FreeHand with a typical coding harness and lists the differences. The left column is the authors' statement about a typical harness, the right column is what we counted in the source of version 0.1.1. The sandbox and cost rows are not part of that comparison in the README; they are our own summary from the documentation and the source.

MechanismThe authors' figure for a typical harnessWhat we counted in 0.1.1
System promptdetailed instructions; counted in the paper for OpenCode: 1,492 words202 words in src/freehand/prompt.md
ToolsREADME: "20+ preset tools"; counted in the paper for OpenCode: 101: the list in runtime/agent.py contains only bash
Context managementautomatic compaction, usually onthe model decides, compaction off by default
Sandbox and approvalssandbox, asks before dangerneither exists, the environment is the boundary
Costan estimatemeter with context, tokens, cost and time after every step

Before the task starts, the model sees about 350 tokens and one tool, according to the authors. That is the whole load. Everything an agent normally does, the model has to build itself with shell commands: read and change files, run tests, search, look up documentation. The meter after each step shows the bill: context in tokens, input and output with the cached share, cost, elapsed time. Auto-compaction, which summarises the history, is switched off and has to be enabled explicitly.

The run in FreeHand, step by stepPrompt and one tool202-word system prompt, onebash toolModel sends a commandbash -lc in the workdirRun and report backstdout, stderr and exit codeinto the logShow the metercontext, tokens with cachedshare, cost, timeModel decidesnext round, tidy thecontext, or finish
(source: README and source code of FreeHand, state of 3 December 2026)

The reason for the cut is harness measurements we wrote about in November: Coding agent harnesses compared. Their finding was that the harness drives token costs up without making the solution better. FreeHand is that finding turned into a program, see also our note Study: the harness drives token costs up to three times higher.

What the authors report, and what they add themselves

The FreeHand paper (arXiv 2612.02442, submitted 1 December 2026, 31 pages) and the README name results on five benchmarks: Terminal-Bench 4, Terminal-Bench Science, Agents' Last Exam, OSWorld 2.1 and AutomationBench. These numbers are the authors' statements, we did not re-measure them.

Terminal-Bench 4: score per model, the authors' figuresFreeHand · GPT-6-astra57.1Codex · GPT-6-astra54.6FreeHand · Claude Opus 5.561.9Claude Code · Opus 5.554.9FreeHand · Gemini 4 Carbon57.1Gemini CLI · Gemini 4 Carbon49.5070
Score in percent, rounded means over the authors' runs. Recalculated over all eleven rows of the README table: on average 62.7 versus 57.6 points, a gap of 5.1 points, and 3.73 versus 7.34 US dollars in cost, 49 percent less. That is arithmetic on their numbers, not our benchmark. (source: README and arXiv 2612.02442, the authors' figures, retrieved 3 December 2026)

Across all eleven rows of the README table (five benchmarks, one frontier model per row) the team reports a lead of 5.1 points at 49 percent lower cost against the provider's first tool. In a controlled side-by-side run on the same machines and API endpoints, the other harnesses ran 17 to 62 percent longer.

The limit stands in the same documents. With smaller models the picture flips on Terminal-Bench 4:

ModelThe authors' free toolThe provider's first tool
GPT-6 SolFreeHand 29.2 percentCodex 34.9 percent
Claude Sonnet 5.5FreeHand 34.9 percentClaude Code 41.6 percent
DeepSeek V4.1 FlashFreeHand 23.8 percentDeepSeek harness 28.9 percent

This is the most important sentence for any company working with rented or locally operated mid-range models. A minimal harness gets more out of a top model because it stays out of the way. It gets less out of a smaller model, because that model needs the structure a large harness supplies. Anyone planning FreeHand for daily work has to think along the model lane, and a lane running in-house is rarely the top of the market.

What our smoke test showed

At 19:12 UTC on 3 December 2026 we installed freehand-ai 0.1.1 from PyPI into a fresh python:3.12-slim container, with no host directories mounted, only one working directory with two files. The model was a locally hosted open-weights model behind an OpenAI-compatible endpoint of our gateway, provider openai-chat. The task was deliberately small: a two-line Python function for counting words also counted double spaces as words, and the supplied test failed.

MeasurementValueUnitMeasurement dateMeasurement carrier
Agent rounds6model calls3 Dec 2026container python:3.12-slim, freehand-ai 0.1.1
Commands run5bash calls3 Dec 2026session log log/outputs/
Context at the end2106tokens3 Dec 2026meter line of the last round
Input total9695tokens, 0 percent cache3 Dec 2026session metadata .state/meta.json
Output total526tokens, of which 101 thinking tokens3 Dec 2026session metadata .state/meta.json
Result1test passed (pytest)3 Dec 2026python -m pytest in the container

The agent read the files, changed the function to text.split(), installed pytest over the network and started the test: one test passed. A second, independent run on the same day ended after the same task at 1.7K context, 5.8K input and 333 output tokens, so in the same order of magnitude. One run, one task, no quality verdict about models: the test proves the pipeline, not the quality.

Two observations about the meter are useful for operations. The cost line stayed empty with us, because FreeHand takes prices from its own list and our self-hosted model is not in it. And the cached share stayed at 0 percent the whole time, because our endpoint does not pass on the provider's cache acknowledgement. Anyone who wants to use the meter as a control element needs an endpoint that reports both, a price list for the own models, and prompt caching on the provider.

The boundary: the environment is the sandbox

FreeHand has no sandbox and no prompt before dangerous commands. The documentation says it in one sentence: commands run with the rights and the environment you started FreeHand with, no confirmation. A look in the source of version 0.1.1 confirms both:

  • Environment variables are passed on, API keys included. The exclusion list (*KEY*, *SECRET*, *TOKEN*) sits in the code but is ignored by default. It can be switched on through shell_environment_policy with ignore_default_excludes: false, and then the keys drop out.
  • The undo step /undo restores files from snapshots and is explicitly not a backup. Files above 1 MB, gitignored paths, node_modules, .venv and anything outside the project directory are not covered.
  • Sessions are stored as plain text under ~/.freehand/sessions/, the credentials under ~/.freehand/auth.json with rights 600.
  • The web interface is not built for remote access: it binds to 127.0.0.1 and requires a token.
  • We found no telemetry in the documentation. The named network targets are a favicon service for icons, the model list from models.dev for freehand models --sync, and the release check of the desktop surface at GitHub.
  • Native Windows does not exist yet, the README plans it. What remains is macOS, Linux and WSL2.

The documentation therefore recommends the container: own image, only the project directory mounted, no home directory, no ~/.ssh, no docker.sock. We tested exactly that way. On the machine where FreeHand runs, the container's rights apply afterwards, and anything the agent deletes lands in a throwaway environment.

Three open items, read on the retrieval date

On 3 December 2026 at 19:50 UTC the repository carried 32 open requests (issues and pull requests together), 1019 stars and 82 forks. We checked three findings from the open issues in the source of 0.1.1, because they affect daily work.

Undo can delete the git folder of an inner repository (issue #59, open on 3 December 2026). The reported case: if the working directory holds a second, independent git repository and its last commit changed during the round, snapshots.py calls shutil.rmtree on /undo. The folder itself stays, its git history and the files tracked in it are gone. The code confirms the mechanism: resetting a directory deletes the target with shutil.rmtree, and a directory with its own .git folder is just a directory for FreeHand.

A gateway with strict validation can block the session (issue #84, open on 3 December 2026). With providers using the chat completions interface, FreeHand writes tool answers into the protocol unchanged. If the gateway returns a 422 for that, it is not a repairable protocol error and the session stalls. Recovery, according to the code, only triggers on 400 and 200.

Without a user agent, some gateways block (issue #85, open on 3 December 2026). Requests to an OpenAI-compatible endpoint carry only Content-Type and Authorization, on OpenRouter a session id is added; the user agent stays on the Python default. Protection services in front of them with a browser check answer with 403. The MCP client in the same project does send a user agent, the provider client does not.

For operations that means: a gateway on site that accepts list-form answers in tool messages is the condition. We did not reproduce the three cases, we verified the described mechanism in the code.

What this means for operations

FreeHand suits an experiment and does not currently suit a replacement for the coding agent you already run. For the experiment the documented path is enough: throwaway container, project folder in, nothing from the host mounted, model over the OpenAI-compatible endpoint, keys in a separate environment, key exclusion list on. Then measure the two things the meter shows: context per task and time per task, against the current tool.

Three things argue against a replacement right now. The source has been public since 2 December 2026, the two preview releases on GitHub came only on 3 December, PyPI lists an alpha classifier, and the open findings above are data-loss and stall cases. Second, the benefit depends on the model lane, the authors' own numbers flip with smaller models, and most companies compute with those. Third, native Windows is missing and a sandbox is missing on purpose, and those two together do not fit a company that runs agents on working machines.

The interesting part is the architecture decision. A harness that shows the model its context and otherwise prescribes nothing is a clean measuring instrument: if an agent with 350 tokens of lead-in and one tool does the same work as one with the usual lead-in of the big harnesses, the lead-in was cost and not capability. That is the question you can now recalculate, with your own model and your own tasks. Anyone running their own AI pipeline will find the use there: Own AI stack: LiteLLM and vLLM on site. For the question of which harness fits which lane in operation, our posts in the topic AI in production are the starting point, and anyone who wants to check the setup can book the run through our services.

Further sources

Questions?
What is an agent harness?+

The program around a language model that builds the working loop: it sends the conversation to the model, runs the commands the model asks for, writes the results back and picks what stays in context for the next round. Claude Code, Codex CLI and Gemini CLI are harnesses from the model providers, and FreeHand is the extreme case among them.

Is FreeHand the same software as Microsoft Copilot or GitHub Copilot?+

No. FreeHand lives in the GitHub organisation microsoft/FreeHand under the MIT licence, with no Copilot account and no Microsoft cloud requirement. It runs on your own machine and talks to model providers through their APIs. On 3 December 2026 the PyPI package stood at version 0.1.1 (0.1.0 there since 2 December); GitHub carried two preview releases on the same day, alpha status.

Can I point FreeHand at my own gateway on site?+

Yes, through the openai-chat provider, which addresses any OpenAI-compatible chat completions endpoint. We did that on 3 December 2026 against a locally hosted open-weights model behind our gateway, and the run finished in 6 rounds. Two things stood out: the cost line stayed empty, because FreeHand takes prices from a built-in list and our model is not in it, and the cached share stayed at 0 percent because our endpoint does not report it.