Ensemble · Auditable workspaces

Why AI agents need auditable workspaces

Git tracks the diff. h5i tracks the workspace behind it. An AI coding agent does far more than write the lines you finally merge, it reads files, runs commands, follows a prompt, weighs alternatives, hands work to other agents, and reaches out to the network. Git records none of that. An auditable workspace does: it is the place the agent works, and everything it does there is recorded in your repo and provable after the fact.

Key takeaways
  • An auditable workspace is the place an agent works plus the Git-native record it leaves: prompt, model, reasoning, commands, tests, risk, and handoffs.
  • The record maps to specific refs (notes, context, msg, env) and is written automatically by hooks, so capture is the default path, not a discipline.
  • It complements PR templates, CI artifacts, vendor transcripts, and SaaS audit tools. The difference is that the trail is yours, durable, and portable because it is Git.

You hand a task to Claude Code or Codex. Twenty minutes later there is a branch with a tidy diff. The diff looks fine. But the diff is the last thing that happened, the visible residue of a long operational session you never saw. What was the agent actually asked? Which files did it read and which did it ignore? What commands did it run, and what did they print? Could it have reached your secrets or the public internet? Which model produced this, steered by whose prompt? When a second agent picked up the work, what did the handoff say?

Git answers none of those questions, because Git was designed to version code, not to record the work that produced the code. For human authors that gap never mattered, the work lived in a person's head and their terminal, and we trusted the author. For autonomous agents the gap is the whole problem. The fix is not a better diff viewer. It is to make the workspace itself the unit of record.

The definition

An auditable workspace is the place an AI agent does its work, a Git-backed worktree where every prompt, decision, command, log, policy, and handoff is recorded in your repo and provable after the fact.

Concretely, the workspace is the sum of everything that went into a change, not just the change:

Workspace = worktree + prompt + model + commands + logs + policy + messages + PR evidence.

Two cautions are built into that wording. "Workspace" is a crowded word, the defense is the adjective auditable and the location in your repo. And no single feature is the identity: token reduction, a prompt score, a messaging channel are all properties of the workspace, never the point. The point is that the place an agent worked becomes a record you can replay, review, and trust.

The problem: agents do operational work Git never records

A commit is a snapshot of files plus an author, a timestamp, and a message. That model is a perfect fit for "a person deliberately saved this state." It is a poor fit for "an autonomous process spent an hour reading, deciding, executing, and negotiating, and this diff fell out the end." All of the high-signal, high-risk material, the intent, the tool output, the reach, the reasoning, happens off-ledger.

That off-ledger work is exactly what a reviewer needs and exactly what an incident responder wishes they had. "The agent refactored billing" is reassuring until you learn it was prompted with "make it work", ran a destructive migration you can't see, and could reach the production database the whole time. None of that is in the diff. It was in the workspace, and the workspace evaporated.

Naming the missing data is a category question. AI-aware version control covers what record a diff structurally can't hold and how to store it on top of Git. This post is narrower and more operational: it is about the place the agent works and the concrete artifact that place leaves behind. The category says record the process, not just the artifact; the workspace is where that record actually accrues, command by command.

Three proof pillars

"Auditable" is not a vibe; it decomposes into three concrete properties of the workspace. Each one answers a question the diff can't, and each is backed by data that lives in your Git refs.

PillarAnswersBacked by
ProvenanceWho asked, why, and what the agent knew.refs/h5i/notes, refs/h5i/context
ConfinementWhat it couldn't reach, provable.refs/h5i/env
GovernanceDeterministic audit & compliance, no model in the loop.h5i audit

The middle pillar is the one teams underrate. "The agent physically could not exfiltrate" beats "we logged it" every time, a log tells you what happened, a boundary tells you what could never happen. h5i's sandboxed worktree (h5i env) enforces that boundary with tiered isolation and a network egress allowlist, then records the policy alongside the evidence so the confinement itself is auditable.

The workspace stack

Put the pillars together and a workspace has a stack, each layer a command you actually run, each layer recording a different slice of the work:

Agent Workspace
Agent Workspace
├─ Sandboxed worktree        h5i env
├─ Prompt-aware commits      h5i capture commit
├─ Compressed tool logs      h5i capture run
├─ Agent handoffs            h5i msg
├─ Risk/audit signals        h5i audit
└─ PR evidence brief         h5i share pr

