Skip to main content

Zu Shadow: author a production agent by demonstration — record a human session, redact at capture, synthesize an agent + rail (§2.8)

Project description

zu-shadow — author an agent by demonstration (§2.8)

A Shadow recording is the event bus run over a human session: the human is the policy for that one run, so recording costs almost nothing architecturally. You drive the task once, by hand; Shadow folds your clicks, types, navigations and the page/network metadata into data.shadow.* events on the same append-only log everything else in Zu uses, then synthesizes a production agent + a rail from it.

record (human session) ─▶ redact-at-capture ─▶ data.shadow.* on the log
                                                     │
                              synthesize (a Zu agent, ScriptedProvider offline)
                                                     │
                       agent spec + induced Fsm + Invariants + self-writing egress
                                                     │
                      verification-replay GATE (reuses zu-cli offline.py/build.py)
                                                     │
                          promote only if the recorded outcome reproduces

Four load-bearing disciplines

  • Redaction is DEFAULT-ON and runs BEFORE append (redaction.py). Passwords, Authorization/Cookie/Set-Cookie headers, token/API-key shapes, and consumer-configured PII are stripped — including the "why" intent text — before any event reaches EventSink.append. The secret is gone before the event is hashed into the audit chain. This is conformance requirement ZU-AUDIT-4.
  • Capture is SEMANTIC (capture.py). Every action is named by its target's {role, name, label} (the core zu_core.surface currency, shared with the §4 locator and §5 SurfaceView) — never a CSS selector or pixel coordinate, so the synthesized agent re-resolves on a changed page instead of breaking.
  • The synthesizer is a Zu agent (synthesizer.py). It is driven by a ModelProvider (offline-tested with ScriptedProvider). The model writes only the policy prompt + goal; the egress allowlist, the induced Fsm, and the Invariants are derived deterministically from the log — the egress allowlist writes itself from the recorded network.response hosts. No new FSM/invariant types: it emits zu_core.reachability.Fsm and zu_core.invariants.Invariant.
  • Promotion is GATED by reproduced outcome (replay_gate.py). A synthesized agent does not run on real data until it reproduces the recorded outcome, reusing zu-cli's offline.py/build.py. The "why" resolutions are surfaced for review, never auto-promoted.

The honest scope

Robustness comes from the runtime machinery — semantic re-resolution, detectors, replay, the rail — not from a single recording. On a structurally different site the honest behaviour is to escalate, not silently err. The live human recorder (real Chromium + a real human over CDP) is demo/manual, behind the live extra and a manual entrypoint (live.py); the offline core is fully tested against a synthetic input/CDP stream at $0.

CLI

zu shadow record   <stream.json> --site <url> -o recording.json   # synthetic/live stream → recording
zu shadow synthesize <recording.json> --instruction "…"           # recording → agent + rail proposal
zu shadow scale    <agent> --rows rows.csv --var <name>           # one governed run per CSV row

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zu_shadow-0.1.13.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zu_shadow-0.1.13-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file zu_shadow-0.1.13.tar.gz.

File metadata

  • Download URL: zu_shadow-0.1.13.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_shadow-0.1.13.tar.gz
Algorithm Hash digest
SHA256 cccd16e458669a9eff878f48aea858d3fa3fb5259b98cfb6e8e485b9ea8d8ac7
MD5 90d92e35ad75d6a9c1f31205ccd8e669
BLAKE2b-256 9631a14fd2107e93db719787547fe7bcbf40f6312a375a9bb5404ed740e9c5a7

See more details on using hashes here.

File details

Details for the file zu_shadow-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: zu_shadow-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_shadow-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8c4b5105acde6a4a7a28216b70171f16536ef6836b69912bd652c656273af4
MD5 beb43c71391aa32caeb3b3ac9c21f540
BLAKE2b-256 62372f41b5350f099f0fad16ba9eec91f692b57862afe7d94e5e004f70e20bba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page