How audit reconciliation works

ComplyEdge keeps proof that your controls ran. It does not keep your prompts or your model's answers. You keep the text, we keep the proof, and the event_id joins the two.

1. What the record holds

ComplyEdge does not store prompts or outputs. Each check writes one record, and it holds:

So the record on its own proves the control ran: the decision, and when a phrase rule or the injection check fired, which rule and which law, and when. It does not hold the text, so it cannot show what was said.

One detail, so nothing surprises you: the /v1/check response sends back up to 200 characters of your own text in violations[].text_excerpt, so you can see what matched. That excerpt goes back to you only. It is not written to the record.

2. The one step: keep the event_id next to your copy

Every /v1/check returns an event_id. Save it wherever you already keep the prompt and the answer: your chat history, your own application logs, or your cloud provider's model invocation logs.

Python

result = ce.check(prompt, direction="prompt")
answer = call_your_model(prompt)
# your own log line, with the ComplyEdge event_id beside the text
chat_log.save(prompt=prompt, answer=answer, complyedge_event_id=result.event_id)

TypeScript

const result = await ce.check(prompt, { direction: 'prompt' });
const answer = await callYourModel(prompt);
// your own log line, with the ComplyEdge eventId beside the text
await chatLog.save({ prompt, answer, complyedgeEventId: result.eventId });

Check the model's answer too (direction output) and it gets its own event_id; save that one next to the answer the same way.

3. In an audit or a complaint

Take your copy of the text and its event_id, and ask ComplyEdge whether they match. The answer is yes or no. The text is used for that request only: it is not stored and not logged.

POST /v1/audit/verify
{ "event_id": "uuid-v4", "text": "the prompt from your own log" }

200
{ "event_id": "uuid-v4", "match": true, "text_hash_alg": "hmac-sha256-1" }

The SDKs wrap the same call: ce.verify_input(event_id, text) in Python and ce.verifyInput(eventId, text) in TypeScript, both returning true or false.

That is the reconciliation. Your copy says what was said. The record says which rule ran, under which law, with what decision, and when. A yes from verify ties the two together: the text you hold is the exact text whose fingerprint was stored when the check ran. Change one character and the answer is no.

4. If you delete your text early

You can delete your copy of the text whenever your own retention policy says to, for example to keep personal data to a minimum. The ComplyEdge record is kept for its own retention period: 184 days by default, which covers the six months Article 26(6) of the EU AI Act asks for where it applies, from any start date. Enterprise accounts can keep it for 7 or 11 years.

The trade-off is plain. After you delete the text, the record still proves the control ran: the decision, and when a phrase rule or the injection check fired, which rule and which law, and when. What can no longer be shown is what the text said, because nobody holds it any more, us included.

5. Checking a companion chatbot file

A companion chatbot session file, as JSON or as a PDF, is checked in three steps. The first shows the PDF matches the records. The second shows each row matches the hash it carries. The third shows each row is the one your account wrote and no row is missing around them.

Step one, the PDF. Every page carries the file's export id and SHA-256. Run the same request again as JSON, GET /v1/companion/session or GET /v1/audit/export with the same session_id or user_id (and, for the audit export, the same dates), without format=pdf. Its envelope's export_id and content_sha256 must equal the two values on the PDF. They are made from the filters, the period and the rows, not from the time the file was made, so they match as long as no new record was written for that session or user since the PDF. A later check changes both; compare the rows the PDF lists instead.

6. Checking each row of a session file

A session file holds part of your account's hash chain, so its envelope says subset true and chain_check per_row. The rows are not next to each other in the chain, so gaps between their chain_seq values are expected. Each row is checked on its own:

  1. 1. Take the row's chain_prev, the hash of the row before it in the chain.
  2. 2. Recompute the row's chain_hash: SHA-256 of chain_prev followed by the row as an ADCR record without its chain fields, in RFC 8785 canonical form. write_time_link_hash(row["chain_prev"], row) in the open-source audit_export.py does exactly this.
  3. 3. It must equal the row's chain_hash. A difference means the row was changed.

This proves each row matches the hash it carries. It does not prove the row was never edited, since an edited row with a new hash would pass, and it cannot prove the file holds every row of the session. The next check proves both.

7. Showing nothing is missing

To show no record was removed around the session, check the whole chain for the period and find the session's rows in it:

  1. 1. Export the full period with GET /v1/audit/export, with no session_id or user_id, in consecutive date ranges that together cover it. One export holds at most 10,000 records; a longer range returns 422 and asks for a shorter one.
  2. 2. Verify each file offline with python -m audit_export verify export.json. It must report no gap and no broken link.
  3. 3. Join the files in order: the first chain_seq of each file follows the last one of the file before it, and its first chain_prev equals that file's last chain_hash.
  4. 4. Find each row of the session file in them by its chain_seq. Its chain_hash must be the same in both.

Together: the PDF matches the records, each record is the one your account wrote, and the chain around them is complete.

8. Where to read more