If Holofernes had been a nice guy who was concerned about his wife and family back home, he never would have called Judith to his tent or gotten drunk.
If he had cared about Judith, same thing.
Meanwhile, Judith lived four days in his camp and never ate any of his bread or even of his non-kosher-affected food like raw fruit, which meant that she had no guest obligation to Holofernes, and could kill him if she wanted. So she did.
It is a very uncomplicated, not terribly cunning plan. Getting away was the cunning part.
The interesting bit is that Judith performs this as a sort of prophetic act, similar to her admonishment of the elders earlier in the story.
And it all goes back to the earlier part of the story, where Nebuchadnezzar’s forces are destroying everything else that every other people worships, even if those people.surrendered after being promised peace. Nebuchadnezzar was to be the only god. Holofernes promised Judith peace and worship for her God also, but his history tells us that he was not going to stand by it; and he didn’t leave Judith be. Even if it was painted as him wanting her to break God’s law willingly, he wanted her to break God’s law and become his bedmate, instead of a respectable widow with prophetic gifts.
Holofernes didn’t play fair with anyone, so it is strange to complain that Judith followed every law and also won.