Skip to main content
Glama
README.md
<p align="center"><img src="assets/botvow-logo.jpg" alt="BotVow logo: an outlined cube with an orange seal and a check mark" width="520"></p>

# BotVow — the black box for Bots

**BotVow ("the bot's vow") is an open, tamper-evident record of what two Bots agreed: who agreed what, who authorised it, and when — co-signed by both and verifiable by anyone with nothing but public keys.**

- **Bot 2 Bot at the core.** BotVow is built first for Bots recording the agreements they make with each other.
- **An open door, with the same rules.** Agents from other AI platforms (OpenAI, Google, Anthropic, open source, …) may also record agreements in the black box — but only by following exactly the same rules. No own rules, no extensions that change the rules, no exceptions. The verifier rejects anything else, even if every party signed it.
- **Tiny and open.** One JSON format, one ~200-line verifier, Ed25519 + SHA-256. No account, no central server, no blockchain. MIT code, CC BY 4.0 spec, and a [no-patent pledge](NO-PATENT.md).

> **What this is not.** BotVow is evidence, not a notary, a timestamping authority or a contract. It shows that the listed keys signed the listed content in the listed order. It does not prove who controls a key, that every message was recorded, or that a summary is true.

## 30-second example: create and verify a receipt

Two parties, one file, one receipt. Only the SHA-256 of the file is stored, not the file itself. Keep the private keys on this machine.

```bash
pip install -r requirements.txt

python3 tools/botvow.py keygen --name "Inspector Demo Bot (fictional)" --out /tmp/inspector.key.json
python3 tools/botvow.py keygen --name "Client Demo Bot (fictional)" --out /tmp/client.key.json

python3 tools/botvow.py create   --key /tmp/inspector.key.json --key /tmp/client.key.json   --payload examples/two-agents/inspection-report.txt   --summary "Inspector Demo Bot delivered the inspection report to Client Demo Bot."   --out /tmp/receipt.json

python3 tools/botvow.py verify /tmp/receipt.json
# VERIFY OK
# head <64 hex characters>
```

When the two keys are on different machines, each party keeps only their own key. See [`examples/two-agents/run.sh`](examples/two-agents/run.sh). Agents can call the same steps through the local MCP server: `python3 tools/mcp_server.py` (`create_vow`, `verify_vow`). Instructions: [AGENTS.md](AGENTS.md), [llms.txt](llms.txt). Policy: [POLICY.md](POLICY.md).

## Quick start (built-in samples)

```bash
./run_demo.sh                     # build samples, verify, tamper tests, same-rules tests, unit tests, schema
python3 tools/botvow.py verify examples/bot2bot-log.json                   # VERIFY OK, exit 0
python3 tools/botvow.py verify examples/open-door-log.json                 # VERIFY OK (Bot + agent of another AI)
python3 tools/botvow.py verify examples/bot2bot-log-tampered.json          # REJECTED, exit 1
python3 tools/botvow.py verify examples/open-door-own-rules-rejected.json  # REJECTED: own rules not allowed
python3 tools/botvow.py verify LOG.json --head <hex>                       # also compare with a published head hash
```

## How it works

| Element | Rule |
|---|---|
| Chain | Ordered JSON entries, each with exactly the fields in [`schema/record.schema.json`](schema/record.schema.json) |
| `genesis` | Entry 0. Lists the parties (key id, name, Ed25519 public key, `kind`: `bot` or `agent`, optional platform and A2A Agent Card). Signed by all parties |
| Other entries | `proposal`, `counter`, `agreement`, `amendment`, `termination`, `seal` — nothing else |
| Co-signing | `genesis`, `agreement` and `seal` must be signed by **all** parties |
| Hash chain | `prev_hash` links every entry to the previous one; `entry_hash` covers content and signatures |
| Same rules | `own_rules`, `exceptions`, `rules_override`… are rejected, unknown types and extra fields too |
| Privacy | Raw messages are never stored, only their SHA-256; summaries only with both parties' consent |

Full rules: [SPEC.md](SPEC.md). Policy: [POLICY.md](POLICY.md). Plans: [ROADMAP.md](ROADMAP.md). Overview: [docs/overview.md](docs/overview.md).

### Tests in `run_demo.sh`
Bot 2 Bot log verifies · privacy (no raw messages) · selective disclosure · edit · edit + rehash · delete · reorder · outsider key · drop seal · single signature · edit genesis · **open door: Bot + agent of another AI verifies** · **agent adds its own rules/exceptions (even co-signed): rejected** · **agent invents its own entry type/field: rejected** — plus unit tests in `tests/` and the two-agent delivery example in `examples/two-agents/`.

## Samples
All parties and keys are **fictional**. Demo keys come from fixed public seeds so the output is reproducible — **never use them for anything real**.

## Works with A2A, MCP and HTTPS
A BotVow chain is just JSON, so it can travel as A2A task metadata, be produced and checked by an MCP tool, or be posted over plain HTTPS. Parties can link their key to an A2A Agent Card.

A local MCP server (`python3 tools/mcp_server.py`) exposes `create_vow` and `verify_vow` over stdio. It does not keep receipts for you: you keep the JSON, and you can verify it later without the server. The Agent Card is at [agent-card.json](agent-card.json) and at https://botvow.org/.well-known/agent-card.json.

## Modules

Two optional modules live under [`modules/`](modules/). They are not part of the verifier; they are small, standard-library tools that work with the same agent formats BotVow already mentions (A2A, MCP, email).

- **[Protocol translator](modules/translator/)** — rewrite a request, response, error or task between MCP, A2A 1.0, A2A 0.3 and plain email, without ever executing it. 18 tests in `modules/translator/tests/`.
- **[Local Agent Card](modules/agent-card/)** — a small profile (`local-agent-card/0.1`) so a shop, café or lodging can publish hours, dated prices and booking rules, and export them to an A2A Agent Card, schema.org JSON-LD and llms.txt. The two example cards are **FICTIONAL** and labelled as such. 10 tests in `modules/agent-card/tests/`.

## Related work

BotVow builds on, and is narrower than, existing work: Google AP2 mandates (payments), A2A signed Agent Cards, IETF drafts on co-signed agent agreements and bilateral attestation, the Open Agent Protocol, and agent-receipt projects. See [docs/overview.md](docs/overview.md) for links.

## Licence
Code: MIT. Specification, docs, schema and examples: CC BY 4.0. See [LICENSE](LICENSE) and [NO-PATENT.md](NO-PATENT.md).

---

## Em português

O **BotVow** («a promessa do bot») é a caixa negra dos Bots: um registo Bot 2 Bot, inalterável e verificável, do que dois Bots combinam (quem combinou o quê, quem autorizou e quando), assinado pelos dois. Os Bots são o núcleo. Agentes de outras IA também podem registar acordos, mas **têm de seguir as mesmas regras**, sem regras próprias nem exceções; o verificador recusa tudo o resto. Documento do projeto: [docs/projeto-botvow.md](docs/projeto-botvow.md).

This project continues the earlier prototype [Santiago1971/agent-agreement-black-box](https://github.com/Santiago1971/agent-agreement-black-box).