harness.ahmets.io

Built by Ahmet Kulekci

Interactive guide

Harness Engineering

How does an agent use tools, catch a mistake, and decide when to stop? Follow one example step by step.

Try the Agent Loop

Article in progress

Example task / README.md

  1. ModelProposes a replacement link.
  2. HarnessRuns the tool and returns its result to the model.
  3. CheckDoes the link point to the expected target?

01Model, Agent, Harness

Agent working loop: context, model inference, routing, authorization, execution and result injection, with final-response and independent termination paths.
Sheet A, 01–09: Agent working loop and execution boundaries. Diagram in Turkish

Signal path

Illustrative diagram

  1. Request
  2. Harness
  3. Model
  4. Proposal

← Observation → next decision

Proposal, not execution

write /README.md
link = /docs/setup

Execution, harness boundary

Policy → allowed?

Executor → in-memory write

Sensor → exact-target check

Task, /README.md: /setup-old → /docs/setup. Do not modify other files. No publish.

02The Agent Loop

Go to related sheet · A

Step through a run

Simulation

Fixed script. Step through a failed check, replan and retry.

Ready

    Budget & Loop, mini-demo

    Repeated wrong link. Warning does not stop or repair. Manual repair applies on the next Step only; there is no automatic replan.

    Changing a limit starts a fresh run. Pass on the final allowed step → finish.

    03What the Agent Sees

    Pre-action guides and post-action sensors, computational/inferential matrix, inner and outer steering loops, quality goals and human responsibility.
    Sheet C, 14–18: Guides, sensors and the outer engineering loop. Diagram in Turkish

    Guide × Sensor

    Simulation

    Simulated model rule & assumptions
    readGuide = true → propose /docs/setup
    readGuide = false → propose /docs/install

    Apply proposal to fake /README.md.

    Sensor on: actual === /docs/setup → pass; else fail.

    Sensor off: unknown (no verification).

    readGuide means the exact target hint is present and used by this fixed rule. No real file read, LLM inference or automatic repair.

    All four combinations
    GuideSensorActualObserved
    OffOff/docs/installunknown
    OnOff/docs/setupunknown
    OffOn/docs/installfail
    OnOn/docs/setuppass

    04Who Can Do What?

    Go to related sheet · A

    Policy boundary

    Static example

    OperationTargetPolicy
    Read/README.md · /docs/*Allow
    Write/README.md onlyAllow
    WriteAny other fileDeny
    PublishAny targetDeny

    Approval × test, illustrative gate

    ApprovalTestStaged change
    NofailHold
    NopassHold
    YesfailHold
    YespassReady for review

    Illustrative logic, not an actual test, sandbox, permission system or publish authorization.

    05What Counts as Done?

    Source-reported LangChain scores, build–verify, reasoning budget, Inspect Agent API, scorer/isolation boundary and harness design worksheet.
    Sheet D, 19–24: Source experiment, evaluation and design; these demos do not rerun the benchmark. Diagram in Turkish

    Keyword vs outcome

    Simulation

    Fake files, inspect before scoring

    keyword: message.includes("done")
    outcome: files["/README.md"] === "/docs/setup"

    Stable message: done. This grader checks only the exact target predicate: not existence as a separate test, full scope, unchanged other files or deployment.

    All grader states
    FixtureKeywordOutcome
    Draft changedpassfail
    Target changedpasspass

    06Runs That Resume

    Context management, memory/checkpoints and observability, plus single-agent, orchestrator/worker, router and human-in-the-loop patterns.
    Sheet B, 10–13: Supporting systems and architecture; these are distinct concepts. Diagram in Turkish

    Checkpoint ≠ current proof

    Static example

    Session A, checkpoint

    Environment: revision 1

    /README.md → /docs/setup

    Check: pass @ revision 1

    Saved: task, trace, next action

    Session B, changed environment

    Environment: revision 2

    /README.md → /setup-old

    Prior check: stale

    Next action: reverify

    Observed: unknown until checked

    Static example / future demo. No resume control or persistence. Checkpoint ≠ persistent user Memory.

    07Design Your Own Harness

    Go to related sheet · D

    Your worksheet

    Worksheet

    Blank worksheet. Browser memory only; reload clears fields. No automatic optimization.

    USE CASE · SYNTHETIC WIND FARM

    Before a firewall rule reaches the site

    A Jira change approves temporary RDP access from the jump server to one turbine engineering workstation. The Panorama or FortiManager draft targets a group of three. AI does not decide whether the change proceeds: it turns the approval text into a scope draft that can be checked.

    1. AI intervention: the Jira text, not the rule

      Input: “RDP to the turbine engineering workstation only, during the support window.” Output: target wording, service, time condition, and source passage. If the window has no recorded times, AI does not invent them; the case goes to review. Structured approval fields bypass the model.

    2. Harness: interpretation does not grant authority

      The schema and passage are checked; an authorized reviewer confirms scope and the approved inventory resolves the target identity: RES-EWS-WTG-01. The model cannot write to Jira, edit the rule, or run a push/install.

    3. Graph: approval and firewall draft meet

      Code resolves the draft group in the target device’s context. RES-EWS-SCADA-01 and RES-EWS-SWGR-01 are outside the approved scope, so the result is HOLD. If evidence is ambiguous, the result is REVIEW_REQUIRED.

    4. Gate + Outer Loop: hold deployment, check the next revision

      A deployment path that enforces the check does not allow this revision to reach push/install. Changes to the rule or device scope require a new check. A Jira comment alone does not block firewall deployment.

    Show the Excalidraw flow (Turkish)Jira approval and the firewall draft run on separate branches. AI only interprets Jira text; code finds the scope difference, and the change gate enforces HOLD. Download editable Excalidraw

    This is a design example. It connects to no live Jira, firewall, or OT network and deploys no changes.