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.
npx skills add puristajs/harness --skill ai-harnessgit clone --depth 1 https://github.com/puristajs/harnessWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/puristajs/harness/ai-harness)<a href="https://agentmods.dev/skills/puristajs/harness/ai-harness"><img src="https://agentmods.dev/badge/skills/puristajs/harness/ai-harness/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/puristajs/harness/ai-harness"><img src="https://agentmods.dev/badge/skills/puristajs/harness/ai-harness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00051 | $0.02500 |
| Opus 5 | $0.00026 | $0.01250 |
| Sonnet 5 | $0.00010 | $0.00500 |
| Haiku 4.5 | $0.00005 | $0.00250 |
Grade A, and why
ai-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 11d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI Harness
Use This For
Use this skill for work involving @purista/harness, @purista/harness-openai, or addon packages named @purista/harness-*.
Core Model
@purista/harness is a standalone, ESM-only agent runtime. It composes typed model aliases, tools, skills, agents, workflows, state, memory, sandboxing, logging, telemetry, and streaming behind one session API.
Keep these layers separate:
- configuration:
defineHarness()registers adapters, defaults, models, tools, skills, agents, and workflows - execution:
harness.getSession(id)returns typedsession.agents.*andsession.workflows.* - adapter code: provider, state, memory, sandbox, MCP, durable runtime, logger, and telemetry ports
- application integration: HTTP/SSE, queues, persistence, auth, and business state stay outside the harness unless represented by a port or tool
- optional governance: policy-as-code for tool decisions, approvals, audit, and policy-pack adapters is configured only when needed; ordinary agents do not require policy setup
Hard Rules
- Use
defineHarness()as the sole construction path. Do not invent standalonedefineAgent,defineWorkflow,defineTool,defineSkill, ordefineModelhelpers. - Use
defineHarnessModule<Required>()('module.id', { register })only for local static composition. Modules contribute normal definitions to the caller's builder; they are not remote plugins, manifests, loaders, or lifecycle owners. Module callbacks cannot build or recursively use a harness. - Use
@purista/harness-agent-pluginsonly for data-only Agent Plugins v1 packages. Require application-owned source/digest/trust approval, inspect diagnostics, then bind selected skills and MCP tools explicitly. A selected stdio server also needs an existing caller-owned data directory and an isolating sandbox implementing bothspawnandmountReadOnly; the local host-directory sandbox does not qualify. Never load package code, auto-install dependencies, auto-expose tools, or accept plugin-provided credentials. - MCP is a clean v2 integration pinned to
2026-07-28: use@modelcontextprotocol/client, modern stateless Streamable HTTP, and a spawn-capable sandbox for stdio. Do not add legacy MCP, HTTP+SSE, one-shot exec, or compatibility fallbacks. - Module definition ids compose additively. Treat duplicate module/definition ids as configuration errors; inspect only
harness.inspect().modulesfor content-free provenance. - Preserve builder inference by declaring models before agents and agents before workflows.
- Use inline helper callbacks for agents and workflows:
.agents(({ agent }) => ({ ... }))and.workflows(({ workflow }) => ({ ... })). - Child-agent delegation is disabled by default. Any workflow that calls
ctx.agents.<id>(input)must declareworkflow.delegation; preferdelegation.agentsallowlists and document budget/model overrides there. - Use
ctx.fanOut(...)for ordered, bounded workflow batches. Usectx.childTasks.start(...)only for workflow-owned isolated background work; task turns queue under the delegation parallel ceiling and never inherit parent history or widen agent permissions. mode: 'continuable'keeps an isolated in-process task conversation open for explicitsend(...)turns andclose(). Do not use it for durable workflow execution or claim cross-process recovery; use an application queue/worker adapter when work must survive a restart.- Configure
defaults.historyRetentionfor durable conversations that need a storage bound. It retains complete newest turns only and requires an atomicStateStore.replaceMessages;maxBytesis serialized UTF-8 storage size, never a token estimate. Use the model's context window/token tooling separately when selecting request context. - For at-least-once direct-agent delivery, pass the transport's stable message or delivery id as
InvokeOptions.idempotencyKey. Replaying the same successful invocation returns its recorded output without a second provider call or transcript; never derive this key from prompt content. - Use
session.release()at the end of an idle request to close live sandbox/MCP resources while preserving StateStore-backed history and runs.session.close()is destructive: it deletes the session record, history, runs, and persisted events. - Declare model capabilities truthfully. Capability arrays gate both TypeScript handles and runtime behavior.
- Prefer
object/object_streamfor structured generation. Do not use legacyjsoncapability names. - Keep RAG orchestration in application/workflow code. The harness provides embeddings and rerank operations, not vector storage.
- Keep HTTP/SSE protocol mapping outside the harness. Harness streams are typed
RunEventvalues. - Do not import PURISTA framework packages from harness or harness addon packages.
- Do not leak prompts, documents, tool inputs, or secrets through logs or telemetry.
telemetry({ contentCaptureMode: 'NO_CONTENT' })is the production default. - Skills are mounted files, not prompt text. Register directories with
.skills(...), allowlist skill ids per agent, keepreadavailable for skill-backed agents, and verifySKILL.mdbodies are not inlined into prompts, logs, traces, or persisted events. - Prefer
ctx.metricsfor application-owned counters, histograms, and operation durations inside workflow handlers, custom agent handlers, and TypeScript tool handlers. Do not call the low-levelTelemetryShimdirectly for app metrics. - Governance policy is optional and late-bound through
.governance(...)after agents/workflows are declared. Keep simple use cases on per-agent permissions; use governance only for composable/audited policy, approval, or external policy-pack interoperability.
What ships with it
12 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.
- agents/openai.yaml 249 B
- references/adapters.md 14 KB
- references/agents-workflows-tools.md 15 KB
- references/configuration.md 8.5 KB
- references/durable-feedback-operations.md 9.0 KB
- references/model-setup.md 9.5 KB
- references/package-surface.md 5.1 KB
- references/sandbox.md 7.0 KB
- references/skills.md 3.9 KB
- references/state-sessions-streaming-errors.md 9.6 KB
- references/telemetry-observability.md 5.8 KB
- references/testing.md 5.6 KB
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.
- 11d ago First seen · 146 lines · 51 tokens per session scan A 574ea42a60ab
ai-harness is a skill published in the GitHub repository puristajs/harness (5 stars, last pushed today), licensed Apache-2.0. It adds 51 tokens to every session and 2,500 once invoked, about $0.0003 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.
Other skills, from other repositories
skillpack-creator
Create a reusable SkillPack from a successful completed task. Use when the user wants to convert a one-off research, coding, analysis, or content workflow into a distributable local SkillPack with skillpack.json, local skills under skills/, starter prompts, start scripts, and an optional zip package.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
todos
This chat has a shared, live TODO plan — your tasks for the conversation, which the user also edits. Read this skill and reach for the todo tools whenever a request takes more than a couple of steps. It covers the plan model (group = task, items = its steps; loose items are the user's lane), how to work it: propose…
writing-workflow-skills
Use when adding a new workflow skill to pi-thinkrail-workflow, changing an existing workflow skill's role, trigger, handoff, or structure, or checking a workflow skill against the workflow system's rules. Not for authoring general-purpose skills outside this package.
brainstorming
Use this BEFORE any creative or feature work: building a new feature, adding functionality, changing behavior, or making a nontrivial design decision. Turns the user's request into a validated design — recorded as a spec-graph task-spec — before any implementation. Do not skip this because a change looks small.
reviewing-changes
Use when a review package asks you to review a plan step's change set (todo.startReview): you are the REVIEWER, not the author. How to judge an agent-written diff, file findings with addreviewcomment, and settle with exactly one reviewverdict.