Seems like a recipe for severe headaches and cursing when devices fail while you're logged out and now you can't log in by just connecting a new keyboard.
You probably could add some kind of fingerprint that allow identifying the legit prompts, but since it is not done with login screens...