What it is

Agents follow a process badly. The harness makes them follow it. One workflow.yaml describes the business process as a state machine and enforces it on every step. The agent sees the current state's instructions, tools and transitions, and that is its whole view of the graph. A human state parks the session for a decision. A sub-workflow runs as a child with a typed contract at the boundary. Cases with rubrics grade whether the agent did the task.

It is a thin layer over LangChain Deep Agents and LangGraph, written in TypeScript, MIT licensed, published as @archmax-ai/harness.

The bundled customer-support example, abridged. A routing state with a guard hook, an agent state with a policy check and an error route, and a human state that approves the case or sends it back:

states:
  identify-case:
    title: Identify case
    triggers:
      manual:
        session: conversation_id
    before:
      - script: hooks/check-tenancy.js
    transitions:
      - to: orders-question
        description: The user is asking about orders, shipping or tracking.
      - to: refund-request
        description: The user wants a refund, return or cancellation.
      - to: general-question
        description: Any other question.

  refund-request:
    title: Evaluate refund request
    skills:
      allow: [order-data, refund-policy]
    after:
      script: hooks/check-refund.js
    on_error: escalation
    transitions:
      - to: refund-review
        description: The decision is recorded in refund.json and explained.

  refund-review:
    title: Review refund decision
    type: human
    approvers: [[email protected]]
    evidence: [scratchpad/refund.json]
    transitions:
      - to: refund-closed
        type: approve
        description: The recorded decision is correct. Close the case.
      - to: refund-request
        type: refine
        description: Send it back with a comment. The agent revises.

The full file, with the states this cut leaves out, is in the repo.

My part

The harness is an archmax-ai project. I contribute to it and am listed as a maintainer of the npm package.

My largest piece is the audit trail. Every state traversal, human decision and error route is recorded in a checkpointed trail, so a test case can assert on the path the agent actually took.

The trail of one run of the example's refund case, read back from the session's checkpoint. The reviewer sends the decision back once, then approves it.

{
  "sessionId": "refund-ord-1001",
  "workflow": "order-lookup",
  "steps": [
    {
      "to": "identify-case",
      "kind": "trigger",
      "reason": "manual",
      "ts": 1791574172436
    },
    {
      "to": "refund-request",
      "kind": "agent",
      "reason": "The customer is requesting a refund for a specific order (ORD-1001).",
      "ts": 1791574177181
    },
    {
      "to": "refund-review",
      "kind": "agent",
      "reason": "Refund decision has been recorded in scratchpad/refund.json — approved because ORD-1001 has status 'delivered'.",
      "ts": 1791574192902
    },
    {
      "to": "refund-request",
      "kind": "human",
      "reason": "Please restate the refund amount and confirm the order was delivered before it can be approved.",
      "ts": 1791574197224
    },
    {
      "to": "refund-review",
      "kind": "agent",
      "reason": "Updated refund.json to explicitly state the delivery confirmation and refund amount of EUR 1200.00 as requested by the reviewer.",
      "ts": 1791574209832
    },
    {
      "to": "refund-closed",
      "kind": "human",
      "reason": "The explanation is clear now.",
      "ts": 1791574213814
    }
  ]
}

Test cases assert on it:

  • reachedState checks that a committed step entered a state.
  • trail counts the steps matching a target, a kind or a reason.
  • ranWorkflow checks that a sub-workflow was dispatched, and with what status.

Beyond that I worked on the governance kernel and on delegation between workflows, set up the CI, the secret scanning and the npm release pipeline, and worked through the documentation for clarity.

Most of that predates the public repository, which starts in September 2026. The docs cover the workflow machine, sessions, triggers, skills, sub-workflows and testing.