Proof of what an AI agent was allowed to do, and what it then did. A passkey-signed permission with limits a machine can check, a signed receipt for each action, and a checker. Evidence, not a verdict.
pip install provared==0.3.0 Copy PIP instructions
This is the Python version of Provared. The format, the reasons for it and what a record does and does not prove are described in the repository's own README, the format description and the list of threats. This page says only what is particular to Python.
Version 0.3.0, a draft, the same version as the JavaScript library. Published as it is, by one author in their own time; fixes as time allows. It gives the same answer, case for case, as the shared test files in test-vectors/ show: the same result, the same codes and the same words. Every shared file passes in both languages.
One difference is stated, not hidden. The one package this version needs, cryptography, does not yet have SLH-DSA (FIPS 205), the method of a seal's third signature. So a seal's third signature is reported as "not checked on this device", and never as a pass, as the checking page in a browser reports it. Seals are checked in full by the JavaScript command-line checker.
pip install provared Or, from a copy of the repository, pip install ./python.
You need Python 3.11 or later. The one dependency is cryptography, version 48 or later: Python has no signatures built in, and version 48 is the first whose ready-built packages hold ML-DSA (FIPS 204).
The permission is signed with a development stand-in for a passkey (provared.dev): a key made in memory, which no person confirmed. Every permission it signs says so in its issuer's name, and a checker shows that name. A real permission is signed by a person, in a browser, with a real passkey (the browser part of the JavaScript library, and the checking page).
from provared import check_book from provared.dev import development_recorder SEND = 'provared.message.send' # A permission: the agent may send messages, at most two. made = development_recorder({'actions': [SEND], 'limits': [{'action': SEND, 'count': 2}]}) # Each action is asked for first, taken only if the permission allows it, # and receipted after. The third message is outside it, so it is not sent. for i in range(1, 4): outcome = made.writer.act({'action': SEND}, lambda i=i: print(f'message {i} sent')) if not outcome['done']: print(f"message {i} not sent: {outcome['answer']['breaches'][0]['message']}") book = made.writer.book() # the record, one entry to a line summary = check_book(book, issuer_keys=made.issuer_keys)['summary'] print(summary['intact'], summary['withinSlips']) # True True The whole file is examples/first_record.py. development_slip(fields) gives the signed slip, its fingerprint, a book holding it, the stand-in's thumbprint (issuer_keys) and the agent's keys without opening the writer; development_passkey() gives the stand-in alone, whose sign(challenge) signs a prepared slip, approval or cancellation. The issuer's name always ends with " (development)", whatever name is given.
from provared import check_book with open('record.jsonl', encoding='utf-8') as f: result = check_book(f.read(), issuer_keys=[' ']) summary = result['summary'] print(summary['intact'], summary['withinSlips'], summary['firstBreach']) The answer is the same JSON as the JavaScript library gives (see "What the checker returns" in the repository's README).
from provared import check_before answer = check_before(book_text, { 'slip': slip_fingerprint, 'action': 'supplies.order', 'amount': {'unit': 'GBP', 'value': 20}, 'with': 'supplier', }, issuer_keys=[passkey_thumbprint]) if not answer['allowed']: print(answer['problems'], answer['breaches']) Beside an agent, the stub writer asks the check before acting, takes the action only if the answer is yes, and writes the stub (see "Beside an agent" in the repository's README):
from provared import open_recorder writer = open_recorder(book_text, slip_fingerprint, private_keys, issuer_keys=[passkey_thumbprint]) result = writer.act( {'action': 'supplies.order', 'amount': {'unit': 'GBP', 'value': 20}, 'with': 'supplier'}, lambda: place_the_order(), ) book_text, held = writer.snapshot() # keep both together, with the book Every call is an ordinary function. A writer's calls wait for one another, also across threads. The other side is asked in a thread of its own and given 30 seconds. An asynchronous agent calls the writer through asyncio.to_thread. A call to the writer from inside an action it is taking is refused at once, from the same thread or from a thread that carries the action's context; from a new thread that the action starts without it, the call waits until the action ends, so an action must not wait for such a call. record_tools puts an agent's tools behind the writer. record_function puts one ordinary function behind it and keeps the function's name, parameters and description, so that an agent framework describes it to its model as it would the function:
Names follow Python's way (check_book, write_stub). Options may be given as keyword arguments (issuer_keys, expected_root, stamp_services, seal_keys, vouchers, disclosures, cancellations, without_methods), or as one dict with the names the JavaScript library uses (issuerKeys and so on). Records and answers are dicts and lists, with the same member names as in the format.
provared.check holds the checker alone, for anyone who audits the checking.
python -m venv .venv .venv/bin/pip install "cryptography>=48" # on Windows: .venv\Scripts\pip PYTHONPATH=src .venv/bin/python -m unittest discover -s tests The tests read the shared test files in ../test-vectors/, which the JavaScript library writes (node tools/make-vectors.mjs) and checks (node --test test/vectors.test.mjs).
As for the rest of the repository: the Apache License 2.0 for the code, and Creative Commons Attribution 4.0 for the documents.
Apache-2.0 AND CC-BY-4.0 View SPDX License List
ai-agent agent audit-trail permission authorization receipt tamper-evident passkey webauthn jws ed25519 ml-dsa post-quantum evidence langchain
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




