My Profile Photo

Chang Min Park


Senior Software Engineer at Yahoo!



Private lab

Agent Harness Lab

A private workshop for learning agent loops, tools, guardrails, eval, and RAG — paired with the Writing essays on this site. Checkboxes save in this browser.

  • ~10–14 weeks · 4–8 hr/week
  • Claude-first · optional local 7B
  • Folder: agent-lab/

How to run this lab

Work top-down. Each phase has prerequisites → learn links → checkable todos (todos save in this browser).

  1. Create a local folder agent-lab/ for practice code (not a required GitHub repo).
  2. Skim Learn before you build for that phase.
  3. Open each todo’s How link for step-by-step instructions and external guides.
  4. Check off subtasks as you finish them (items marked Optional do not block a phase).
  5. Demo the failure mode before you “fix” it.
  6. Re-read the linked Writing post with the lab still open.
  7. Pass the phase bar out loud without notes.

Hardware: MacBook Pro with 24 GB is enough. Cloud Claude is the primary brain. Optional Ollama 7B / on-device is wiring literacy only. Phase 11 (computer-use) is optional.


Stack

Think in layers. Don’t confuse a chat UI with a harness.

Layer Options Use here
Brain Claude API · Ollama 7B · on-device (opt.) Claude for real failure modes; Ollama/on-device = wiring literacy
Runtime Hand-rolled loop · LangGraph · OpenClaw Start hand-rolled; graphs later
Tools / MCP Hardcoded schemas · MCP servers Discovery ≠ allowlist — Phase 2
Channels OpenClaw · Open WebUI · browser/computer-use Capstone / RAG / Phase 11
Observe JSONL logs · Langfuse · audit fields Required once you hit eval
Cost Pricing · prompt cache · triage models Treat $/task as a harness concern
┌──────────┐     ┌─────────┐     ┌─────────┐     ┌──────────┐
│   goal   │────▶│  model  │────▶│  tools  │────▶│ observe  │
└──────────┘     └────┬────┘     └────┬────┘     └────┬─────┘
                      │               │               │
                      └───────────────┴───────◀───────┘
                                    stop?

The harness owns the loop. The model proposes; tools act; observe decides whether to stop.

LangChain/LangGraph sit in runtime — same tier as a loop you wrote yourself, not a Claude replacement.


Phase 0 — Setup

Topic Environment · Essay — · Prior phases none · ~4–6 hr

Get a working Claude path and a place to put labs. No site post yet.

Learn before you build

Knowledge Why Refresh
Terminal / env vars Run scripts macOS Terminal
Git basics Version lab code Git handbook
Python 3 + venv SDK venv docs
HTTP API → JSON LLM calls MDN web APIs intro
Tokens ≈ cost Budget Anthropic pricing

References: Anthropic docs · Messages API · Ollama · Artificial Analysis

Todos

Pass when: chat turn from a script works, and you can explain tokens ≈ cost.


Phase 1 — Agent loop

Topic Harness / “done” · Essay The Agent Said Done — and CI Is Red · Prior 0 · ~9–12 hr

Chat “done” and merge-ready are different signals. The harness must observe CI (or an equivalent gate) before stop.

  agent says "done" ──▶ harness checks fake CI
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
           CI green        CI red         max steps
              │               │               │
           allow stop      keep looping    force stop

Without the CI gate, “done” is just another chat token.

Learn before you build

Knowledge Why Refresh
Phase 0 done Working Claude path
Message roles (system / user / assistant) Loop state Messages API
JSON in Python Tool args json module
ReAct (high level) Loop shape ReAct paper (skim)
CI / PR gates Done ≠ merge GH Actions quickstart · essay Prerequisites

References: Anthropic tool use · Building effective agents · Essay

Todos

Pass when: agent may only claim done when CI is green — and you can teach why chat “done” ≠ merge.


Phase 2 — Tools

Topic Tool surface · Essay Your Agent Has Too Many Tools · Prior 0–1 · ~6–7 hr

The model only sees schemas. A bloated catalog is a harness bug: access ≠ expertise.

  allowlist (5)          flood (20)
  ┌─────────────┐        ┌─────────────┐
  │ read_file   │        │ read_file   │
  │ write_file  │        │ write_file  │
  │ run_tests   │   vs   │ + 15 junk   │
  │ git_status  │        │   schemas   │
  │ search      │        │   (noise)   │
  └─────────────┘        └─────────────┘
       fewer steps            more tokens / thrash

Learn before you build

Knowledge Why Refresh
Phase 1 loop Tools plug into harness
Tool schema (name, description, JSON params) Model only sees schema Tool use
Filesystem paths / cwd Coding tools
Prompt bloat / token cost Too many tools hurts Pricing

References: Anthropic tool use · LangChain tools (opt.) · Essay

