First, public demonstration that keeps the invention hidden -
In most of the world the focus is on actual disclosure and a demonstration that didn’t expose the claimed invention would not break novelty.
It is more complicated in the US. Patent law changed with the passage of the AIA in 2012. Pre-AIA there was case law that made it clearly prior art to demonstrate in public even if the invention was hidden. A famous case involved a tapered shim used in an auto wheel bearing. Even though no one in the public was aware of it and the inventor kept tabs on its performance it was ruled to be a public use.
Another famous case Egbert v Lippmann in 1881 involves a corset stay. Invisible but worn in public with the wearer agreed to confidentiality. Invention was still deemed to be in public use.
US law also took the commercial nature of the hidden public use into account. If money was involved a borderline case would swing against you.
Under this principle, if you had a popcorn making machine on the street corner making and selling popcorn with a clever inventive heater, the invention is in public use.
If a demonstration is deemed a public use, the application might still be ok if filed within a year. The US has a sort-of one year grace period to file after the inventor first “publishes” the invention. However since the invention was in public use but not published this might fail. A good question for the patent bar exam.
A twist on this is the judge-made experimental use. Someone invented a road bed design to last some specific number of years. People drove over it very publicly for many years but he got away with it because otherwise how would he/we know he invented a road that would last N years?
I used past tense because it is not clear if the AIA did or didn’t change this. The wording of 35 USC 102 is quite changed and now says -
(1) the claimed invention was patented, described in a printed
publication, or in public use, on sale, or otherwise available to the
public before the effective filing date of the claimed invention;
"Public use" does not necessarily imply it is disclosing public use. A SCOTUS case determined that the AIA did not change the on-sale bar but I do not know if the public use bar is similarly interpreted as pre-AIA.
Regarding the case of the customer having access under an NDA. In most of the world this does not break novelty even if you open the box and show them how it works, The NDA does not need to be that tight, just an agreement to keep the invention confidential. That is also true in the US, except for the use of the word customer.
Selling or offering for sale is no different than publishing the invention if the invention is complete. It is the "on sale" bar. If "customer" does not mean they are an actual customer for the device you are ok. If you have offered to sell them one it starts the 1 year clock in the US. Note - the grace period is complicated and limited after the AIA.