npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zanii/data-custody

v0.2.0

Published

Prove what happened to the DATA an agent touched - every touch of a user's document, where it went, and when the original was destroyed. NOT supply-chain @zanii/custody (physical goods). A custody record is a Proof receipt with the data ref as its subject

Readme

@zanii/data-custody

Prove what happened to the DATA an agent touched — every touch of a user's document, where it went, and when the original was destroyed. A page the user can verify without trusting the operator.

Not @zanii/custody. That package is supply-chain custody (co-signed handoffs of physical goods). This is data custody — what an agent did with a bank statement, an ID, a message.

npm install @zanii/data-custody @zanii/core
import { deriveRef, buildTouch, verifyObjectChain, custodyView } from '@zanii/data-custody';

// 1. every document gets a versioned, content-free ref (this becomes the subject_tag):
const ref = deriveRef('bank-statement-42', tenantCustodyKey);   // hmac:v1:…

// 2. each touch is a receipt whose TARGET is data.<class>.<op> — so scope = purpose:
const t = buildTouch({ ref, dataClass: 'financial.statement', op: 'read', ts: now,
  junction: { to: 'anthropic', agreement: 'zero-retention-v3' } });
await zanii.record({ target: t.target, payload: t.payload, subjectTag: t.subjectTag });

// 3. the user (or anyone) verifies every touch of THEIR object, offline:
const touches = /* from GET /v1/subjects/{ref}, operator reveals each payload */;
const r = verifyObjectChain(touches, { ref });   // { ok, error, failedIndex } — never throws
custodyView(ref, r.touches);                      // "your data, right now" — agents, ops, destinations, destroyed_at

Python: from zanii.data_custody import derive_ref, build_touch, verify_object_chain, ...byte-identical ref derivation (locked vector).

Zero server changes — the "one network" rule

A custody record is not a new object: it's a Proof receipt with the data ref as its subject_tag. Same agent DID, same per-agent hash chain, same Merkle batch, same anchor. It verifies with verifyReceiptChain unchanged, writes via the existing /v1/receipts, and its touches are read via the existing tag-agnostic GET /v1/subjects/{tag}. No separate custody log, no custody anchor, no special verifier. That's the moat — DSPM vendors have the data movement and have never seen a delegation cert; agent-governance tools have the agent and can't say what happened to the data. Both live in one signed record because it is one record.

Purpose binding with zero new logic

The touch receipt's target is data.<class>.<op> (e.g. data.pii.customer.read), so the ledger's existing scope check enforces purpose at record time: a delegation scoped data.pii.customer.read physically cannot produce a …export receipt. Not "we watched and it behaved" — "it had no power to do otherwise, verify the certificate yourself." purposeAllows() mirrors the check client-side.

The limit, stated up front — the party being audited is us

We run the servers, so a log we control is our word, not evidence. This package proves what was recorded, and that the record is unrewritten and publicly anchored. It does not by itself prove we never took an off-record copy — that needs an attested enclave (@zanii/attest: only the published image hash ever sees plaintext). A ref commits an identifier, never content; the ledger holds hashes only. And never render "we were not looking" as "nothing happened" — a gap in the touch history is unknown, not clean.