Todos

Pass when: you have a measured comparison and can explain why tool bloat is a harness problem.


Phase 3 — Skills & memory

Topic Rules that survive chat amnesia · Essays Forgot the Constraint · Monorepo Navigable to Agents · Prior 0–2 · ~6–8 hr

Durable rules live in files / system prompt — not in yesterday’s chat scrollback.

  cold session
       │
       ▼
  ┌────────────┐     ┌──────────────┐
  │ AGENTS.md  │────▶│ toy monorepo │
  │ + repo map │     │   agent run  │
  └────────────┘     └──────┬───────┘
                            │
              stale memory.json (lies) ──▶ rules must win

Learn before you build

Knowledge Why Refresh
Phase 1–2 Rules constrain tools
System vs user messages Durable rules live in system / files Messages API
Finite context Can’t paste whole repo Context windows
Monorepo layout Navigability Your day job

References: Claude Code docs · AGENTS.md · Constraint essay · Monorepo essay

Todos

Pass when: cold start with only the map holds constraints — no paste of prior chat.


Phase 4 — Guardrails

Topic Trust boundaries · Essay Agent Trust Boundaries · Prior 0–2 (3 recommended) · ~6–9 hr

Side-effects need real approvals. Tool return values can lie — verify after write.

  tool call
     │
     ├─ read ──────────────▶ auto-allow (still log)
     ├─ write ─────────────▶ allow + verify-after
     └─ side-effect ───────▶ human “yes” required
                              (deploy, push, delete, …)

Learn before you build

Knowledge Why Refresh
Phase 2 allowlists Guardrails wrap tools
Least privilege Side-effect blast radius OWASP authz cheat sheet (skim)
Human-in-the-loop Approvals that matter Building effective agents
Verify-after-write Lying tools
Prompt injection / secrets Don’t leak keys Anthropic guardrails

References: Strengthen guardrails · OWASP LLM Top 10 · Essay

Todos

Pass when: side-effects need a real “yes”, and verify-after-write catches a lying tool.


Phase 5 — Planning

Topic Plan vs theater · Essay Planning Theater vs a Real Plan · Prior 0–1 (2 recommended) · ~4–11 hr

A plan is useful only if the harness updates it when blocked. A stale plan is theater.

  react-only                    plan-then-act
  goal → act → act → …          goal → plan.md → act → update plan
                                      │                │
                                   (ignored?)      (live state)

Learn before you build

Knowledge Why Refresh
Phase 1 stop conditions Plan is loop state
ReAct vs plan-and-execute Two strategies ReAct · Effective agents
Good eng plan (AC, risks) Avoid theater Your design docs
(Opt.) Graphs LangGraph LangGraph concepts

References: LangGraph · Essay

Todos

Pass when: updating the plan once prevents a rewrite — and you can spot a stale plan.


Phase 6 — Subagents

Topic Orchestrator + workers · Essay Subagents That Argue · Prior 0–2 (5 recommended) · ~5–13 hr

Two agents can burn tokens arguing. Log dual cost and add a skip rule.

                 ┌──────────────┐
                 │ orchestrator │
                 └──────┬───────┘
            ┌───────────┼───────────┐
            ▼                       ▼
     ┌────────────┐          ┌────────────┐
     │ researcher │          │   coder    │
     └────────────┘          └────────────┘
            │                       │
            └──────────┬────────────┘
                       ▼
              cost(A) + cost(B)  →  skip rule?

Learn before you build

Knowledge Why Refresh
Phase 1–2 Multiple harnesses
Orchestrator / worker Delegation Building effective agents
Dual token cost “Pay for both” Pricing
(Opt.) Chat bots OpenClaw OpenClaw channels

References: OpenClaw multi-agent · LangGraph multi-agent (opt.) · Essay

Todos

Pass when: you can show dual-cost numbers and a skip rule you’d actually ship.


Phase 7 — Eval

Topic Ship bar · Essay “It Worked Once in Chat” Is Not a Ship Bar · Prior 0–2 (4 recommended) · ~6–13 hr

One lucky chat is a demo. A ship bar is a fixed suite with intentional fails.

  evals/cases.json ──▶ runner ──▶ pass/fail report
         │                           │
    ≥10 fixed cases            ≥1 intentional fail
         │                           │
         └──────────▶ PR gate metric ┘

Learn before you build

Knowledge Why Refresh
Headless Phase 1 harness Many automated runs
Test / CI mindset Pass/fail Your Android CI
Golden fixtures Fixed cases Langfuse eval overview (skim)
Traces Debug runs Langfuse tracing

References: Langfuse docs · Essay

Todos

Pass when: report has ≥10 cases, ≥1 intentional fail, and a PR-gate metric you’d stand behind.


