Sansa is smarter than she thinks. ASOS, somewhere in the begining, when she's talking with Margaery.
“Margaery, please,” she said, “you mustn’t.” It was hard to get the words out. “You mustn’t marry him. He’s not like he seems, he’s not. He’ll hurt you.”
“I shouldn’t think so.” Margaery smiled confidently. “It’s brave of you to warn me, but you need not fear. Joff’s spoiled and vain and I don’t doubt that he’s as cruel as you say, but Father forced him to name Loras to his Kingsguard before he would agree to the match. I shall have the finest knight in the Seven Kingdoms protecting me night and day, as Prince Aemon protected Naerys. So our little lion had best behave, hadn’t he?” She laughed, and said, “Come, sweet sister, let’s race back to the river. It will drive our guards quite mad.” And without waiting for an answer, she put her heels into her horse and flew.
<snip>
Ser Loras is a Tyrell, Sansa reminded herself. That other knight was only a Toyne. His brothers had no armies, no way to
avenge him but with swords. Yet the more she thought about it all, the more she wondered. Joff might restrain himself for a few turns, perhaps as long as a year, but soon or late he will show his claws, and when he does . . . The realm might have a second Kingslayer, and there would be war inside the city, as the men of the lion and the men of the rose made the gutters run red.
Sansa was surprised that Margaery did not see it too. She is older than me, she must be wiser. And her father, Lord Tyrell, he knows what he is doing, surely. I am just being silly.
Later The Littlefinger tells her the same thing.
“Mace Tyrell actually thought it was his own idea to make Ser Loras’s inclusion in the Kingsguard part of the marriage contract. Who better to protect his daughter than her splendid knightly brother? And it relieved him of the difficult task of trying to find lands and a bride for a third son, never easy, and doubly difficult in Ser Loras’s case.
“Be that as it may. Lady Olenna was not about to let Joff harm her precious darling granddaughter, but unlike her son she also realized that under all his flowers and finery, Ser Loras is as hot-tempered as Jaime Lannister. Toss Joffrey, Margaery, and Loras in a pot, and you’ve got the makings for kingslayer stew."