  Data minimisation is a privacy enhancing principle, stating that personal
data collected should be no more than necessary for the specific purpose
consented by the user. Checking that a program satisfies the data minimisation
principle is not easy, even for the simple case when considering deterministic
programs-as-functions. In this paper we prove (im)possibility results
concerning runtime monitoring of (non-)minimality for deterministic programs
both when the program has one input source (monolithic) and for the more
general case when inputs come from independent sources (distributed case). We
propose monitoring mechanisms where a monitor observes the inputs and the
outputs of a program, to detect violation of data minimisation policies. We
show that monitorability of (non) minimality is decidable only for specific
cases, and detection of satisfaction of different notions of minimality in
undecidable in general. That said, we show that under certain conditions
monitorability is decidable and we provide an algorithm and a bound to check
such properties in a pre-deployment controlled environment, also being able to
compute a minimiser for the given program. Finally, we provide a
proof-of-concept implementation for both offline and online monitoring and
apply that to some case studies.