Phase 8 — Judgment & ops

Topic When agents make you slower · Essays Makes You Slower · Overnight PR Fantasy · Bot on PR · Prior 0–1, 4, 7 · ~6–10 hr

Overnight draft can be fine. Overnight merge is fantasy. Someone must own bot comments.

  night job
     │
     ▼
  draft PR / ticket ──▶ morning checklist ──▶ human merge?
     │
     ✗ auto-merge        (don’t)

Learn before you build

Knowledge Why Refresh
Phases 1, 4, 7 Judgment uses loop + safety + eval
Babysitting / opportunity cost Agents can slow you
Cron / n8n Overnight jobs crontab.guru · n8n docs
Draft PR ≠ merge Fantasy check GitHub PR flow

References: n8n docs · Slower · Overnight · Bot ownership

Todos

Pass when: you can name tickets where the agent babysits you — and who owns a bad bot comment.


Phase 9 — Context & RAG

Topic Wrong chunk, confident answer · Essay Wrong Chunk, Confident Answer · Prior 0–1 (3 recommended) · ~6–14 hr

Bad retrieval + high confidence is worse than “I don’t know.” Hooks set session context; RAG is optional.

  query ──▶ retrieve chunks ──▶ model answers
                  │
            wrong chunk
                  │
                  ▼
           confident wrong answer
                  │
                  ▼
           refuse / re-retrieve / cite

Learn before you build

Knowledge Why Refresh
Phase 1 system inject Hooks mutate context
Embeddings / vectors Retrieval HF embeddings chapter
Chunking tradeoffs Wrong chunk LangChain RAG tutorial · essay Prerequisites
Hallucination vs bad retrieval Diagnose confidence Reduce hallucinations

References: LangChain RAG · Open WebUI · Essay · Bot ownership (hooks in CI)

Todos

Pass when: you can demo wrong chunk → confident wrong → refuse / re-retrieve.


Phase 10 — Capstone (optional)

Topic Always-on team · Essay — (synthesis) · Prior 1–2, 4, 6–7 · ~7–17 hr

Optional. Convenience must not delete approvals (phase 4) or eval (phase 7).

Learn before you build

Knowledge Why Refresh
Phases 1–2, 4, 6–7 Capstone reuses them
Agent gateway / channels Always-on team OpenClaw docs
Claude as provider Auth + models OpenClaw Anthropic
(Opt.) Remote access Phone → gateway Tailscale KB

References: OpenClaw · Tailscale · Essays reading map below

Todos

Pass when: approvals and eval still exist — or you skip this phase because 1–9 already feel solid.



Phase 11 — Computer use & multimodal (optional)

Topic Browser / screenshot / voice as tools · Essay The Agent Clicked the Wrong Button · Prior 1–2, 4 · ~6–12 hr

DOM clicks and screenshots are a different tool class than read_file. Brittleness and page-borne injection dominate.

  goal ──▶ model ──▶ act on UI (click / type)
                │         │
                │         ▼
                │    screenshot / DOM
                │         │
                └──── observe ◀── page text can inject

The page is both sensor and attacker. Treat UI observations like untrusted tool returns.

Learn before you build

Knowledge Why Refresh
Phase 1–2, 4 Same loop + allowlist + approvals
Browser automation basics Computer-use tools Playwright intro (skim)
Prompt injection via content Pages/tickets lie Phase 4 injection todo · essay
Multimodal I/O Screenshot / voice as observation Essay

References: Anthropic computer use · Playwright · Essay

Todos

Pass when: you can demo UI thrash and page-injection refusal — or you skip this phase and stay on file/tools agents.


Essays (reading map)

Open after the matching lab, not before.

Phase Essay
1 The Agent Said Done — and CI Is Red · Spec Before the Agent Writes
2 Your Agent Has Too Many Tools (MCP + economics)
3 Forgot the Constraint · Monorepo Navigable to Agents
4 Agent Trust Boundaries (injection)
5 Planning Theater vs a Real Plan
6 Subagents That Argue
7 Eval Is Not a Demo (audit) · Spec essay
8 Makes You Slower · Overnight PR Fantasy (durable) · Bot on PR
9 Wrong Chunk, Confident Answer
10 On-Device Without the Mini Fantasy
11 The Agent Clicked the Wrong Button

Finish line

You’re done with this lab when you can:

  • Rebuild a harness (goal → model → tools → observe → stop) without a template paste.
  • Teach each linked essay’s claim, failure mode, and fix.
  • Defend tool surface, guardrails, eval bar, spec-before-code, and when not to use an agent.
  • Optionally demo computer-use thrash + injection refusal (Phase 11).
  • Optionally run the same loop shape against a local 7B — knowing quality isn’t the point.

Not a goal: matching Claude with a local 70B.