ai-harness

ai-harness is a skill for Codex from puristajs/harness. It costs 51 tokens per session (2,500 once invoked), scanned A, original, Apache-2.0.

A skill for building applications with @purista/harness and its provider add-ons. The harness is a runtime that combines agents, workflows, tools, models, state, memory, sandboxing, logging, telemetry, and streaming behind one session interface.

In plain words
What is it for?
Use it to design, implement, configure, test, or extend harness-based agents, workflows, tools, skills, models, state, sandboxes, or adapters.
Why use it?
It helps keep application configuration, execution, provider integrations, and business code separated when working with this framework.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to design, implement, configure, test, or extend harness-based agents, workflows, tools, skills, models, state, sandboxes, or adapters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/puristajs/harness/ai-harness
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.

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

Made for: Codex.

Wrote 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.

agentmods badge for ai-harness

README.md
[![agentmods](https://agentmods.dev/badge/skills/puristajs/harness/ai-harness/github.svg)](https://agentmods.dev/skills/puristajs/harness/ai-harness)
Your own site
<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.

agentmods 80×15 button for ai-harness

Your own site · 80×15
<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>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,500 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00051 $0.02500
Opus 5 $0.00026 $0.01250
Sonnet 5 $0.00010 $0.00500
Haiku 4.5 $0.00005 $0.00250

Measured 11d ago against content hash 574ea42a60ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

skills/ai-harness/SKILL.md · 146 lines

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 typed session.agents.* and session.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 standalone defineAgent, defineWorkflow, defineTool, defineSkill, or defineModel helpers.
  • 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-plugins only 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 both spawn and mountReadOnly; 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().modules for 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 declare workflow.delegation; prefer delegation.agents allowlists and document budget/model overrides there.
  • Use ctx.fanOut(...) for ordered, bounded workflow batches. Use ctx.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 explicit send(...) turns and close(). 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.historyRetention for durable conversations that need a storage bound. It retains complete newest turns only and requires an atomic StateStore.replaceMessages; maxBytes is 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_stream for structured generation. Do not use legacy json capability 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 RunEvent values.
  • 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, keep read available for skill-backed agents, and verify SKILL.md bodies are not inlined into prompts, logs, traces, or persisted events.
  • Prefer ctx.metrics for application-owned counters, histograms, and operation durations inside workflow handlers, custom agent handlers, and TypeScript tool handlers. Do not call the low-level TelemetryShim directly 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.

Read the full file on GitHub · 146 lines

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. 11d ago First seen · 146 lines · 51 tokens per session scan A 574ea42a60ab

Subscribe to this mod's changes

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.

Related

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.

CreminiAI/skillpack · 67 tokens

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.

CreminiAI/skillpack · 64 tokens

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…

JetBrains/thinkrail · 127 tokens

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.

JetBrains/thinkrail · 60 tokens

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.

JetBrains/thinkrail · 65 tokens

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.

JetBrains/thinkrail · 59 tokens