They must comply with your restrictions, via the principle that consent can be withdrawn. One relevant Supreme Court case is Walter v. US 447 US 649, which declares that
When an official search is properly authorized—whether by
consent or by the issuance of a valid warrant—the scope of
the search is limited by the terms of its authorization
Likewise in Florida v. Jimeno, 500 U.S. 248,
A suspect may, of course, delimit as he chooses the scope of the
search to which he consents.
In US v. Williams, No. 16-3547, 2018 U.S. App. LEXIS 21304 (3d Cir.), the court elaborated that
a consensual search satisfies the mandates of the Constitution
only if conducted within the boundaries of the consent given. This
recognition establishes that it is the subject of a consensual
search who decides the terms of the search.
and furthermore,
That a party may terminate a search by withdrawing his
consent is a corollary of the recognition that the subject of a
consensual search determines the parameters of that search.
Bear in mind that you have to be crystal clear on any limits on the scope of a search.
If this is more of a business call (the electrical inspector) and not a search, they don't have any special powers to enter your house. If the inspector enters your basement study without permission, that is trespassing, but you can't sue him because of that unless there was actual damage done. You can complain to his superior.