Case study 04 · AI UX Research Harness

An AI agent that follows the research process.

I turned a general AI coding agent into a research assistant that protects participant data, shows its evidence and stops for human approval. No new software, just plain files and clear rules.

  • RoleDesigner and builder
  • Timeline2026
  • ToolsClaude Code, Markdown, Python, Git
  • FocusAI workflows, research ops, privacy by design
raw/locked, never readLOCALREDACTIONP01, P02 ...AI AGENTContextActionsBoundariesPersistence3 REVIEWERSresearchevidencePII auditG1G2G3human approval at every gate
The harness at a glance. Raw data is locked, redaction is local, and a person approves at three gates. Illustration, not a screenshot.

Tested results

  • 11 / 11Guard hook unit tests passed, covering reads, searches, shell commands and sensitive writes
  • 17Fake identifiers in a synthetic transcript, all redacted while the meaning stayed intact
  • 3 / 3Live acceptance tests passed inside the agent: refusal, resume and reviewed synthesis

The idea

The model is one part. The system around it is what makes it reliable.

Context, actions, boundaries and persistence. That is the harness, and it is what I designed.

01 / The problem

AI can speed up research. Sensitive data makes it risky.

  • It sees too muchA general chat can read participant details the moment a transcript is pasted in.
  • It inventsQuotes, counts and confident findings that no session ever contained.
  • It forgets and skipsIt skips the research process and human sign-off, and loses track of where a study stopped.

The full story

Why a general AI chat is the wrong tool for sensitive research.

Product teams want AI to help with the slow parts of research: plans, discussion guides, synthesis and readouts. But when a study involves sensitive user data, a general AI chat is a poor fit. It can see participant details. It fills gaps with quotes and counts that nobody said. It skips the steps a research process exists to protect, and it forgets where the study left off.

I did not want a smarter prompt. I wanted a working environment where the safe path is the default one.

Where the idea came from

The framing comes from Aish Reganti's talk on harness engineering. Her point: the model is one component, and the system around it, its context, actions, boundaries and persistence, decides whether it can be trusted. The talk builds a Python agent with LangGraph Deep Agents.

I applied the same idea with no new software. I configured Claude Code inside a folder of plain Markdown files that acts as the team's shared brain. Rules, skills, scripts and reviewers all live there as readable files, so a researcher can open and change any of them.

02 / The four pillars

A harness has four parts.

  • 01ContextWhat the agent knowsA rules file loaded on every run: users, non-negotiables, workflow and research lenses.7 skills, one per step: resume, plan, guide and screener, ingest, synthesis, readout, heuristic review.
  • 02ActionsWhat it can doTwo local scripts: one creates and tracks studies, one redacts personal data on the local machine.3 reviewer sub-agents: research reviewer, evidence checker, PII auditor.
  • 03BoundariesWhat it can never doIt can never read the raw folder, enforced by two independent locks.Three human gates. Approval before writing to shared knowledge. Read-only roles for stakeholders.
  • 04PersistenceHow it remembersOne folder per study, with a checkpoint block updated after every step.An insight library of evidence-backed insights, reused across studies.

The workflow

One study, from brief to insight library.

  1. Plan
  2. G1
  3. Fieldwork
  4. raw (locked)
  5. Redact
  6. Sessions
  7. Synthesis
  8. Reviewers
  9. Readout
  10. G2
  11. Insight library
  12. G3

Highlighted blocks are human gates. The dashed block is raw data, which the AI never reads.

In use

No commands. Just plain language.

  1. 01Start and planStart a UX study about the topic. Then: plan the study. I review the plan and approve it at G1.
  2. 02Prepare the fieldworkWrite the guide, screener and consent. The research reviewer checks for leading questions, missing segments and consent gaps.
  3. 03Run sessionsI run the sessions myself and drop the recordings into the private raw folder.
  4. 04Process the sessionsLocal redaction runs first, then the PII auditor checks what was missed. Only redacted session notes reach the AI.
  5. 05Synthesise and write the readoutThe evidence checker traces every finding, count and quote back to the notes. I approve the readout at G2 and the library entries at G3.
  6. 06Resume any timeResume the study. The agent reads only the checkpoint and proposes the right next step.

