This paper addresses the problem of protecting the data carried by mobile agents from the possible attacks of malicious execution hosts. Specifically, we consider protection mechanisms that, instead of preventing malicious hosts from tampering with the collected data, simply aim at detecting tampering attempts. The various proposals that appeared in the literature so far are characterized by several limitations, some of which have been pointed out recently. In particular, data truncations may not be detected, and a binding of the static code to the collected data is missing. This paper takes into account such criticisms and formally defines a new protocol that does not suffer from all the previous limitations. Such a protocol is also configurable, according to the protection level needed. In this way, the minimum protection level compatible with the needed security properties can be selected each time. Categories and Subject Descriptors C.2.4 [Computer-Communication Networks]: Distrib...