> For the complete documentation index, see [llms.txt](https://vayl.gitbook.io/vayl-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vayl.gitbook.io/vayl-docs/documentation/mcp-tools/accountability.md).

# Accountability

Prove what was known, decided, and erased. Signatures use Ed25519; the audit log is a tamper-evident hash chain. A `?` marks an optional argument.

## record\_decision

```python
record_decision(action_summary, question, user_id?, agent_id?, run_id?)
```

Log a decision bound to the **exact facts the agent consulted** — an immutable, signed snapshot of what it believed at decision time. Returns a decision id and a signed receipt digest.

## explain\_decision

```python
explain_decision(decision_id, user_id?)
```

Reconstruct a past decision: the action plus the beliefs held **at that moment**, with the signed receipt verified so you know the record wasn't altered.

## attest

```python
attest(subject, user_id?, agent_id?, run_id?)
```

Issue a signed, third-party-verifiable **attestation** of the current value — "as of now, X is the value" — anchored to the tamper-evident audit head.

## audit\_log

```python
audit_log(limit?, user_id?)
```

The accountability trail — who did what, when. Detail is encrypted at rest and never wiped by erasure. Without a `user_id`, the deployment-wide log requires the `admin` capability; with one, it's scoped to that space.

## verify\_audit

```python
verify_audit()
```

Verify the tamper-evident audit chain end to end. Reports **INTACT**, or the exact row where it breaks (edited, reordered, truncated). A signed head checkpoint also detects deletion of the newest rows.

## verify\_receipt

```python
verify_receipt(receipt_id)
```

Verify a signed erasure receipt or attestation — recompute the body and check the Ed25519 signature. Returns VALID or INVALID. Scoped to the receipt's owning space.

## export\_public\_key

```python
export_public_key()
```

Return Vayl's Ed25519 public key, so anyone can verify receipts, attestations, and the audit chain **offline** — without the secret key or the database.

## Next steps

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-scale-balanced" style="color:$primary;">:scale-balanced:</i> Compliance (GDPR)</h4></td><td>Erasure and export with signed receipts you can verify here.</td><td><a href="/pages/yBNIgVqSfcovyrB5U6PP">/pages/yBNIgVqSfcovyrB5U6PP</a></td></tr><tr><td><h4><i class="fa-shield-halved" style="color:$primary;">:shield-halved:</i> Safety and gating</h4></td><td>Gate irreversible actions before the agent acts.</td><td><a href="/pages/FXBBWNQcHGSp5V9G057o">/pages/FXBBWNQcHGSp5V9G057o</a></td></tr><tr><td><h4><i class="fa-lock" style="color:$primary;">:lock:</i> Authentication &#x26; access</h4></td><td>Who may read the audit log and issue attestations.</td><td><a href="/pages/fb922e107b31a3e9e9fcf81410029e993b0a9afc">/pages/fb922e107b31a3e9e9fcf81410029e993b0a9afc</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vayl.gitbook.io/vayl-docs/documentation/mcp-tools/accountability.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
