1. Mary Morstan has some rather unusual talents. In TEH we see her working as a kind of receptionist or nurse for John's clinic. But she seems to have some other skills. When Sherlock first deduces her in TEH he pegs her as a linguist. She also shows a basic knowledge of cryptography and code-breaking when she recognizes her text as a specific kind of cypher. This is not the average skill-set I'd expect a nurse to have.
2. She doesn't shy away from danger, and keeps a cool head about her. We've seen this twice now, in TEH when she and Sherlock did that motorcycle chase across town, and now in TSOT when they're trying to save Sherlock's old CO. She does what needs to be done decisively but she's also not prone to hysterics. One of the most telling moments to me from TSOT was when Sherlock solved the case of the guardsman's stabbing and then she insisted in a very particular way that now John's old CO needs to let them in because that's how these things work. Just how much experience does she have negotiating with men in danger behind locked doors?
3. Then there's her family. In the Doyle canon, Mary's an orphan. Here, too, but with a twist. In the "telegraph" portion of Sherlock's wedding speech, where he reads messages from friends + family who couldn't make the wedding, we get the following: "Mary, lots of love, poppet. Oodles of love and heaps of good wishes from CAM. Wish your family could have seen this." At which point Mary starts to look very, very uncomfortable. There's no proof this is anything more than coincidence, but it's worth pointing out that CAM is the initials for the new Moriarty, the super-villain we're supposed to be introduced to this series: Charles Augustus Magnussen. Just what connection does Mary have to CAM. Does her family have a criminal background, or were they just victims of him?
4. Not quite a Mary deduction specifically, but it's worth thinking a little about "The Last Vow," the title of the final series three episode. We don't actually hear John's and Mary's wedding vows, but if they follow the Church of England liturgy, their final vow would be the same ones Americans are familiar with: "to have and to hold [...] till death do us part." And of course in the final scene, Sherlock makes what he calls his first and last vow: that he will always be there for both of them. (Actually, all three of them.) I don't doubt Sherlock means well here, but given his line of work, I can see many situations where Sherlock couldn't protect both of them. That seems to set up the kind of conflict where Sherlock must decide which of them to save, or even where he will try to be there for them but will simply fail because he's imperfect.
5. Oh, and she's pregnant.
In light of all those things, I can see a few possible spins on her character:
a. Mary's meeting with John at the clinic wasn't such a chance meeting. The fact that Mycroft stays far away from the actual event but is so much a part of the scene suggests a Mycroft connection. So theory #1 might be that Mary was initially an agent of Mycroft's assigned to keep John safe while Sherlock was taking down Moriarty's network. That she is actively a government agent and for some reason has kept this from John.
b. Theory #2: Mary has a background in linguistics (which could mean cryptography as much as studying word roots) and she was in the past either a government worker or had a criminal background of her own. At some point she got into a situation that cost her greatly (maybe getting her family killed?) and made a clean break of it, going into a rather safe and low-stress work at the clinic where she met John.
I like the second theory myself; it would make sense of her family's mysterious death without requiring her to betray John. And of course nothing may actually come of all these threads. Still, there does seem to be something more going on with Mary's background than she's owned up to so far. Given the fact that she's pregnant (meaning extra angst potential if something happens to her); given Sherlock's vow to her and her child and John - I'd be highly surprised if "The Last Vow" doesn't end with Mary in rather serious danger.