How to run agents without revelaing the robot (RPA) code?

Xaml, does support getting compiled to a dll, but can still be decompoled.
You can disable caching for specefic workflows in openrpa (if you are using openflow), then it will only keeep it in ram, but if you know the platform you can still find it.
So you can add a little security though obscurity, but the real answer is: no, that is not possible.