The sandboxed worktree is the hero, not feature number seven. It is the canonical auditable workspace and the command humans actually type. Everything above it accrues onto that worktree as the agent works.

The golden path

The pieces compose into one user journey, the same ordering everywhere:

golden path
env create  →  agent works (env shell / capture run)  →  capture commit (provenance)
            →  msg review  →  share pr  →  apply

In narrative form: open a workspace, hand it to an agent, let evidence accrue (commands, logs, prompts, handoffs), have a reviewer read the provable record on the PR, and the human applies or merges. The agent never touches your branch directly, it works inside a confined worktree, and a person applies its work after reading the evidence.

The moat: it lives in your Git

Everything above lives under refs/h5i/*, so it travels with the repository like any other Git data. No SaaS, no lock-in, works offline. Clone the repo and you have the workspaces; there is no separate service holding your audit trail hostage and no account to log into to find out what an agent did. The evidence is as durable and portable as the commits it explains.

That is also why the token-reduction claim ladders up to "auditable" rather than standing on its own: the workspace keeps raw logs out of the agent's context window, recoverable, not discarded, which is how it gets to ~95% lower token waste while still being able to show you the full output later.

How the record is captured: refs and hooks

"Recorded in your repo" is precise, not a metaphor. Each dimension of the workspace maps to a Git ref, and most of the writing happens automatically through editor hooks, not through commands you remember to run:

What is recordedWhere it livesHow it gets there
Prompt · model · agent · tests · integrity verdictrefs/h5i/notes (git notes)h5i capture commit; the prompt via the Claude UserPromptSubmit hook
Reasoning: OBSERVE / THINK / ACT / NOTE nodesrefs/h5i/contextPostToolUse and Stop hooks (or Codex session JSONL)
Tool output, compressed and content-addressedobject store (raw out-of-band)h5i capture run, optionally via the wrap-bash hook
Cross-agent handoffs and reviewsrefs/h5i/msgh5i msg (append-only, union-merged)
Sandbox policy and run evidencerefs/h5i/envh5i env on each run

The hooks matter as much as the refs. An audit trail an agent has to opt into is one it will forget under deadline; capture has to be the default path, not a discipline. h5i wires that with h5i hook setup: in Claude Code, SessionStart, UserPromptSubmit, PostToolUse (on every Read/Edit/Write), and Stop hooks record the prompt, the reads as OBSERVE, the edits as ACT, and mined THINK/NOTE reasoning, without the agent issuing a single logging command. Codex reconstructs the same record from its session JSONL. The verbatim human prompt wins over any agent-supplied --intent, so the record reflects what a person actually asked, not what the agent later claims it was asked.

Surfacing the record: a worked example

An audit trail is only worth keeping if you can read it back cheaply. The same workspace that captured the work exposes it through query commands, with no console and no export. Suppose a reviewer is staring at a one-line change in src/api/client.py and wants to know who and what produced it:

surface the record
$ h5i recall blame src/api/client.py --show-prompt  # line → author + model + prompt + test result
$ h5i recall log --limit 20                       # provenance per commit, most recent first
$ h5i notes uncertainty                            # where the agent flagged it was unsure
$ h5i audit review --limit 50                      # triage funnel: integrity Warnings/Violations
$ h5i audit compliance --since 2026-01-01 \
      --until 2026-03-31 --format html --output audit.html  # a dated, shareable report
$ h5i share pr post                                # the same evidence as a sticky PR comment

The shape of the answer is the point: recall blame turns "who wrote this line" into "which model, steered by which human prompt, with which test result," and audit review is a deterministic triage funnel, with no model in the loop grading the work, surfacing the commits whose stored IntegrityReport came back Warning or Violation. A reviewer reads the record, not the agent's self-report.

How it compares

Teams already reach for several tools to answer "what did the agent do?" Each captures a real slice; none captures the workspace. The honest comparison:

ApproachGoodGap
PR description templatesHuman-readable context right where review happens; zero new tooling.Self-reported and optional; the agent writes its own report card; nothing ties a claim to the prompt, the commands, or the tests.
CI logs & artifactsTrustworthy machine evidence that tests ran and passed at a point in time.Tied to a pipeline run, not to the prompt or the files the agent inspected; expires on a retention clock; says nothing about intent, reach, or reasoning.
Vendor session transcriptsRich, verbatim capture of the actual agent session.Lives in that vendor's console, tied to your account and their retention; not per-commit, not queryable, not portable across tools, and gone if you switch vendors.
SaaS audit / observability toolsDashboards, search, alerting across many runs.A separate system of record that holds your trail; another account, another egress of code metadata; the evidence no longer travels with the repo.
Auditable workspace (refs/h5i/*)Prompt, model, reasoning, commands, tests, risk, and confinement policy tied to each commit, in your own repo, query- and PR-ready, offline.Requires the refs to be shared (h5i share push); records what was captured, so coverage depends on hooks being wired.

None of these is wrong, and an auditable workspace does not replace CI or your PR template. It complements them by giving the per-commit, in-repo substrate the others assume but don't provide. The differentiator is the last column's first entry: the record is yours, durable, and portable, because it is Git.

Failure modes: where this breaks

A pillar should be honest about its edges. An auditable workspace fails in three predictable ways, and each has a mitigation rather than a denial:

What it is not

h5i is not a Git replacement, not a hosted SaaS, not just a sandbox, it's a Git sidecar for auditable agent workspaces.

It does not replace Git; it rides alongside it. It is not a cloud sandbox like a hosted dev environment, the confinement runs on your machine and the record lives in your repo. And it is not merely a sandbox: a sandbox confines, but an auditable workspace confines and records and makes the whole thing reviewable on the PR. Confinement is one of the three pillars, not the product.

Why this is the right unit

Code review evolved for a world where a trusted human authored every line and could answer for it in a hallway conversation. Agents broke that assumption: the author is a process, it can't be cross-examined later, and it operated with real capability over your machine and network. The honest response is not to trust harder or log more, it is to make the agent's entire workspace a first-class, Git-backed, provable artifact. Grade the work by the record it leaves, confine what it can reach, and let a human apply it after reading the evidence.

Frequently asked questions

What is an auditable workspace for AI agents? It is the place an AI coding agent does its work: a Git-backed worktree where the full record behind every change is captured in your repo: the prompt and intent, the model and agent identity, the reasoning the agent followed, the commands it ran, the tests that verified it, the risk signals, and the handoffs to other agents. Because the record lives under refs/h5i/* in the same repository as the code, the work is provable and reviewable after the session ends, with no separate SaaS.

Why isn't Git alone enough to audit an AI agent's work? A commit is a snapshot of files plus an author, timestamp, and message. It records the artifact, not the operational session that produced it. The prompt, the files the agent read, the commands it ran, the network it could reach, and the reasoning it followed all happen off-ledger and evaporate when the session ends. That off-ledger material is exactly what review and incident response need, so an auditable workspace records it as Git-native data alongside the diff. The category framing is AI-aware version control; why a diff isn't enough goes deeper still.

Where is the auditable record stored, and does git push share it? Git-natively: per-commit provenance as git notes on refs/h5i/notes, agent reasoning on refs/h5i/context, cross-agent coordination on refs/h5i/msg, and sandbox policy and evidence under refs/h5i/env. A plain git push does not move refs/h5i/*, so use h5i share push and h5i share pull to carry the record to another clone alongside the code.

How is the record captured without extra work from the agent? Hooks capture most of it automatically. In Claude Code a UserPromptSubmit hook records the verbatim human prompt, PostToolUse hooks log reads and edits as OBSERVE and ACT, and a Stop hook mines reasoning and checkpoints milestones; an optional wrap-bash hook rewrites shell commands into h5i capture run so tool output is recorded too. Codex mines the same record from its session JSONL.

How is this different from a CI artifact or a vendor session transcript? A green CI run proves tests passed for a pipeline run but isn't tied to the prompt or the files the agent inspected. A vendor transcript lives in that vendor's console, tied to your account, not portable or queryable per commit. An auditable workspace ties prompt, model, reasoning, commands, tests, and risk to each commit, stores them in your own repo, and makes them inspectable with recall, audit, and PR tooling, with no account to log into.

Try h5i on your next AI-assisted branch

Create a sandboxed workspace, capture the run, and post a review-ready PR brief.

Star on GitHub Back to docs