Yes the risk is very big.
NSA is know to put spyware on hardware before shipping (see here), NSA is know to ignore the US constitutions and spy on calls and internet activity of US citizens so do you really think they care about foreigners? If they seize your laptop and you ever get your hands back on it, throw it on the trash its junk now.
I can bet that from 10 agents borders, 5 are agents from NSA. After all who is scanning and checking the hardware? I doubt that is normal immigration agents. If they ever seize any electronic device from you trash them, i must really empathize that after they put the hands on your hardware you will never be able to trust it again.
Even if you dismount your laptop and check every piece, they can flash a malware on your bios that will survive even if you format your OS and flash the bios again, you just can't remove a malware on bios.
Do not trust US government and don't trust US companies either(most of the world don't trust anymore)...
China has banned Windows OS on government computers and world trust on any US company is nonexistent and this is already causing loss to US economy as you can see here.
What i'm trying to say is, never trust then under any situation.
Edit: yes, i do not trust anything related to US and privacy together but you should not think that just because a random person on internet told you that, but because there is thousands of documented proof that show you should not trust.
And i forgot to say that anyone can flash a BIOS in less than 5 minutes and its very easy usually just click on a .exe file and "ok" "ok" "next" laptop reboots and done, so even if the border agents only stay with your hardware for 10 minutes is enough to compromise it.