Mwahahaha.

When six GOP primary contenders descended on Fox News’ midtown headquarters for a “candidates forum” with a trio of red state attorneys general on Saturday night, the candidates probably expected tough questions about their positions. But they certainly didn’t expect to find a New York Times reporter roaming backstage.

Fox’s decision to allow Times scribe Jim Rutenberg into the building to confront the candidates in person threw campaign aides off guard, especially in the Romney camp, which went into “defensive mode immediately, insisting that the reporter stay far away,” as Rutenberg later wrote.

But the decision was just the latest example of what Fox head Roger Ailes recently called a “course correction” in an interview with Howard Kurtz of Newsweek. The Romney team’s debate-night tussle was the second embarrassing episode suffered by the candidate at the hands of Fox News in a week, after Bret Baier conducted a hard-hitting interview with Romney on November 29 that made news for several days. (After the contentious interview, Baier told Bill O’Reilly that Romney privately called his questions “overly aggressive” and “uncalled for.”) The network has also taken on the other GOP primary contenders. In July, Chris Wallace pointedly asked Michele Bachmann, “Are you a flake?” And in November, Fox gave a platform to Herman Cain accuser Sharon Bialek and her attorney Gloria Allred.

This chaotic and raucous primary season is demonstrating that Roger Ailes will put the interests of his network ahead of all else. If 2010 was the year that Fox fueled the tea party — culminating in record ratings and the Republican sweep of the House midterms — 2012 is shaping up to be the year that Ailes decided Fox will benefit if the political world recognizes that his network is willing to make GOP candidates sweat in front of their base. Like any good candidate, the network plans to tack toward the center for the general election.

It’s a complex game Ailes is playing. Conversations with Fox sources and media executives suggest a new strategy: Fox is trying to credibly capture the center without alienating its loyal core of rabid viewers. To this end, the network is flexing its news-gathering muscles in high-profile ways that will capture media attention.

Why bother? Partly as a preemptive measure against CNN. While CNN has slipped again to third place in the cable ratings race, Fox recognizes that the network still poses the biggest threat if it gets its act together. During the 2008 election, Anderson Cooper and Wolf Blitzer surged to the top of the ratings for their respective time slots and CNN scored wins on big news events. Since then, CNN has flailed and ratings have dived. But CNN’s brand remains powerful at big newsmaking moments — and presidential elections are about as big as they get. Which partly explains why Fox wants to distance itself from the overt championing of tea-party politics that defined its post-2008 coverage of Obama. Dominating as much of the election as possible means appealing to viewers beyond the conservative base and being perceived as a credible news outfit. That means pushing the network’s journalists, as when Fox allowed Kurtz to shadow Baier, Wallace, and senior Washington producer Marty Ryan before the September debate in Orlando.

The GOP primary candidates may think Fox News studios are friendly territory. But while it will continue to function as home turf, especially in the prime-time hours, they shouldn’t be surprised to see more curveballs. The front-runner Ailes cares most about is Fox.