ReceiptDB by Counterfoil Labs

Security

Security at ReceiptDB.

ReceiptDB runs in your cloud, on your PostgreSQL. This page is for your security review: where data lives, what can leave your network and when, and how access, erasure and the audit trail are enforced.

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.

Counterfoil Labs hosts nothing and receives nothing. There is no telemetry, no update check and no licence server: Enterprise licences are verified offline.

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

Audit and integrity

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

Check it yourself

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.

We also answer security review questionnaires: ask for one.