I can see how his behavior hurt you. I'm not entirely sure why it caused you a panic attack, but I have anxiety/panic disorder myself, so I know it can be hard to explain why an attack happens. Was your panic attack because he broke the rule, or because you're afraid of what he might have exposed himself and you to?
Generally speaking, agreements and boundaries work better than rules. For example, "We both agree we'll ask for test results before having sex with a new partner," or "If you have sex with a new partner without test results, I will start using condoms with you," rather than "You can't have sex with someone new until you have their test results." It all seems like semantics, but there are differences in intent and meaning. Of course, you don't say here how your rule with your husband is stated, so it might be more of an agreement than a rule. And to be honest, when it comes to sexual health, I think rules are less of a problem than they might be in general.
However, it's also worth noting that a rule like yours impacts people who were not involved in the making of the rule, and therefore are not obligated to abide by it. Personally, if a potential partner had a rule about sex that I didn't agree with, I simply wouldn't have sex with them, but I would be a bit irked at being told "You have to follow this rule that my wife and I have." It may be that his partner felt similarly and chose not to follow a rule that she had no part or agreement in. That doesn't make *his* choice right, since he *did* presumably get a vote in making that rule, but it's another reason he might have chosen to break it.
Did your husband tell you he'd broken the rule, or did you find out accidentally? It seems to me that if he told you, he was aware he'd done something hurtful and wanted to be honest with you about it, which is better than if he'd tried to hide it or had lied about it. That doesn't make it any better that he broke the rule, but if he did tell you about it right away, in my opinion it at least shows some remorse for his actions.
Some people simply don't do well with rules, particularly around sexual encounters. It may be that he got caught up in the moment and wasn't thinking, which sounds like a cop-out but for some people, it happens. And to me, a "wasn't thinking" incident like that, while still unquestionably a violation of the rule and not a good thing, has more possibility of reparations and forgiveness than if he'd deliberately decided in advance that he wasn't going to follow the rule. Did he indicate to you whether it was a deliberate choice on his part?
Does your husband have a history of breaking agreements you and he have set in place, or is this atypical behavior of his? If it were me, while my trust would unquestionably be damaged and it would take time and effort on his part to show me that I can still trust him, I would be more inclined to give him a second chance if this is a "first offense," so to speak, and there's no past indication that he's not the type to keep agreements.
Ultimately, how you respond is up to you. If you choose to stay in the marriage, that's a valid choice. If you choose to leave him over this incident, that's also a valid choice. Sexual health can be a serious thing, and while I personally wouldn't end a relationship over a one-time violation of a sexual health agreement, I could understand someone else doing so.
Just as an aside, and something to think about, while STI testing is a good thing to have done on a regular basis, particularly when you have additional partners, it's important to note that standard STI screens do NOT test for all possible STIs. Herpes and HPV in particular are common STIs that are not part of the standard battery, and there are others as well. And sometimes there are false negatives. So having negative test results in hand doesn't guarantee that someone doesn't have any STIs, it simply means that they tested negative for the ones for which they were tested. It's also worth noting that some doctors/clinics will not give written test results unless you've tested positive for something, and sometimes not even then; early on in my poly journey, I had to argue with my doctor's office for a few months before I finally got them to send me a written copy of my test results.
That said, STI screens are still the most reliable measure of sexual health, and it's definitely worth having them done and seeing or discussing the results.