wire-harness

command
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

wire-harness — the reproducible, recordable end-to-end proof that a wrapped agent CLI's provider traffic is governed by rysh (design 001, Phase 0/1 definition-of-done item 3).

WHY THIS EXISTS, given internal/proxy already has a wire test ------------------------------------------------------------- TestWireTest_PlantedSecretNeverLeaves posts to the proxy with http.Post. That proves the proxy REDACTS. It does not prove the thing the product actually claims: that pointing a third-party CLI at rysh via ANTHROPIC_BASE_URL causes that CLI's traffic to be governed. The env-injection path — the whole mechanism — is untested by it.

This harness closes that gap. It:

  1. starts a fake upstream that appends every request body it receives to wire.log (this is the "wire": bytes that left the machine);
  2. starts the REAL internal/proxy in front of it, with a REAL SecretNAT manager;
  3. exports ANTHROPIC_BASE_URL exactly as pane_shell.go does (<base>/anthropic/<paneID>) and runs a client under it;
  4. asserts on wire.log: the planted secret appears ZERO times, and a sk_live_SNAT… token appears in its place;
  5. writes an asciicast v2 recording of the run.

WHAT IT DOES AND DOES NOT PROVE ------------------------------- -client=builtin (default) exercises the full proxy + SNAT + env-injection path using a small client that reads ANTHROPIC_BASE_URL the way a CLI does. It proves the mechanism. It does NOT prove any particular vendor CLI honours that variable.

-client=real runs an actual external binary (-cli, default "claude"). Only this mode proves the vendor CLI is governed. The report says which mode ran; do not quote a builtin run as "Claude Code was governed".

Usage:

go run ./cmd/wire-harness                       # builtin client
go run ./cmd/wire-harness -client=real          # real `claude`
go run ./cmd/wire-harness -out ./evidence       # where wire.log + .cast land

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL