AgentVault Core Library (agentvault)
This directory contains the source code for the core agentvault Python library.
Purpose:
This library provides the foundational components for interacting with the AgentVault ecosystem:
- Implementation of the client-side Agent-to-Agent (A2A) protocol (AgentVault A2A Profile v0.2 - JSON-RPC/SSE).
- Support for formatting and embedding Model Context Protocol (MCP) payloads within A2A messages.
- Secure utilities for managing local API keys and OAuth 2.0 Client Credentials needed for authenticating with remote agents (via Environment Variables, Secure Files, or OS Keyring).
- Tools for parsing and validating A2A Agent Cards.
Key Modules:
client.py: Contains the mainAgentVaultClientclass for managing A2A connections and task lifecycles.key_manager.py: Implements theKeyManagerclass for secure local API key and OAuth credential handling.agent_card_utils.py: Provides functions for loading and validating Agent Card JSON.mcp_utils.py: Contains helpers for formatting MCP context data.models/: Pydantic models defining Agent Card structure, A2A protocol messages/events, and internal data structures.exceptions.py: Defines custom exception classes used throughout the library.
Protocol Considerations (AgentVault A2A Profile v0.2)
- A2A Protocol Version: This version implements the AgentVault A2A Profile v0.2, which uses JSON-RPC 2.0 over HTTPS POST for requests (
tasks/send,tasks/get,tasks/cancel,tasks/sendSubscribe) and Server-Sent Events (SSE) for receiving asynchronous updates from the agent via thetasks/sendSubscribeendpoint. Clients should checkAgentCard.capabilities.a2aVersion. - Task States: Uses the defined
TaskStateenum (SUBMITTED,WORKING,INPUT_REQUIRED,COMPLETED,FAILED,CANCELED). - Authentication: Supports
apiKey(viaX-Api-Keyheader),oauth2(Client Credentials Grant flow usingtokenUrlfrom Agent Card), andnone. TheAgentVaultClienthandles retrieving credentials via theKeyManagerbased on theauthSchemesin the Agent Card. - Push Notifications: The client can optionally provide a
webhook_urlduring task initiation if the agent declaressupportsPushNotificationsin its capabilities. The client is responsible for handling incoming requests to this webhook. - MCP Support: Includes basic support for embedding Model Context Protocol data. The
mcp_utils.pymodule provides initial formatting, and theAgentVaultClientembeds the resulting dictionary intomessage.metadata['mcp_context']. This implementation will be refined to align with the official MCP specification as it stabilizes.
Installation:
This library is intended to be used as a dependency by applications like agentvault-cli or your own custom integrations.
# Install from PyPI (once published)
pip install agentvault
# Install optional OS Keyring support
# pip install agentvault[os_keyring]
# Install locally for development (from the agentvault_library directory)
# Ensure root .venv is created and activated first (see main project README)
pip install -e ".[os_keyring,dev]"
Usage:
See the main project documentation and user guides for detailed usage examples. Basic interaction involves:
- Instantiating
KeyManagerto load necessary API keys or OAuth credentials. - Loading/Fetching an
AgentCardmodel usingagent_card_utils. - Instantiating
AgentVaultClient. - Calling methods like
client.initiate_task(optionally providingwebhook_url),client.send_message,client.receive_messagesusing the loadedAgentCardandKeyManager.
Development:
See the main project README.md for contribution guidelines and development setup. Tests are located in agentvault_library/tests/library/.
Future Enhancements (Ideas):
- Full alignment with finalized A2A and MCP specifications.
- Support for additional authentication schemes (e.g., other OAuth flows).
- Client-side configuration file support (e.g.,
~/.config/agentvault/config.toml) for setting defaults like registry URL, timeouts, etc. - Helper functions for common agent interaction patterns.
- WebRTC support for multimodal interaction (Phase 3).
Metadata
Release files for agentvault 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentvault-0.2.1.tar.gz | 28.7 kB | Without provenance | Details for agentvault-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentvault-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for agentvault-0.2.1-py3-none-any.whl |
Total release size: 59.9 kB
Release files / agentvault-0.2.1.tar.gz
| Download URL | agentvault-0.2.1.tar.gz |
|---|---|
| Size | 28.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35fae69f31c0f7ce0ffacc6ec75a2f5463fbdac9fde18a13f0ac13f7f3590895
|
|
BLAKE2b-256 checksum How to use checksums |
bede590d54c734c7ed95f7eee8d54fdcfea69b38c148f13e58a25d5f3e28fec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.11.0 Windows/10
|
Release files / agentvault-0.2.1-py3-none-any.whl
| Download URL | agentvault-0.2.1-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19346e5e051dba243c1d13580f688c70bfee4ad702156a85aafa4c0513d44b08
|
|
BLAKE2b-256 checksum How to use checksums |
2a0f28021a23176ee199c6053260064906ae05d7a1fe9686da73adf7da20a4d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.11.0 Windows/10
|
Security for agentvault 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.