Skip to main content

LangChain tool that issues Vouch Credentials to authorize AI agent tool calls.

Project description

vouch-langchain

A LangChain tool that issues Vouch Credentials, so a LangChain agent can cryptographically authorize the tool calls it makes.

Each signed call carries a W3C Verifiable Credential with an eddsa-jcs-2022 Data Integrity proof, and optionally a delegation chain back to an accountable human principal.

Install

pip install vouch-langchain

This pulls in vouch-protocol[langchain].

Configure

The tool reads two environment variables:

  • VOUCH_PRIVATE_KEY the agent's private key (JWK JSON string).
  • VOUCH_DID the agent's DID, e.g. did:web:agent.example.com.

Use

from vouch_langchain import VouchSignerTool

tool = VouchSignerTool()  # reads VOUCH_PRIVATE_KEY / VOUCH_DID
credential_json = tool._run(
    action="read",
    target="https://api.example.com",
    resource="customer:123",
)
# Attach credential_json as a 'Vouch-Credential' header on your request.

Add tool to any LangChain agent's tool list. The agent calls it before an authenticated request and forwards the credential to your service.

Verify on the receiving side

from vouch import Verifier
ok, passport = Verifier.verify_credential(received_json, public_key=agent_pubkey)

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_langchain-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

vouch_langchain-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vouch_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vouch_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8d406bc883db71fa80200f3298218f4fdb0efa26059d996c35d986143402696
MD5 883332add7d300fb390bf41672690b79
BLAKE2b-256 4999ea784d23c683b95dc22720e5b71a362d07098332dbe4e455d246cd8373e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for vouch_langchain-0.1.0.tar.gz:

Publisher: publish-pypi.yml on vouch-protocol/vouch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vouch_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7769ffdd0ddd75452ce94c34338c06554546523d9fece12a6de0a7c706e159af
MD5 8cb557e3f56a3a1488587202b4c80f78
BLAKE2b-256 c342bf511acabe9875ceefa9a2e2a179cc70144767ef0d4129a58fb09400f8b3

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