OPEN SOURCE DEEP DIVE
FreeHand: the harness that lets the model decide
Microsoft Research's open-source agent harness: a ~200-word descriptive prompt, one bash tool, a transcript the model edits itself, and a per-turn meter for context, cost and time. The authors report the highest score and lowest cost in all 11 settings (five benchmarks with three frontier models); with weaker models the order reverses. No sandbox, no approval prompt, alpha — run untrusted code in a container or VM.
What FreeHand Is
FreeHand (CLI name freehand, PyPI package freehand-ai) is an agent harness open-sourced by Microsoft Research under MIT, written mostly in Python, with the repository created on November 17, 2026 and currently labeled alpha. It ships with a paper, Freehand: The Bitter Lesson Comes to Agent Harnesses (arXiv:2612.02442), which reached #1 Paper of the Day and #2 Trending Paper on Hugging Face Daily Papers in December 2026. The project belongs to Microsoft Research's AgentOpt series — SkillLens, SkillOpt, Resource2Skill, EnvOpt and EvalOpt each tackle one part of an agent system; FreeHand tackles the runtime the model stands on.
The design fits in one sentence: give a frontier model a purely descriptive runtime description of about 200 words, one bash tool, a transcript it can edit itself, and a meter that reports context size, tokens, cost and elapsed time after every turn — then let the model decide everything else. The authors report that against Codex, Claude Code, Gemini CLI, OpenCode, Pi and DeepSeek Harness, across 11 settings (five benchmarks with three frontier model families), FreeHand scored highest and cost least in every one, with the shortest mean time per task. The same README states the flip side plainly: with weaker models the order reverses and traditional harnesses do better.
The Bitter Lesson, Applied to the Runtime Layer
The README's starting point is Sutton's Bitter Lesson: knowledge built into AI systems helps at first and is eventually outgrown by general methods. The authors move that claim from model weights to the harness. Mainstream harnesses decide a great deal before the model ever sees the task: long system prompts prescribe how to approach it, dozens of preset tools fix how to act, fixed timeouts fix how long commands run, and threshold-triggered compaction decides what stays in memory. For weaker models these presets are a crutch; for frontier models they become a cage. FreeHand keeps one rule: give the model a shell, its own memory, and a meter, and let it decide everything else.
The four decision points, translated from the README's table:
| Decision | Typical harness | FreeHand |
|---|---|---|
| How to approach the task (strategy) | Rules, workflows and reminders in a long system prompt | A purely descriptive runtime prompt, with no rules |
| What tools to use (execution) | Dozens of pre-designed tools | One bash tool, from which the model builds what the task needs |
| How long a command runs (execution) | Fixed timeouts and poll intervals | The model sets each command's timeout and can run jobs detached |
| What stays in context (memory) | Automatic compaction at a fixed threshold | The model manages its own context at runtime |
A 200-Word Prompt and One Bash Tool
The system prompt is src/freehand/prompt.md in the repository: seven lines. Before the task begins the model sees about 0.35K tokens and one tool. It opens like this:
You are a coding agent. You run inside a minimal framework: one loop that sends this conversation to you, executes the tools you call, and appends their results. Nothing else is decided for you. How you approach the task, how you use your context, and so on are all yours to manage. ...
Tool: bash.
Your editable context is stored in {transcript_path}. The framework writes it after every turn. You can edit it to remove, shorten or reorganize anything; if the file changes, your version is what gets sent next. ...
Note the wording: it describes what the framework does (send the conversation, execute tools, append results) and never prescribes how the model should work. The only asks are efficiency and accuracy, plus how to finish — a reply without a tool call ends the task, so that reply must say what was produced and where.
The single bash tool carries a few engineering details worth recording (from runtime/agent.py). Commands run as bash -lc in the configured workdir and return combined stdout+stderr with the exit code. The timeout is not a global constant: the model passes timeout_s per call, and the whole process group is killed when it expires. For long jobs the prompt teaches nohup CMD > LOG 2>&1 & and reading the log later. The tool schema also requires a description parameter — a clear, active-voice, plain-language account of what the command does, never an echo of the command text or file paths, because the human often reads only that description. Over-long tool output is truncated in the middle of the transcript, with the full text saved under log/outputs/. The loop has two hard stops: max_turns and max_cost_usd.
The Model Manages Its Own Context; the Meter Reports Every Turn
Context management is FreeHand's most distinctive move. The conversation transcript is a file the framework writes after every turn, and the model may edit it directly — remove, shorten or reorganize anything. If the file changes, the model's version is what gets sent next. To look at an image, it adds the image as an image part to the transcript and sees it on the next turn. This hands the question "what is worth remembering" back from the framework's compaction algorithm to the model.
After each turn the framework appends one status line (an example reading constructed in the source's format):
[harness] turn 12 | context 48,213 tokens | total in 312,450 (cached 287,900) out 18,320 | $2.41 | 14.6 min elapsed
Context size, cumulative input (with the cached share), output, cost and elapsed time are visible to the model every turn, so "how much budget is left" becomes an object it can reason about. The product turns this into a visible event as well: whenever the model shrinks its own context, the context bar in the terminal footer moves to a center stage and plays a "slam" animation (meter.py hard-codes a 30 fps keyframe plan), and a line stays in the activity log. Automatic compaction exists but is opt-in and off by default: when enabled it runs provider-neutral rolling summaries, keeps recent messages intact, and its summarization prompt explicitly says to summarize only what is present in the input and never invent file operations.
Results: A Clean Sweep Across 11 Settings — Frontier Models Only
The headline result in the README: five benchmarks (Terminal-Bench 4, Terminal-Bench Science, Agents' Last Exam, OSWorld 2.1, AutomationBench) with three frontier models (GPT-6-astra, Claude Opus 5.5, Gemini 4 Carbon), 11 settings in total. FreeHand had the highest score and the lowest cost in every one, and the shortest mean time per task. Against the first-party harnesses it scored 5.1 points higher at 49% lower cost; in a controlled side-by-side rerun on the same machines and API endpoints, each of the other harnesses took 17–62% longer. It also beat OpenCode, Pi, DeepSeek Harness and the bash-only mini-swe-agent. Averaged over the five benchmarks with GPT-6-astra and Claude Opus 5.5: best mean score 63.2%, lowest mean cost per task $3.23, fastest mean normalized time per task 31.7 minutes.
The per-setting numbers from the README table (score · cost per task):
| Benchmark | Model | FreeHand | First-party harness |
|---|---|---|---|
| Terminal-Bench 4 | GPT-6-astra | 57.1% · $3.12 | Codex 54.6% · $5.88 |
| Claude Opus 5.5 | 61.9% · $3.38 | Claude Code 54.9% · $4.91 | |
| Gemini 4 Carbon | 57.1% · $8.76 | Gemini CLI 49.5% · $13.72 | |
| Terminal-Bench Science | GPT-6-astra | 63.8% · $7.71 | Codex 58.1% · $12.99 |
| Claude Opus 5.5 | 55.2% · $8.16 | Claude Code 54.3% · $12.86 | |
| Agents' Last Exam | GPT-6-astra | 67.5% · $1.92 | Codex 63.6% · $4.45 |
| Claude Opus 5.5 | 66.5% · $1.16 | Claude Code 62.2% · $2.29 | |
| OSWorld 2.1 | GPT-6-astra | 76.2% · $3.96 | Codex 68.3% · $14.94 |
| Claude Opus 5.5 | 80.1% · $2.09 | Claude Code 74.9% · $7.49 | |
| AutomationBench | GPT-6-astra | 49.5% · $0.56 | Codex 44.8% · $0.89 |
| Claude Opus 5.5 | 54.4% · $0.19 | Claude Code 47.9% · $0.27 |
The reversal has numbers too. On Terminal-Bench 4 with lower-tier models, the first-party harness scores higher: GPT-6 Sol with Codex 34.9% vs. FreeHand 29.2%; Claude Sonnet 5.5 with Claude Code 41.6% vs. 34.9%; DeepSeek V4.1 Flash with DeepSeek Harness 28.9% vs. 23.8%. The authors' framing is direct: FreeHand is built for frontier models, and with a smaller model that model's first-party harness may serve you better. This is a boundary, not a footnote — "leave the decisions to the model" presupposes a model that makes them well.
The Human-Facing Side Is Complete
The model-facing side stays small on purpose; the human-facing side is fully built. Terminal, browser (freehand web) and the desktop app (beta) share the same sessions and settings, so a session started in one continues in another. Streaming Markdown, interrupt, session resume, per-turn undo, model switching mid-session, cost and context display, and export to a self-contained HTML page are all there. A few concrete mechanisms:
Skills use the Agent Skills format (agentskills.io): a directory with a SKILL.md opening with name and description, placed in ~/.freehand/skills/ or, in trusted folders, the repository's .agents/skills/ and .freehand/skills/. Only each skill's name, description and path sit in context; the model reads the file itself when a task matches, so a skill ecosystem does not inflate the system prompt. MCP does not add tools either: servers are reached through bash commands (freehand mcp call ...), a session is told only the server names and the tools/call commands, and tool descriptions enter context only when the model asks for them. Server-initiated requests (sampling, roots, elicitation) are declined, and a repository cannot add servers.
Mid-turn steering has a notable detail: with the GPT-6 family at OpenAI, the interactive session and browser use the Responses API's WebSocket mode and deliver your message into the response the model is writing (response.steer). The model finishes the item it is on and continues in a new response that carries your message, so it changes course without first finishing the whole turn. Headless runs (freehand -p) put activity on stderr and the final summary on stdout; with --json, stdout carries one event per line (session/model_call/text/tool_start/tool_end/context_edit/retry/result, schema 1), and exit codes 0/1/2/130 each have defined meanings. freehand stats reads Codex and Claude Code usage from their local logs and shows your last 7 days of tokens next to theirs.
Security: The Boundary Is Drawn Outside
Read this section before adopting it. FreeHand has no sandbox and no approval prompt: every command the model runs executes with your account's permissions — your files, network, credentials (SSH keys, git, cloud CLIs) and environment variables — in the terminal, the browser and headless runs alike, and nothing asks first. The official formulation: you draw the boundary around FreeHand, and inside it every decision is the model's. For code you do not trust, use a container or a VM (docs/container.md provides a ready Dockerfile).
The mitigations it does have each cover a specific thing, and the distinctions matter. Folder trust decides exactly one thing: whether that folder's AGENTS.md/CLAUDE.md and project skills load into the session's first message; it does not limit what commands can do. A pre_bash hook sees every command before it runs and can refuse it — that is where your own policy goes (for example, no git push). shell_environment_policy can keep *KEY*/*SECRET*/*TOKEN* variables out of the command environment. Undo is a convenience, not a backup: per-turn snapshots cover only files inside the working directory that are not gitignored and not over 1 MB; anything sent over the network, anything outside the directory, and any git push cannot be taken back. Credentials live in ~/.freehand/auth.json (mode 0600), but commands run as you and can read it too; sessions are plain text containing everything the model saw. The web interface listens on 127.0.0.1 only and requires the token in the address it prints. There is no telemetry; the only exceptions are favicons for public links in the web/desktop interfaces via Google's service (private hosts, IPs and major code hosts are never sent), the manual models --sync reading the models.dev catalog, and desktop release builds checking GitHub Releases for updates. When a provider's safety classifier stops a response, nothing from it is kept or run, and the request is not retried on another model.
Install, Platforms and Providers
curl -LsSf https://raw.githubusercontent.com/microsoft/FreeHand/main/install.sh | sh
# or: pip install freehand-ai (Python 3.10+)
freehand login # ChatGPT Plus/Pro sign-in, or freehand login openai | anthropic for an API key
cd your/project && freehand
Supported platforms are macOS and Linux, including Linux under WSL2; native Windows is marked coming soon. The desktop app is an unsigned preview (macOS Apple Silicon/Intel, Linux x64); on macOS, clear the quarantine attribute once with xattr -cr /Applications/Freehand.app before opening. Four provider paths: OpenAI Responses (default, ChatGPT subscription or API key), Anthropic Messages (API key only — Claude subscriptions cannot be used), any OpenAI-compatible Chat Completions endpoint, and gateways such as LiteLLM. The cost display has an honest detail: prices come from a built-in list-price table, a model the table does not know shows no cost rather than a wrong one, and with a ChatGPT sign-in the figure is what the tokens would cost at API prices, not what you are charged.
Boundaries and What to Judge for Yourself
First, every result comes from the authors' own runs — the README's wording is "in every setting we ran." We have not reproduced them, and this site has no independent benchmark. Scores in the harness domain are a product of model × runtime; change the model or the version and the conclusion may change. The paper and docs/benchmarks.md provide a Harbor recipe, and the benchmark adapter even fixes flat prices ($10/$1/$50 per million input/cached/output tokens) so runs stay comparable. Second, the frontier-model dependency is a design boundary: if you only have mid-tier models, the README's own numbers advise using their first-party harnesses. Third, alpha plus no sandbox is a double reminder — execution is fully delegated to the model, and a container or VM is the officially recommended way to run it, not optional hardening. Fourth, the repository was created on November 17, 2026; stars and ecosystem are early. The engineering care shows (a stdlib-only runtime that runs on Python 3.9 so it can be copied into task containers as is), but long-term maintenance and community size remain to be seen. We file it under the harness domain because it pushes the question "how much should the runtime decide for the model" to one extreme and backs it with checkable comparative numbers — not because its conclusions are beyond further verification.