cd /news/ai-agents/microsoft-freehand-harness · home › topics › ai-agents › article
[ARTICLE · art-180884] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Microsoft FreeHand Harness

Microsoft released Freehand, an open-source agent harness that gives a frontier model a roughly 200-word runtime description, a single `bash` tool and control over its own context, publishing the code as `freehand-ai` on PyPI and a paper on arXiv (2612.02442). Microsoft reports Freehand scored highest, cost least and was fastest on average against Codex, Claude Code, Gemini CLI, OpenCode, Pi and DeepSeek Harness across five benchmarks and three model families, though traditional harnesses still do better with weaker models. The alpha release has no sandbox — model commands run with the user's permissions and nothing asks first — and supports macOS and Linux, with native Windows listed as coming soon.

key takeaway

Freehand replaces a large harness with a ~200-word runtime description and a single bash tool, and Microsoft reports it beat Codex, Claude Code, Gemini CLI, OpenCode, Pi and DeepSeek Harness on score, cost and average speed across five benchmarks and three model families — but only with frontier mod

read9 min views11 publishedDec 3, 2026
Microsoft FreeHand Harness
Image: Michielbdejong (auto-discovered)

English · 简体中文 · 日本語 · 한국어 · Français · Español

🧭 Freehand is part of the AgentOpt series, which covers each part of an agent system: SkillLens · SkillOpt · Resource2Skill · EnvOpt · EvalOpt · Freehand. See the AgentOpt series page.

An agent harness that leaves the decisions to the model.

Freehand gives a frontier model a runtime description of about 200 words, one bash tool, and control over its own context. Against Codex, Claude Code, Gemini CLI, OpenCode, Pi and DeepSeek Harness, on five benchmarks with three model families, it scored highest and cost least in every setting we ran, and it was fastest on average.

Use it with a frontier model. Freehand leaves the decisions to the model, so it pays off when the model can make them well: with weaker models, traditional harnesses still do better (Results).

Quick start · Paper · Usage · Gateways · Benchmarks · Security · Changelog

Alpha. Freehand has no sandbox: the model's commands run with your permissions and nothing asks first. Use a container or VM for code you do not trust (how), and read the security model.

Supported platforms: macOS and Linux. The CLI and web interface also run in Linux under WSL2. Native Windows: coming soon. Desktop builds target macOS (Apple Silicon and Intel) and Linux (x64); see desktop/README.md for build details.

On macOS or Linux:

curl -LsSf https://raw.githubusercontent.com/microsoft/FreeHand/main/install.sh | sh

Or install from PyPI (Python 3.10+):

pip install freehand-ai

The script installs uv if it is missing, then Freehand with its own Python 3.12. If you already have uv, the same thing is uv tool install --python 3.12 git+https://github.com/microsoft/FreeHand. freehand update upgrades the uv tool installation. To work on Freehand itself, see Development.

freehand login            # Continue with ChatGPT (Plus or Pro); or an API key: freehand login openai | anthropic
cd your/project
freehand                  # interactive session in this directory
freehand -c               # continue the last session here
freehand -p "fix the failing test"   # headless: activity on stderr, the final summary on stdout
freehand web              # the same sessions in a browser window

Every command, key, slash command and setting is in docs/usage.md and docs/config.md.

<sub>GPT-6-astra in the desktop app, from launch. The model's 22 seconds of work play at 2× speed.</sub>

The desktop app is optional. It puts files, changes, Git and a terminal next to the conversation, and shares its sessions and settings with the terminal, so a session started in one continues in the other.

Unsigned preview installers (macOS Apple Silicon .dmg/.zip and Linux .AppImage, .deb and .rpm) are available on GitHub Releases. Because signed and notarized macOS builds are not published yet, drag Freehand.app into Applications and clear the quarantine attribute once before opening:

xattr -cr /Applications/Freehand.app

Or build it from source (Node 22.12 or later, and freehand from Install):

git clone https://github.com/microsoft/FreeHand.git && cd FreeHand/desktop
npm install
npm run app        # builds desktop/dist/mac-arm64/Freehand.app; `npm start` runs it without building

Sign in from the app, or with freehand login. More in desktop/README.md, docs/web-ui.md and docs/workbench.md.

freehand-aperture-readme.mp4 #

The Bitter Lesson holds that knowledge built into AI systems helps at first and is eventually outgrown by general methods. Mainstream harnesses build in a great deal: prompts prescribe how to approach a task, tool suites and timeouts fix how to act, and threshold compaction decides what to remember, all before the model has seen the task. For weaker models these presets are a crutch; for frontier models they become a cage. Freehand follows one rule: give the model a shell, its own memory, and a meter, and let it decide everything else.

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

Before the task begins the model sees about 0.35K tokens and one tool. After every turn it also sees its own meter: context size, tokens (with the cached share), cost and elapsed time.

The model-facing side stays this small on purpose. The human-facing side is complete: the desktop app (beta), a browser interface (freehand web) and a terminal interface, with streaming Markdown, interrupt, sessions and resume, per-turn undo, model switching, cost and context display, and HTML export.

Across 11 settings (five benchmarks with GPT-6-astra, Claude Opus 5.5 and Gemini 4 Carbon), 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, and it also beat OpenCode, Pi, DeepSeek Harness and the bash-only mini-swe-agent. In a controlled side-by-side rerun on the same machines and API endpoints, each of the other harnesses took 17–62% longer.

Benchmark Model Freehand (score · cost per task) First-party harness (score · cost per task)
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

With lower-tier models the order reverses. On Terminal-Bench 4 the first-party harness scores higher with GPT-6 Sol (Codex 34.9% vs. 29.2%), Claude Sonnet 5.5 (Claude Code 41.6% vs. 34.9%) and DeepSeek V4.1 Flash (DeepSeek Harness 28.9% vs. 23.8%). Freehand is built for frontier models; with a smaller model, that model's first-party harness may serve you better.

The other baselines, ablations and analysis are in the paper; docs/benchmarks.md shows how to run the benchmarks with Freehand.

Provider How to sign in
OpenAI (default) freehand login , with a ChatGPT Plus or Pro plan, orfreehand login openai with an API key
Anthropic freehand login anthropic , thenfreehand --provider anthropic
Any OpenAI-compatible Chat Completions API freehand --provider openai-chat --api-base <url> --api-key-env <VAR>
A gateway such as LiteLLM, for GPT, Claude and Gemini behind one key docs/gateway.md

/model switches the model, and the provider with it, in a running session.

Freehand is a local tool that acts with your permissions. It has no sandbox and no approval prompt: you draw the boundary around Freehand, and inside it every decision is the model's.

  • Commands run as you, with your files, network, credentials and environment variables.
  • For code you do not trust, use a container or VM: docs/container.md .
  • Repository content is untrusted input. AGENTS.md and project skills load only in folders you have trusted.
  • No telemetry. Freehand talks only to the model service and MCP servers you configure (in the web and desktop interfaces, public web links in replies also load site favicons from Google's favicon service; see docs/security.md ).

The full model, including undo, local files and the browser interface, is in docs/security.md. To report a vulnerability, see SECURITY.md.

git clone https://github.com/microsoft/FreeHand.git && cd FreeHand
uv sync --extra dev
uv run pyflakes src tests
uv run pytest -q

The code layout and the rules for a change are in CONTRIBUTING.md and AGENTS.md.

Freehand is part of the AgentOpt series from Microsoft Research. Each project tackles one part of an agent system: its skills, its training environments, the evaluator that judges it, or the harness it runs in. Projects are listed by release date.

Project What it does Paper Code Project page
SkillLens Studies what makes model-generated skills useful, from experience to extraction to use arXiv Code Project page
SkillOpt Trains reusable natural-language skills for frozen agents arXiv Code Project page
Resource2Skill Distills human tutorials and resources into executable agent skills arXiv Code Project page
EnvOpt Builds the training environments an agent needs arXiv Code Project page
EvalOpt Evolves evaluators for open-ended tasks from human feedback arXiv Code Project page
Freehand (this repo) An agent harness that leaves the decisions to the model arXiv Code Project page

More AgentOpt projects are on the way. Overview: AgentOpt series page.

This project welcomes contributions and suggestions. See CONTRIBUTING.md.

If you find Freehand useful in your research, please cite:

@article{zeng2026freehand,
  title  = {Freehand: The Bitter Lesson Comes to Agent Harnesses},
  author = {Zeng, Zezi and Zhao, Yuke and Tian, Muzhao and Yang, Yifan and Dai, Qi and Liu, Bei and Qiu, Kai
            and Zhuang, Bohan and Zhu, Jihua and Luo, Chong},
  journal = {arXiv preprint arXiv:2612.02442},
  year   = {2026}
}

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Freehand is not affiliated with or endorsed by OpenAI, Anthropic or Google. ChatGPT, Codex, Claude, Claude Code, Gemini and Gemini CLI are trademarks of their owners and are named here only to describe compatibility.

MIT. See LICENSE.

── more in #ai-agents 4 stories · sorted by recency
── more on @microsoft 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/microsoft-freehand-h…] indexed:0 read:9min 2026-12-03 · —