Sovereign Agent Logbook
Every AI agent needs a logbook. Yours should stay in Europe.
An open-source, tamper-evident logbook for AI agents. It records each action, tool call and human approval your agent logs in an append-only, hash-chained file on your own server. Each entry says who, what, why, approved by whom and with what outcome. It works with any model (Mistral, GPT-NL, Llama, Claude, GPT…) because it speaks the open Model Context Protocol.
v0.1 is a working skeleton, not a finished product. It logs, chains, masks secrets, verifies and exports, and every claim on this page has a test behind it. What it does not do yet is listed honestly in ROADMAP.md.
Two short videos. What it is for and how it works (3:22, no technical terms) and a demo of detecting a changed log entry (1:50, real terminal output from version 0.1.3, including the case it does not catch). Both are in English with subtitles; the narration uses an AI voice.
Follow the build. Get the release notes by email at delfen.ai/logbook (a few mails a year, plus the weekly Delfen CTO update; unsubscribe any time). Found a hole in the threat model, or an event field that does not fit your agents? Open an issue. If the logbook is useful to you, a star helps other people find it.
Why
The EU AI Act requires providers and deployers of high-risk AI systems to keep logs and keep a human able to intervene (Articles 12, 14 and 26(6)). Those duties were due on 2 August 2026, or 2 August 2027 for AI built into regulated products. That changed with the Digital Omnibus on AI (Regulation (EU) 2026/1744, in force 27 July 2026). It moved them to 2 December 2027 for most high-risk systems and 2 August 2028 for AI built into regulated products. The clock moved; it did not stop. Reporting serious incidents (Article 73) sits in a different chapter of the Act, outside that postponement; check its timing for your system. The logbook gives you a verified timeline of the agent's logged actions to report from.
Autonomous agents make those duties harder. One task is ten tool calls, and when something goes wrong nobody can reconstruct which call did what, on whose approval.
Most tools for this live inside a US cloud platform or are built for one model vendor. If you run a sovereign setup — an open-weight model on your own hardware — there is nothing small and neutral to drop in. This is that thing.
What you get
- A tamper-evident log. Each event carries the hash of the previous one.
Change, insert, remove or reorder a line and
logbook verifytells you exactly where. (How, in one file of about 140 lines) - Any model, any host, or no cloud at all. Four MCP tools:
log_event,verify_logbook,recent_events,export_logbook. - Secrets masked before writing. Keys that look like passwords, tokens,
API keys, IBANs or BSNs are replaced with
***masked***before hashing. - No outbound network, proven by a public test. The test blocks outbound socket connections in the Python runtime and still completes a full write, verify and export cycle. A second test asserts that the logbook core imports no HTTP client. (tests/test_no_network.py)
- Audit-ready export. JSON and CSV your DPO or auditor can read without this tool.
- An open format. SPEC.md is the log format, separate from the code, Apache-licensed, so other tools can write it too.
- A Skills pack that teaches any agent when to log, what to write and when to stop and ask a human. (skills/sovereign-agent-logbook/SKILL.md)
Five-minute install
Needs Python 3.11 or newer. On an older Python, pip reports that it cannot
find the package; check with python3 --version. The Python that ships
with macOS is 3.9.
pip install sovereign-agent-logbook
Point your MCP-capable agent host at the server over stdio. For Claude
Desktop / Claude Code, Cursor, Continue, or any host with an mcpServers
block:
{
"mcpServers": {
"logbook": {
"command": "sovereign-agent-logbook",
"env": { "LOGBOOK_PATH": "/var/lib/logbook/agent.jsonl" }
}
}
}
Installed once for the whole machine? Then every agent host on it starts
the same server, and a fixed path sends every project's actions to one file.
Put {project} in the path to give each project its own file:
"env": { "LOGBOOK_PATH": "~/logbooks/{project}.jsonl" }
{project} is the name of the folder the agent works in (the nearest folder
with a .git in it). {cwd} is that working folder itself. Most hosts start
the server in the project folder; the logbook://about resource shows which
file is in use. We added this after a session on one project wrote into
another project's log on our own machine.
Or run it as a service on your own box with Docker:
docker build -t sovereign-agent-logbook .
docker run -d --name logbook \
-p 127.0.0.1:8765:8765 \
-v logbook-data:/data \
sovereign-agent-logbook
# MCP endpoint: http://127.0.0.1:8765/mcp (put TLS in front for anything beyond localhost)
Then, at any time, as a human:
logbook --path /var/lib/logbook/agent.jsonl verify
logbook --path /var/lib/logbook/agent.jsonl export --format csv > audit.csv
logbook --path /var/lib/logbook/agent.jsonl tail --limit 10
From a script, cron job or CI pipeline that does not speak MCP, write an
event with logbook log:
logbook --path /var/lib/logbook/backup.jsonl log \
--agent nightly-backup --model none --action dump_database \
--approval auto --approval-rule "runbook 4" \
--outcome success --summary "dump written" --arg target=db1
If an entry turns out to be wrong, do not edit the file: that breaks the
chain, and verify will say so. Append a correction that points to the
wrong entry by its seq:
logbook --path /var/lib/logbook/backup.jsonl log \
--agent nightly-backup --model none --action dump_database \
--outcome error --corrects 41 \
--summary "entry 41 said success; the dump had not run"
The wrong entry stays visible and the correction says what was wrong. We learned this from our own agents: one logged a push as done before it had run.
Deleting the last lines of a file cannot be seen from the file alone. To
catch it, write an anchor to a second place the log owner does not edit
alone (another host, a ticket, an email). An anchor is one line with the
file name, the last seq, its hash and the time. It holds no event content.
logbook --path /var/lib/logbook/backup.jsonl anchor --to /mnt/other-host/anchors.jsonl
# ... later, after the last line of the file was deleted:
logbook --path /var/lib/logbook/backup.jsonl verify --anchor /mnt/other-host/anchors.jsonl
# BROKEN — 40 events, 1 problem(s):
# - truncated: anchor at seq 41, file ends at seq 40
anchor also prints the line, so you can paste it into a ticket or mail it.
verify --anchor fails if an anchored event is missing (truncated) or has a
different hash (rewritten). It ignores anchor lines for other file names.
If no anchor line matches the file name (for example the file was renamed),
nothing was checked, so it fails too. When it passes, it says how many
anchors it checked: OK — 145 events, chain intact, 3 anchors checked.
Several processes on one machine may append to the same file: writes take a file lock (POSIX). Writers on different machines, for example agents that sync the file through git, should each keep their own file, because two copies appended separately fork the chain.
What an event looks like
{"spec":"0.1","seq":42,"id":"…","ts":"2026-11-05T20:41:03.123456+00:00",
"prev_hash":"9f2c…","hash":"3a1b…",
"agent_id":"invoice-bot","model":"mistral-small-4",
"action":"pay_invoice","arguments":{"amount":1250,"iban":"***masked***"},
"reason":"Invoice 2026-118 matches PO 4471 and is under the auto-approval limit",
"approval":"auto","approved_by":null,"approval_rule":"pay-under-2000-matched-po",
"outcome":"success","result_summary":"Paid via bank API, ref 88213",
"run_id":"task-7f3e","tags":["finance"]}
Field meanings are normative in SPEC.md. Every call to
log_event needs agent_id, model and action; the logbook rejects a
call without them. model is required on purpose: an auditor needs to see
which model version took each action.
Trust: no black box
| What we promise | How you can check it yourself |
|---|---|
| Tamper-evident | Edit any line of a logbook file, run logbook verify |
| No outbound network | tests/test_no_network.py; the Dockerfile adds no network tooling |
| Tests are public and run on every change | The CI badge above links to every run |
| We say what it does not protect against | THREAT-MODEL.md |
| We say which AI Act articles it helps with, and which it does not | docs/ai-act-mapping.md |
| The format outlives the software | SPEC.md, Apache-2.0 |
| Security issues have a process | SECURITY.md |
| Decisions are recorded | ROADMAP.md, CHANGELOG.md |
Not tied to one platform
GitHub is where most developers look, so this is the working repository.
An identical mirror on EU-hosted infrastructure is planned so that the code
never depends on a single platform; the target is being chosen and will be
recorded in ROADMAP.md. Until then, git clone gives you a
complete copy — that is the point of git.
Hosted version
If you would rather not run a server, a hosted version on EU-only
infrastructure (Hetzner, Germany / Scaleway, France) with retention
policies, a monthly audit export and a daily anchor is planned. Every day,
the latest seq and hash would be signed and sent to the customer.
Customers who need it can have it sealed by an EU qualified timestamp
service (eIDAS). Only this fingerprint leaves the server, never the log's
content. So neither the customer's team nor Delfen could shorten or rewrite
the record unnoticed.
Terms as offered on delfen.ai/logbook: €29 per month excluding VAT, 30-day free trial, cancel any time; if the hosted version is not live by the end of a trial, the trial is cancelled rather than charged.
Licence
Apache License 2.0. Built in the Netherlands by Delfen. Contributions welcome — see CONTRIBUTING.md.
Metadata
Release files for sovereign-agent-logbook 0.1.4
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 |
|---|---|---|---|---|
| sovereign_agent_logbook-0.1.4.tar.gz | 38.6 kB | With provenance | Details for sovereign_agent_logbook-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sovereign_agent_logbook-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for sovereign_agent_logbook-0.1.4-py3-none-any.whl |
Total release size: 60.4 kB
Release files / sovereign_agent_logbook-0.1.4.tar.gz
| Download URL | sovereign_agent_logbook-0.1.4.tar.gz |
|---|---|
| Size | 38.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ac1747075dfbe9830ba4d575efd8e29c43264aa052a46e2698e7782e2eae706
|
|
BLAKE2b-256 checksum How to use checksums |
2e8eb5c72863788892a57034ceea24ac6cc1ccb0dc6f6dad0615e2bd59663222
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / sovereign_agent_logbook-0.1.4-py3-none-any.whl
| Download URL | sovereign_agent_logbook-0.1.4-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7a259b1a104baf53168628d5091abda4e2c64b9646fb1f1d1602433cc732321
|
|
BLAKE2b-256 checksum How to use checksums |
f9e3168a13cb66539377c5b834acdd2753fc706fda3ef47c5001018ad2aae86e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for sovereign-agent-logbook 0.1.4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sovereign_agent_logbook-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA 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.