I knew quite well, when I gave the names of our agents in the Soviet Union, that I was exposing them to the full machinery of counterespionage and the law, and then prosecution and capital punishment.
There's a lot to be said for doing what you're not supposed to do, and the rewards of doing what you're supposed to do are more subtle and take longer to become apparent, which maybe makes it less attractive. But your life is the blueprint you make after the building is built.