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:
- • a keyed fingerprint of the checked text:
text_hash, an HMAC-SHA-256 under your account's own key (text_hash_alg:hmac-sha256-1). Without the key it cannot be reversed or tested against guesses, and the key never leaves ComplyEdge. - • user and session IDs as keyed pseudonyms (
p1:followed by 32 hex characters), never as you sent them - • the rule that fired and the law it cites, when a phrase rule or the injection check fired. A phrase-rule ID belongs to the open ComplyEdge rule set. An injection block is
llm-art15-ipi-*and still cites Article 15. A wider-review block isLLM_LAYER2_BLOCKand does not cite an article. - • the rule-set version and its content digest (
bundle_id,bundle_digest) - • the decision (
action: block, allow or flag) and when it was made (timestamp, UTC) - • its place in your account's hash chain (
chain_seq,chain_prev,chain_hash), set in the same write as the record, so an edit, deletion or reordering shows when an export is verified
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.
- • An
event_idthat is not in your account returns 404. - • If your account's key has been destroyed (a crypto-shred, run on request, for example when an account is closed), the answer is
match: falsewithkey_shredded_at, so a destroyed key is never mistaken for a different text. - • Verify confirms a match. It does not show that your own log is complete; that part is your log's job.
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. Take the row's
chain_prev, the hash of the row before it in the chain. - 2. Recompute the row's
chain_hash: SHA-256 ofchain_prevfollowed 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-sourceaudit_export.pydoes exactly this. - 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. Export the full period with
GET /v1/audit/export, with nosession_idoruser_id, in consecutive date ranges that together cover it. One export holds at most 10,000 records; a longer range returns422and asks for a shorter one. - 2. Verify each file offline with
python -m audit_export verify export.json. It must report no gap and no broken link. - 3. Join the files in order: the first
chain_seqof each file follows the last one of the file before it, and its firstchain_prevequals that file's lastchain_hash. - 4. Find each row of the session file in them by its
chain_seq. Itschain_hashmust 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
- Companion chatbot laws: the session file, the screen and the yearly report
- API Reference: the verify, pseudonym and export endpoints
- DPO pack: every field in the record, every copy and how long each is kept
- ADCR, the open Rulebook: what a decision record must prove, and how a third party checks one
- For auditors and certifiers: how a reviewer samples decisions and verifies an export offline