Upvote:3
The CBP has very broad authority in a "reasonable" proximity of the border, which probably includes the area in Northern Idaho close to the Canadian border. Source:
... the Immigration and Nationality Act 287(a)(3) and copied in 8 Code of Federal Regulations (CFR) 287 (a)(3), which states that Immigration Officers, without a warrant, may "within a reasonable distance from any external boundary of the United States...board and search for non-citizens in any vessel within the territorial waters of the United States and any railcar, aircraft, conveyance, or vehicle. 8 CFR 287 (a)(1) defines reasonable distance as 100 air miles from the border.
Thus they don't need any reason to inspect your vehicle and question you, in particular in order to search for non-citizens (as the quote above explicitly says). For example, they may have had concerns that you are not a US citizen, or that you're smuggling someone who is not across the border. Doing so in either direction would be illegal.
That may be related to an amber/silver alert or a recent crime reported nearby, as commenters mentioned, or because that particular area is notorious for such behavior, or because they had some intelligence information, or just because they were bored.
They were within their right to question you. This does happen much more frequently at the southern border, but also happens at the Canadian border occasionally (example).
For clarification, since it was mentioned in the comments - CBP checkpoints do not have to be permanent and in predefined locations, that would be defeating the point. A cruiser with two officers in the middle of the road is a checkpoint.