agent-harness

Guidance for designing and auditing the instructions, tools, and decision methods given to an AI agent. An agent harness is the layer that shapes what the model is told and how it chooses actions.

In plain words
What is it for?
Use it to write or fix system prompts, choose tools and workflows, decide between agent techniques, and audit an existing agent setup.
Why use it?
It helps diagnose agent behavior caused by unclear prompts, unsuitable tools, or a poor task workflow instead of assuming every problem is in the surrounding code.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ssheleg/agent-stack/agent-harness
Any agent
npx skills add ssheleg/agent-stack --skill agent-harness
Clone the repo
git clone --depth 1 https://github.com/ssheleg/agent-stack

Made for: Claude Code, Codex.

Per session 227 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,915 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00227 $0.02915
Opus 5 $0.00113 $0.01458
Sonnet 5 $0.00045 $0.00583
Haiku 4.5 $0.00023 $0.00292

Measured 2d ago against content hash 4451a75918cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-harness scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit_agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-stack/skills/agent-harness/SKILL.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent harness — what the agent is told, and how to audit what someone else told theirs

agent-orchestrator wires the loop. agent-evals proves it behaves. agent-interop gets it talking to other processes. This skill is the layer between them and the model: the prompt, the tools, and the choice of technique. The outside term for this ground is harness engineering — OpenAI's article of that name (openai.com/index/harness-engineering, read 2026-08-30) and Anthropic's harness-design guidance (anthropic.com/engineering/harness-design-long-running-apps, read 2026-08-30) both name this same layer, and its leverage is measured: on ARC-AGI-3, harness-level changes alone moved a fixed model from 13.3% to 38.3% while spending a sixth of the tokens (as reported 2026-08-30).

It runs in both directions. Building one and auditing one are the same checklist read forwards and backwards, which is why they live together here.


Rule zero — most agent bugs are prompt bugs wearing a stack trace

The instinct when an agent misbehaves is to change the code. The measured reality, in every source this skill was built from, is that the largest behavioural changes come from the text: "the biggest performance improvements often come from clearly explaining tool usage in the system prompt", and "even small refinements to tool descriptions can yield dramatic improvements."

Before adding a retry, a router, or a sub-agent, check in this order:

  1. Does the tool description say when to use it, not just what it does?
  2. Does the system prompt name the vocabulary? An agent told to track status will invent pending and to-do and done and completed in the same run unless the allowed values are enumerated.
  3. Does the agent know today's date? A model with a training cutoff will answer from memory rather than search unless the current date is injected.
  4. Is the instruction flexible where it should be strict? "Use the tools in the order that makes most sense to you" is right while you are learning the task and wrong in production, where "you MUST execute a web search for each task" is what stops a step from being skipped.

Read the full file on GitHub · 204 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 204 lines · 227 tokens per session scan A 4451a75918cc

Subscribe to this mod's changes

agent-harness is a skill published in the GitHub repository ssheleg/agent-stack (2 stars, last pushed 2d ago), licensed MIT. It adds 227 tokens to every session and 2,915 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.