Deployment
ReceiptDB is a layer on the PostgreSQL you already operate, not a hosted service. A stateless API runs in your cloud, on Kubernetes with the Helm chart or on Docker, in front of PostgreSQL 16 or 17 with pgvector: self-managed, Amazon RDS, Cloud SQL or Azure Database for PostgreSQL. Records, vectors, the lineage graph and the audit log are ordinary tables, so your existing backups, monitoring and access controls apply.
What leaves your network
Nothing, unless a setting names a destination. Each outbound call is an integration you switch on, and receipt config check shows which are set:
- A model you choose, for answers, grounding checks or the model scanner. Search, explain, lineage, retraction and erasure never call a model, and a local model keeps it in your network.
- An embedding endpoint, when you configure a hosted embedder.
- Scanners you enable, such as Lakera Guard or your own HTTP classifier; never a source whose egress labels don't allow that destination.
- Connectors Enterprise: the content sources you name.
- Your KMS Enterprise: to unwrap the master key at start.
- Your SIEM, webhooks and tracing: Splunk, OpenTelemetry or syslog; signed webhooks; OTLP spans.
- Your privacy and lineage platforms: OneTrust, Transcend, OpenLineage.
- Answer spans to Langfuse or Phoenix, when you name one.
Your frameworks' own settings stay yours. For example, Haystack sends usage statistics to its makers unless HAYSTACK_TELEMETRY_ENABLED=False is set before Haystack is imported. ReceiptDB doesn't change another library's setting.
Data protection
Labels that fail closed
Every record carries labels: trust, licence, readers, data subjects, personal data, egress and validity. Labels flow down the lineage graph, so a derived record is never more trusted, or less restricted, than its riskiest input. Content without labels is treated as untrusted and restricted, and permissions a connector can't map deny access.
Access that follows the data
Every search is access-checked. A summary or an answer is never readable by someone who couldn't read its sources, and revoking a group's access to a source revokes it on everything built from it, in one transaction.
Egress control
Label where content may be sent, such as "local only" or "Anthropic EU". Search enforces it for the model reading the results, and answers record where their sources went.
Erasure
Erasure reaches every chunk, vector, memory and answer derived from a person's data and either completes everywhere or changes nothing. What it keeps of a person, a document or its content is an unreadable fingerprint. Give ReceiptDB a secret you hold outside the database (the quick-start kit generates one) and each fingerprint is keyed with it, so a stolen copy can't confirm who was erased. The certificate can be checked against the database afterwards with a separate verification command.
Crypto-shredding Enterprise
Text about each person is encrypted with its own key, under a master key held in AWS KMS, Google Cloud KMS or Azure Key Vault. Erasing a person destroys their key, so their text can't be read back.
Each record is sealed with AES-256-GCM under a key derived with HKDF-SHA256 from the keys of every person it's about, so erasing any one of them makes it unreadable. Each person's key is a random 256-bit key, stored only wrapped by the master key, with AES-256-GCM.
Erasure that holds through backups and restores Enterprise
Keep the keys in a key store on a separate instance and seal the vectors, and the database's base backups, WAL archives and replicas hold a person's text and embeddings only as ciphertext: once a person's key is destroyed, restoring any of those copies brings neither back. After a crash, a failover or a restore from one of those copies, ReceiptDB refills the search copy from the sealed copies on its own, and an erased person's vectors stay gone. Each erasure leaves a certificate, so after a restore you can list the erasures made since the backup, run them again from your request records, and confirm with receipt verify-erasure that nothing of them is left.
Encrypted in transit
Run the connection to PostgreSQL over TLS: give ReceiptDB a DSN with sslmode=require, or verify-full with your provider's CA bundle to pin the server. Amazon RDS and Azure Database for PostgreSQL require TLS by default; on Cloud SQL, connect through the Cloud SQL Auth Proxy or a private IP with TLS.
Suspect content
Scanners hold flagged sources and their derivatives out of retrieval until someone reviews them, and each scanner's verdict stays on the record. A personal-data detector flags what a writer never declared, built in or with Microsoft Presidio; it only tightens labels and never stores what it matched.
Identity and access
- Single sign-on and provisioning Enterprise: SSO over OIDC and SCIM from Okta or Entra ID. Users always search as themselves, and each tenant has its own directory.
- Groups from your authorisation engine Enterprise: SpiceDB or OpenFGA.
- Permissions as fresh as the source Enterprise: connectors follow Google Drive and SharePoint as they change, so a revoked share is applied about a minute after the source reports it; the optional live check reads a document's permissions at the source again before it's returned, and leaves it out if the source can't answer.
- Scoped API keys and tenants Enterprise: keys scoped to what they may do, and tenants you can disable or remove.
- API keys at rest: Enterprise's scoped keys are stored only as a SHA-256 hash and shown once; the Community key is a setting in your environment, never in the database. Every key is compared in constant time.
Audit and integrity
- A receipt for every answer: question, asker, model, time and lineage to every source, exportable for a regulator. Your reviewers check any receipt themselves:
receipt verify-receiptre-hashes the answer against the database, down to every source it names, and names the reason when a record was erased or sealed, the answer isn't in the ledger, or a source was moved to another URI. - A tamper-evident log Enterprise: every lifecycle change in a hash-chained log, with signed exports and certificates. Signed checkpoints kept outside the database make a rewritten or truncated log detectable, even to someone with database access.
- Legal holds: hold a document or a person, and everything derived from them is kept through erasure and retention, out of search and answers, until release. Certificates list what was held back and why.
- Compliance reports Enterprise: EU AI Act and FINRA templates built from the same records. See a sample: EU AI Act · FINRA.
ReceiptDB gives you the evidence; how you use it determines compliance.
Supply chain
Every release image ships with a software bill of materials and SLSA build provenance, for your supply-chain review. Both are attached to the image in the GitHub container registry: read them with docker buildx imagetools inspect ghcr.io/counterfoillabs/receiptdb:<version> --format '{{json .SBOM}}', or .Provenance. The Python package is published to PyPI with trusted publishing, and the TypeScript client to npm from the same release workflow, with provenance from 1.0.0.
Every change is checked before it merges: Semgrep for the code and gitleaks for secrets, and every dependency change goes through pip-audit and Trivy, which scans each image and refuses a fixable high-severity flaw.
Operations
- Bounded under load: timeouts on every request, a separate ceiling for retractions and erasures, per-caller rate limits, a throttle on failed authentication, and an overloaded API tells clients when to retry.
- Keys rotated with zero downtime: the outgoing API key keeps working beside the new one for a window you set, up to a week, so every client moves over on its own schedule.
- Recovers on its own: after a database outage or failover, each API replica serves again within about a second of the database accepting connections; requests in the gap get a 503 with a time to retry.
- All or nothing, under faults: every retraction, supersession, quarantine, release, relabel and erasure applies whole or not at all, even with its connection cut before or after the commit, behind PgBouncer in either mode; once it reports success, it has applied.
- Behind your pooler: direct connections or PgBouncer in session or transaction mode, with tenants isolated through the pooler.
- Observable: structured JSON logs with a request ID on every line, Prometheus metrics, and OpenTelemetry traces down to each database statement.
- Upgrades: numbered migrations run once, across every tenant, with no locks on a restart, from any earlier release.
- Runbooks, drilled: sixteen runbooks, one per failure, each drilled against the real failure it describes; the alerts that raise them link straight to the page.
- Support without exposure: one command writes a support bundle of versions, settings, health and recent warnings, with no record content or secrets in it.
- A licence that never holds data hostage: after expiry there's a grace period; after that, only new Enterprise features stop. Reads, decryption, erasure and access to every tenant keep working.
Check it yourself
- The source: the Community edition's code is in the public repository, with its tests.
- Any answer's receipt:
receipt verify-receiptre-hashes it against the database, down to every source it names. - Any erasure:
receipt verify-erasurechecks its certificate against the database and lists anything left. - The threat model: every trust boundary, STRIDE over each, and the AI-specific threats, from prompt injection to a malicious tenant, with each control mapped to the code and tests that hold it: read it.
Reporting a vulnerability
Report a vulnerability privately through the repository's Security tab, with GitHub's private vulnerability reporting: only you and the maintainers see it. Or write to hello@counterfoillabs.com (also in security.txt). Our security policy sets out what happens next.
- Response targets: we acknowledge a report within 3 working days, confirm or decline it with a severity within 10, and ship a fix or a mitigation for a severity 1 report within 14 days of confirming it; other fixes ship in a patch release within 90 days.
- Supported versions: each 1.x minor release gets security fixes until 6 months after the next minor ships, and the last 1.x minor before 2.0 until 12 months after 2.0.0. Fixes ship as patch releases of each supported minor.
We also answer security review questionnaires: ask for one.