Hidden entities

Is there any way to generate a geometry and keep it hidden to the point the operator can’t access it?

All geometry you generate using Rhino Common will only be accessible to the user once you send it to the document. Is that what you need?

Using RhinoCommon you can basically do everything that Rhino is capable of in your code. The geometry created is not inside the current Rhino document until you write it to the document.
Of course you would have to ensure that the operator also can’t access the source code of your script (Python/C#/VB.NET) if you really want to hide it, so to speak.

Hope this helps.

Are these entities created in RhinoCommom saved in the file? Or are they active only during code execution?

They exist only in memory during code execution (please correct me if this is the wrong way to phrase it, McNeel devs!).
They are only added to the document if you commit them into it, using one of the methods that inherit RhinoDoc.Objects.Add, for more info on that method see here:

EDIT: Was on mobile yesterday, see here for all the different “Add-Methods” of the ObjectTable: