Kiln Harness Tuner
Automatically tune your agent's harness: tools, prompts, skills, model and settings.
Kiln Harness Tuner automatically improves an AI agent by tuning its harness: the tools, prompts, skills, model and settings around the model. It is free, open source, and runs on your machine alongside the Kiln app.
Most optimizers tune only the prompt. Harness Tuner tunes everything around the model, and uses your Kiln evals to measure every change.
What It Tunes
Section titled “What It Tunes”- Tools: often the biggest win. It rewrites your tools for the agent: smaller responses, better descriptions, no repeated calls. It doesn’t touch your original tools. It writes wrappers as code tools.
- Prompts and skills: it cuts contradictions, adds the requirements nobody wrote down, and moves long instructions into skills that load only when needed.
- Model and settings: it tunes thinking level, temperature and the rest. It keeps your model by default. Allow other models at start-up, or optimize for speed or cost, and it also searches models and providers.
- RAG, fine-tunes and sub-agents: it attaches, swaps or drops the ones in your project.
It tries different methods, not just different words: one big prompt or skills, RAG or a skill, many small tools or one general one.
How It Works
Section titled “How It Works”Harness Tuner runs experiments in a loop. Each experiment builds a new run configuration for your task, and your evals measure it against the current best.
- You set the goal and steer: optimize for quality, cost or speed. When it cuts cost or latency, it holds quality. Tell it what to focus on and what not to touch, in plain English.
- Many goals, not one number: bring all your evals. It tracks every one, and checks every eval before it promotes a change.
- Targeted experiments: each experiment runs only the evals it targets, so trying an idea is cheap.
- Train, validation and test data, kept apart: the tuner’s agents only see training data. Validation data decides which changes are promoted. Test data is never read, so your test score stays a true measure.
- Several winners, your pick: it finds the best quality, the cheapest at good quality, a balanced option and the fastest. Compare them side by side in Kiln.
- Runs on the coding agent you already use: Claude Code, Codex or OpenCode, on your existing subscription.
Kiln tracks every experiment and shows how the tuning progressed
What You Need
Section titled “What You Need”- The Kiln app, running on the same machine. See the quickstart.
- A Kiln task with at least one run configuration. This is the agent you want to tune, and the starting point for experiments. Single-turn and multi-turn tasks are both supported.
- Evals, each with a training and a validation dataset. See Evals Drive Quality below.
- A coding agent: Claude Code (the default), Codex or OpenCode. The tuner’s agents run on your subscription.
- Model provider keys, added in Kiln. These run the agent being tuned, and your evals.
- uv, to install it.
- Linux, or macOS on Apple silicon. Windows is not supported.
The install guide has a check and a fix for each requirement.
Quickstart
Section titled “Quickstart”Install Harness Tuner and start it:
uv tool install harness-tunerharness-tunerIt walks you through the rest: connecting to Kiln, picking the project and task to tune, and setting a goal, a budget and a time limit. It then works until the budget or the time runs out, writes a report, and prints where to find it.
To try it first on a small example, run the demo. It copies a small moderation task into a new Kiln project and tunes it. The demo needs an OpenRouter API key in Kiln, and costs about $2.
harness-tuner --demoSee tuning your own task for a full walkthrough.
Evals Drive Quality
Section titled “Evals Drive Quality”We can’t optimize something unless we can measure it, so the heart of Harness Tuner is Kiln Evals. The better your evals are at assessing quality, the better the tuner will work. Some guidance:
- Create many small evals: it’s typically easier to create several small evals focused on one area, than to try to create an all-encompassing eval.
- Use the Kiln Eval Builder to make better evals: it uses AI to refine your LLM-as-Judge for better alignment to human preference.
- Set a default judge on every eval you want measured.
Training, Validation and Test Datasets
Section titled “Training, Validation and Test Datasets”Each eval the tuner uses needs a training dataset and a validation dataset, separate from its test dataset. See eval datasets for how to create them.
Reviewing the Results
Section titled “Reviewing the Results”Every experiment is saved to your Kiln project as a run configuration, so nothing is lost when a run ends.
- Compare: compare the winners against your starting point on evals, cost and speed.
- Experiment Graph: see how the tuning progressed, and which experiments each winner came from.
- Test score: the tuner never reads your test dataset. Run your evals on it in Kiln to get a final score that the tuner never optimized against.
Harness Tuner is free, but it makes LLM API calls. A small agent with a small eval can cost a few dollars. A large agent with hundreds of tools can cost several hundred.
- Your agent and evals bill to the provider keys in Kiln. You set a budget for these at start-up, and the tuner starts no new work once it is spent.
- The tuner’s own agents run on your coding agent subscription. The budget does not count this usage.
See the cost guide to estimate a run before you start it.
Harness Tuning vs Fine Tuning
Section titled “Harness Tuning vs Fine Tuning”We generally recommend tuning your harness before fine-tuning. A tuned harness is:
- Easier to deploy: no GPUs, and it works with off-the-shelf models
- Easier to update when new product requirements come up
- Quicker to move to new model releases: run the tuner again with the new model
- Easier to interpret: you can read every change
| Fine Tuning | Harness Tuning | |
|---|---|---|
| Optimization Target | Supervised training data | Evals |
| What Changes | Model weights | Tools, prompts, skills, model and settings |
| Interpretability | Can’t interpret changes | Easy: read the new run configuration |
| Deployment Effort | High: host a custom model | Low: use the new run configuration |
The two work together. Harness Tuner can use the fine-tuned models in your project.
Learn More
Section titled “Learn More”- Harness Tuner on GitHub: the README, FAQ and source code.
- How it works: the whole loop, with a diagram.
- Objectives and models: what to optimize, and which models it may use.
- CLI reference: every command and flag.
- Limitations: what it doesn’t do. Read it before planning a long run.
For LLMs:llms.txtllms-full.txt