GitHub - nuvious/pam-duress: A Pluggable Authentication Module (PAM) which allows the establishment of alternate passwords that can be used to perform actions to clear sensitive data, notify IT/Security staff, close off sensitive network connections, etc if a user is coerced into giving a threat actor a password.
https://github.com/nuvious/pam-duress
The closest thing to this I have ever done is to use TrueCrypt containers with hidden volumes. You have one password for the regular volume which you can put bogus / non-sensitive data in. That is what you would use if under duress.
You have a different password to open the hidden volume, which has the data you are really protecting.