Oh, boy. Now our speaker imagines that his mistress' heart ("bosom") is a jail ("ward") that's holding his heart prisoner.
Okay. Hearts can't literally be imprisoned in other people's hearts, unless it's part of some freaky science experiment.
But this is a sonnet, not Frankenstein. So, the dude is basically saying that he's a prisoner of love, which is, you guessed it, another courtly love cliché.
Here, the metaphor really gives us a sense of how powerless and confined our speaker feels in the relationship.
By calling his mistress's heart a "steel bosom," he also gives us a sense that she's cold and hard instead of warm and loving. (Yeah. We sort of got that already.)
Plus, that word "steel" also conjures up a pretty vivid image of the kinds of steel bars you might find in an actual prison. Yikes.
So, wait a minute. Why the heck would our speaker volunteer to be a love prisoner if it's so awful? Hmm…
But then my friend's heart let my poor heart bail;
Oh, we get it. He's offering to be his mistress's love prisoner so she'll take it easy on his buddy.
In other words, he's trying to compromise with her now by saying something like "Go ahead and imprison my heart in your jail, but please just let my heart be 'bail' for my friend's heart."
This line is a little tricky because "bail" can be read a couple of different ways.
But, the overall meaning is that our speaker wants to protect his pal from being hurt by the cruel mistress.
On the one hand, we can read the line to mean that the speaker is offering to "bail" his friend out of the mistress's prison/heart, just like someone might offer up bail so an inmate can avoid jail time. In other words, he's offering to sacrifice himself to the mistress so she'll leave his buddy alone.
But, back in the day, "bail" also meant to confine or imprison. So, this line can also mean that our speaker imagines that his own heart is a little jail within a jail, where he'll get to keep tabs on his friend's heart.
(You might want to think of these three hearts as a set of Russian nesting dolls—each one is placed inside the other.)
So, if the friend's heart is locked up inside the speaker's heart, that means our speaker gets to be a lot closer to his friend than the mistress gets to be, right?
Gee. That sounds a little possessive, don't you think? We believe our speaker when he says he wants to protect his friend, but it also seems like the dude just wants to have his friend all to himself.
Whoe'er keeps me, let my heart be his guard; Thou canst not then use rigor in my jail.
Here, he says something like, "Even though I'm a prisoner in your heart, please let my heart guard my friend's heart. That way, you can't be so strict and harsh ('use rigor') in my jail."
Um, okay. This love prisoner metaphor seems to be getting away from our speaker and we're not sure how we should read this.
(By the way, when a regular old metaphor turns into an extended metaphor like this, it's called a conceit. The poet John Donne is famous for using them.)
So, what is it that our speaker is trying to say here? Is he saying that as long as he's got his friend by his side, his mistress's cruel ways can't hurt him as much because his friend gives him comfort? Or, is he suggesting that his mistress wouldn't dare hurt him anymore because hurting him would also mean that she's hurting his friend, too? Take your pick.
In the end, we're not sure any of this bargaining is going to help our speaker out. After all, he's trying to reason with a woman who basically acts like a really strict prison warden who likes to be harsh ("use rigor") with her inmates.
And, yeah, there's probably another dirty joke here.
The phrase "to rig" can mean "to be with sexually." So, maybe our speaker is threatening to withhold sex from his mistress? Or, maybe he's taunting her by saying that his friend's not going to hook up with her anymore? Maybe both?