Skip to main content

Embed Vouch Credentials in .safetensors model headers for verifiable agent/principal provenance.

Project description

vouch-safetensors

Embed Vouch Credentials in a .safetensors file's existing __metadata__ header, with zero changes to the safetensors format.

This is deliberately complementary to OpenSSF Model Signing (OMS). OMS proves an artifact is intact and signed by a key. Vouch adds the agent and delegation dimension: which principal or pipeline produced the weights, traceable back to an accountable human. The credential is bound to a SHA-256 of the tensor data buffer, so any weight tampering breaks verification. Standard loaders (including Hugging Face) ignore the extra metadata key, so signed files load normally.

Install

pip install vouch-safetensors

Sign a model

from vouch import Signer
from vouch_safetensors import sign_safetensors

signer = Signer(private_key=PRIV_JWK, did="did:web:ml.acme.com")
credential = sign_safetensors(signer, "model.safetensors", name="fraud-detector")
# Writes the credential into model.safetensors __metadata__ (in place by default;
# pass out_path=... to write a copy).

Verify a model

from vouch_safetensors import verify_safetensors

ok, passport = verify_safetensors("model.safetensors", public_key=producer_pubkey)
if not ok:
    raise RuntimeError("Unsigned, invalid signature, or weights changed since signing")

verify_safetensors checks both the signature and that the tensor data still matches the digest the credential was bound to.

License

Apache-2.0.

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

vouch_safetensors-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

vouch_safetensors-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file vouch_safetensors-0.1.0.tar.gz.

File metadata

  • Download URL: vouch_safetensors-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for vouch_safetensors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91338f9f3971eadc2d79079801ec483c3fd47730557d9e42fe69c636059c2ed0
MD5 0a5be1eb6231319fc0b91795ef02f2be
BLAKE2b-256 c69c48efa09adbe35702e4543a863e8dfb4885850d21f6913d889baf90cfb609

See more details on using hashes here.

File details

Details for the file vouch_safetensors-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vouch_safetensors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3364861b978dd84578441d3ddc41af61425b99f08e5deb5ac68d794ccd0e2baa
MD5 f405e2a554c650f067a08a41933d6a53
BLAKE2b-256 a8840d9024172417e66303cada2705d2ceba10f0aef65bdd85665a8e547735f8

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