@somedaymaybe1 ,
If you punish your daughter, you are teaching her to not think for herself but to follow rules blindly even when they are stupid rules. Have you considered the fact that you might be wrong?
Look at it from your child's point of view. Your rule doesn't make very much sense.
When your friends come and knock on the door, the polite thing to do is open the door and talk to them. That is what you have taught her by example. Her behavior was completely rational and correct. She did not die. She didn't get hurt. And there was no reason to think that she would.
My 11 year daughter rides the train by herself in Boston. I taught her to be smart and to be responsible. I don't teach her to be afraid. In truth, the world is not a very dangerous place for her. When she is alone in the house, I would have no problem with her opening the door to talk to friends. In fact, a few weeks ago she called me to ask if she could walk to the library with friends. That was fine with me.
Eleven year olds don't need to be locked into crypts. They are learning to be mature and they need to be given this opportunity. Your daughter was acting mature. There is no reason that you should punish her for it.
My advice is that rather than punishing her. You should have a two-sided conversation. You can explain to her that you are nervous. You are teaching her to have respectful discussions with other people where you acknowledge their point of view. You can also listen to and understand how she is feeling. Then you can come up with an agreement that both of you are happy with.
And hopefully you can see that her opening the door to talk to two friends that she knows is a perfectly fine thing for her to do.