This one’s actually simpler than that. If the gun is not mission critical, don’t carry it.
If your character’s cover won’t allow them to carry a gun, then they shouldn’t have one. This may sound risky, it is, but it’s a lot safer than risking their cover by carrying equipment they don’t need.
It doesn’t matter if your character’s a spy or an undercover cop. If finding a gun on them would blow the operation, they won’t take it.
Here’s the thing. If your character manages to sell their cover, they won’t need the gun. If they fail to, six rounds will not save them. And, if someone does find the gun, it could make selling their cover much harder.
If it’s an assassination, or a smash and grab, then things get a lot more complicated. In situations like that a gun may very well be mission critical, and your character’s going to need a way to get it in.
If there’s no security cordon, then she could probably get a Glock 33 or any other subcompact pistol in by sticking it in her hand bag. (I’m picking the 33 because it fires a SIG .357 cartridge, but the subcompact Glocks come in 9mm, .40, and .45.) Worst Case, she might be restricted to something like a SIG P232 or P230.
If there is a security cordon, her best option will be a dead drop or using a different venue for access.
With a dead drop, she’ll need to have the gun on her for as little time as possible. This means the drop needs to be someplace that security didn’t check. Somewhere she can easily and quickly gain access to, and someplace close to where she’s going to use it. Combine this with a need to ditch the weapon as quickly as possible, and an exit option, and you’ve got a rather annoying list of requirements.
The better someone’s security detail is, and the more control they have over the event will dictate what is a viable hiding place. With little to no security, anyplace could be a viable hiding location. In tight security, they may even take down the sub ceiling long enough to verify that nothing’s been stashed up there.
Also, remember, even if the target isn’t the person the cordon’s being set up for, they’ll still benefit while they’re in it. This could make a party like this a spectacularly poor time to execute a hit, unless generating a high profile is the point.
Finally, the other option is to go in as someone in building maintenance or catering. This would afford your character clothing options that allowed for them to more effectively hide a weapon on their body, and it would make them harder to identify before and after the hit. Also, clothing your character could actually fight in. Fighting in a suit isn’t fun, but it’s preferable to fighting in a dress. In some cases, it would even put them under less security scrutiny. It’s easier to disguise yourself as a member of the waitstaff, and retrieve a handgun from behind the dumpster, where security hasn’t checked, and wander back in, if they think you were just going out for a smoke break.
Another possibility with a hit would be to trade up the handgun for a garotte. Wires are much easier to hide, can be made from materials that won’t show up under most detector systems, and won’t draw nearly as much attention as a gunshot. The trade off is, they take longer to use, and your character needs to be right next to the target.