Skip to main content

rawctx

Tamper-proof receipts for your AI's answers.

When an AI answer is challenged, rawctx records what it said, which sources it used, and a verifiable receipt. It keeps answer evidence and proof review separate from the agent and observability stack you already run.

Install

pip install rawctx
rawctx login

You can also mint a no-signup, hash-only browser receipt from the rawctx Hub. The browser path sends cryptographic fingerprints instead of the question and answer text.

Log an answer

import rawctx

receipt = rawctx.log_answer(
    "What is the refund policy?",
    "Customers can request a refund within 30 days.",
)

print(receipt)

Hash-centered storage is the default. Workspace settings can enable raw question and answer text storage, while hashes remain available when text storage is off.

What rawctx records

  • Answer record: application, environment, question and answer text or hashes, idempotency key, policy flags, and status.
  • Source evidence: source_refs for documents, registered audio or video evidence, answer segments, and purpose-bound retrieval events.
  • Model-run lineage: model metadata, input and output hashes, configuration hashes, trace IDs, and inference commitments.
  • Lifecycle and proof: correction, void, and redaction events plus Merkle inclusion, signed tree-head binding, external anchors, witness receipts, and explicit proof status.

rawctx does not generate answers, orchestrate workflows, or replace LangSmith, Langfuse, or another OpenTelemetry runtime. It records the evidence object that connects an answer to the sources and trace information needed for review.

Connect OpenTelemetry evidence

rawctx.ingest_otel_trace_bundle() wraps public-safe fields from an existing OpenTelemetry trace into an answer-audit record. Keep trace ownership in your current observability system and submit only the identifiers, hashes, and references needed for answer review.

Do not send observability API keys, private trace URLs, raw tool outputs, or other secrets to rawctx.

Check answer-log completeness

Independent reconciliation compares a short-period external reference set with rawctx answer-audit logs. It detects missing, unexpected, late, duplicate, and unanchored records without becoming an inline decision gate.

rawctx reconcile run reconciliation.json --json
rawctx reconcile findings RUN_ID --json
rawctx reconcile proof RUN_ID --output reconciliation-proof.json
rawctx trust verify reconciliation-proof.json --online

Use a business-system export, provider usage export, or auditor-controlled extract that cannot be rewritten in lockstep with the answer logs. Persisted findings and proofs are commitment-oriented; do not place secrets, raw customer exports, raw PII, or private system URLs in payload metadata.

Review proof state

Proof status distinguishes externally anchored records from pending or local-only evidence. It describes the receipt's verification state; it does not claim that the submitted answer or upstream trace content is true.

rawctx trust proof answer ANSWER_LOG_ID --output proof.json
rawctx trust verify proof.json --online --json

Public documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rawctx-0.3.41.tar.gz (180.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rawctx-0.3.41-py3-none-any.whl (148.6 kB view details)

Uploaded Python 3

File details

Details for the file rawctx-0.3.41.tar.gz.

File metadata

  • Download URL: rawctx-0.3.41.tar.gz
  • Upload date:
  • Size: 180.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for rawctx-0.3.41.tar.gz
Algorithm Hash digest
SHA256 f24acfbac140f7e08975de7d031d44a9e15e676a601f74cf6e38a5f33323d998
MD5 78e483ad0520de20b521136331b0edd3
BLAKE2b-256 6ffd4e9896d3438c19e01daf0d0474e9c48052eed05144b2b8846ee32a054268

See more details on using hashes here.

File details

Details for the file rawctx-0.3.41-py3-none-any.whl.

File metadata

  • Download URL: rawctx-0.3.41-py3-none-any.whl
  • Upload date:
  • Size: 148.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for rawctx-0.3.41-py3-none-any.whl
Algorithm Hash digest
SHA256 af5d0366d185f51daab7e00bec0d419d5108b686cd524fa916dd949953f1c693
MD5 20db35c439bdf39cadccad880ecb2b3a
BLAKE2b-256 6b90f5d9981198ae6ee76affe602644c6f559d7d812dea3ffb66eaf26e6e8bf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page