Reference. Verified Foundations for Differential Privacy

Differential privacy (DP) has become the gold standard for privacy-preserving data analysis, but implementing it correctly has proven challenging. Prior work has focused on verifying DP at a high level, assuming either that the foundations are correct or that a perfect source of random noise is available. However, the underlying theory of differential privacy can be very complex and subtle. Flaws in basic mechanisms and random number generation have been a critical source of vulnerabilities in real-world DP systems. In this paper, we present SampCert, the first comprehensive, mechanized foundation for executable implementations of differential privacy. SampCert is written in Lean with over 12,000 lines of proof. It offers a generic and extensible notion of DP, a framework for constructing and composing DP mechanisms, and formally verified implementations of Laplace and Gaussian sampling algorithms. SampCert provides (1) a mechanized foundation for developing the next generation of differentially private algorithms, and (2) mechanically verified primitives that can be deployed in production systems. Indeed, SampCert’s verified algorithms power the DP offerings of Amazon Web Services, demonstrating its real-world impact. SampCert’s key innovations include: (1) A generic DP foundation that can be instantiated for various DP definitions (e.g., pure, concentrated, Rényi DP); (2) formally verified discrete Laplace and Gaussian sampling algorithms that avoid the pitfalls of floating-point implementations; and (3) a simple probability monad and novel proof techniques that streamline the formalization. To enable proving complex correctness properties of DP and random number generation, SampCert makes heavy use of Lean’s extensive Mathlib library, leveraging theorems in Fourier analysis, measure and probability theory, number theory, and topology.

Cite

Cite as @demedeiros-2025-verified (helia, typst) · \cite{demedeiros-2025-verified} (LaTeX)
BibTeX
bibtex · 1 line
@article{demedeiros-2025-verified, title={Verified Foundations for Differential Privacy}, volume={9}, ISSN={2475-1421}, url={http://dx.doi.org/10.1145/3729294}, DOI={10.1145/3729294}, number={PLDI}, journal={Proceedings of the ACM on Programming Languages}, publisher={Association for Computing Machinery (ACM)}, author={de Medeiros, Markus and Naveed, Muhammad and Lepoint, Tancrède and Kahsai, Temesghen and Ravitch, Tristan and Zetzsche, Stefan and Joshi, Anjali and Tassarotti, Joseph and Albarghouthi, Aws and Tristan, Jean-Baptiste}, year={2025}, month=June, pages={1094–1118} }
hayagriva YAML (typst)
yaml · 26 lines
demedeiros-2025-verified:
  type: article
  title: Verified Foundations for Differential Privacy
  author:
  - name: Medeiros
    given-name: Markus
    prefix: de
  - Naveed, Muhammad
  - Lepoint, Tancrède
  - Kahsai, Temesghen
  - Ravitch, Tristan
  - Zetzsche, Stefan
  - Joshi, Anjali
  - Tassarotti, Joseph
  - Albarghouthi, Aws
  - Tristan, Jean-Baptiste
  date: 2025-06
  page-range: 1094-1118
  serial-number:
    doi: 10.1145/3729294
  parent:
    type: periodical
    title: Proceedings of the ACM on Programming Languages
    publisher: Association for Computing Machinery (ACM)
    issue: PLDI
    volume: 9
Cited by (2)

Modular Verification of Differential Privacy in Probabilistic Higher-Order Separation Logic haselwarter-2026-modular

Differential privacy is the standard method for privacy-preserving data analysis. The importance of having strong guarantees on the reliability of implementations of differentially private algorithms is widely recognized and has sparked fruitful research on formal methods. However, the design patterns and language features used in modern DP libraries as well as the classes of guarantees that the library designers wish to establish often fall outside of the scope of previous verification approaches. We introduce a program logic suitable for verifying differentially private implementations written in complex, general-purpose programming languages. Our logic has first-class support for reasoning about privacy budgets as a separation logic resource. The expressiveness of the logic and the target language allow our approach to handle common programming patterns used in the implementation of libraries for differential privacy, such as privacy filters and caching. While previous work has focused on developing guarantees for programs written in domain-specific languages or for privacy mechanisms in isolation, our logic can reason modularly about primitives, higher-order combinators, and interactive algorithms. We demonstrate the applicability of our approach by implementing a verified library of differential privacy mechanisms, including an online version of the Sparse Vector Technique, as well as a privacy filter inspired by the popular Python library OpenDP, which crucially relies on our ability to handle the combination of randomization, local state, and higher-order functions. We demonstrate that our specifications are general and reusable by instantiating them to verify clients of our library. All of our results have been foundationally verified in the Rocq Prover.
PDF · DOI · arXiv · pldb

Verifying Exact Samplers for Continuous Distributions with a Discrete Program Logic demedeiros-2026-verifying

Most implementations of sampling algorithms for continuous distributions use floating-point numbers, which introduce round-off errors and approximations. These errors can be difficult to analyze, and can cause security issues when used in algorithms for differential privacy. An alternative is to use exact sampling algorithms based on computable reals, which can lazily generate the digits of a continuous sample to arbitrary precision. However, these algorithms are intricate, and implementing and using them involves a combination of semantically challenging language features, such as probabilistic choice, higher-order functions, and dynamically-allocated mutable state. In this paper we present Continuous-Eris, a higher-order separation logic for verifying the correctness of exact sampling algorithms for computable distributions. To demonstrate Continuous-Eris, we verify the correctness of computable samplers for the uniform, Gaussian, and Laplace distributions, as well as a library for exact real arithmetic for working with generated samples. All of the results in this paper have been verified in the Rocq proof assistant.
DOI · arXiv
Cites 49 works (0 here)
External (49)
demedeiros-2025-verified reference entries/refs/demedeiros-2025-verified/demedeiros-2025-verified.hel