Recently, I took my MacBook Air to Genius Bar to perform a clean installation of macOS. For security reasons, I also ordered a hardware check. The technician of Genius Bar executes the Apple Diagnostics, and affirms that the test can verify if the hardware components of my computer have been attenuated.
Once the test was finished, a list of information about the components appeared on the technician's iPad (which I did not read). He went through all the elements and concluded that my computer is safe in terms of hardware modifications.
I'd like to ask how safe a Mac is, if it passes Apple Diagnostics. As an example, if an attacker disarmed my Mac and inserted a hardware keylogger, I doubt that the hardware test can verify it.
Thanks in advance.