Record AI decisions

Every decision an AI system makes can become a signed event: what kind of decision, the outcome, the reason, the model and its token counts, and a hash of the input and output. The text itself is never stored.

What is stored, and what is dropped

StoredDropped
Label (nl_query, ml_score, rag_answer), decision (allow, deny, hold, info), reason code, model id, provider, token counts and cost, timestamp, run id, a hash binding input, output and runThe question, the SQL, the features, the answer, the score

The request

FieldMeaning
labelnl_query (a question turned into SQL), ml_score, or rag_answer
decision, reasonClosed codes. For a SQL guard: allow + guard_passed, or deny + guard_refused
input, output, run_idHashed together (framed) and dropped; run_id is 1-64 token characters
provider, model_id, input_tokens, output_tokens, cost_micro_usdModel metadata; counts only

From Python (the healthcare assistant)

from app import decision_log

# 1) the SQL guard decides, then the decision is recorded
verdict = decision_log.guarded_query(question, sql, run_id="run-2026-11-05-s")

# 2) an ML score (features and score are hashed and dropped)
decision_log.log_score("readmission-risk", features_text=feat, score_text="0.31", run_id=run_id)

# 3) a retrieval answer; no cited source means it is held for review
decision_log.log_rag(question, answer, run_id=run_id, cited=2)

Where it records

SettingEffect
ENTROPA_PLATINUM_DIRWrite to a local node directory through the command line
ENTROPA_PLATINUM_URLPOST to a running node (local or cloud); add ENTROPA_PLATINUM_TOKEN if it is private
ENTROPA_PLATINUM_REQUIRED=1Fail closed: if the event cannot be logged, the query is refused
none setLogging is off; the guard verdict is unchanged
A logging failure never changes the guard's verdict, except in required mode. The failure reason is kept (decision_log.last_error()) without any of the submitted text.

Over HTTP

curl -X POST $NODE/v1/decision -H "Content-Type: application/json" -d '{...}'

Errors are generic and never echo the request. Text that looks like a real identifier (for example a nine-digit number in a valid SSN layout) is refused before anything is hashed.