03 / Privacy by design

Layers between raw data and the AI.

  1. Raw dataRecordings and transcripts, named by participant ID only and kept out of Git. Folder listings can leak file names, so names carry nothing.
  2. Permission deny ruleThe agent is configured so reads of the raw folder are refused before anything runs.
  3. Guard hookAn independent check blocks reads, searches and shell commands on raw files, and blocks writes that contain ID numbers, phone numbers, emails, or card or account numbers.
  4. Local redaction scriptRuns on the local machine. Names become P01, P02. Phone numbers, emails, ID numbers, card and account numbers, addresses, postcodes and dates of birth are removed.
  5. PII auditor agentA reviewer on a smaller, cheaper model that catches personal data the script missed.
  6. Human checkA person confirms the redacted notes before synthesis starts.

Human in the loop

Three gates, signed with a name and a date.

G1 · PlanI approve the research plan before any fieldwork guide is written.
G2 · ReadoutI approve the readout after the evidence and privacy checks pass.
G3 · LibraryI choose which insights enter the long-term library. Synthetic ones never do.
Flag, do not judgeLegal or policy concerns are flagged for the right experts. The AI does not rule on them.

Persistence

A study that remembers where it stopped.

study-name/
  STUDY.md      checkpoint + status
  plan.md
  raw/          private, not in Git
  sessions/     redacted notes
  synthesis/
  readout/

Checkpoint (illustrative)

StudyOnboarding screen comprehension

StageSessions processed

Last doneRedaction and audit, 5 notes

Next actionSynthesise themes

Waiting onG1 sign-off recorded

Long transcripts are summarised once into session notes, so the context stays lean. The scenario above is fictional.

04 / Testing

Every layer tested on its own.

  1. 01Guard hook unit tests11 of 11 cases correct.
  2. 02Redaction testA synthetic transcript with 17 fake identifiers was fully redacted while keeping the meaning.
  3. 03Live acceptance test, 3 of 3 passedA request to read a raw transcript was refused. Resume read only the checkpoint and proposed the right next step. Synthesis ran with both reviewer agents and their fixes were applied.

What I learned

Six things the harness taught me.

  1. 01Each layer needs its own testDefence in depth works. But the permission rule fired before the hook, so the hook had to be proven separately.
  2. 02Two reviewers can disagreeThe evidence checker wanted the participant segment described in full, to show scope. The PII auditor wanted it withheld, because with one participant it could identify them. The rule I wrote: for N of 3 or fewer, describe segments broadly and always state N = 1. A real research ethics tension, encoded as a rule.
  3. 03Sensitive numbers go in bandsExact figures a participant mentions stay only in the redacted session note. Synthesis and readouts use ranges.
  4. 04Name raw files by participant ID onlyFolder listings can show file names even when the contents are blocked.
  5. 05Rehearse with synthetic studiesI ran full studies on AI-written fictional personas, clearly labelled and barred from the insight library, to test the process. In one rehearsal the evidence checker caught an unsupported finding about suspicious links in a notification, because the test notification had no link.
  6. 06The product is the operating systemNot the prompts. Rules, gates and checkpoints are what let a team trust the output.

What is next

A fully local version. Not built yet.

The same skills, rules and reviewers can move into a fully local agent, using LangGraph Deep Agents and a local model through Ollama. That would suit teams that cannot send even redacted data to a cloud AI. It would also suit a team setup with branch protection and code-owner review on the insight library.

Built for an internal team; details generalised for confidentiality.

05 / Outcome

A general AI agent now behaves like a research assistant: it follows the process, protects participant data and stops for human approval.

AI workflows · Research ops · Privacy by design