Frederick and Kimberly Kagan, a husband-and-wife team of hawkish military analysts, put their jobs at influential Washington think tanks on hold for almost a year to work for General David H. Petraeus when he was the top US commander in Afghanistan.

Given desks, email accounts and top-level security clearances in Kabul, they pored through classified intelligence reports, participated in senior-level strategy sessions and probed the assessments of field officers in order to advise Petraeus about how to fight the war differently.

Their compensation from the US government for their efforts, which often involved 18-hour work days, seven-day weeks and dangerous battlefield visits? Zero dollars.

Although Fred Kagan said he and his wife wanted no pay in part to remain “completely independent”, the extraordinary arrangement raises new questions about the access and influence Petraeus accorded to civilian friends while he was running the Afghan war.

Petraeus allowed his biographer-turned-paramour, Paula Broadwell, to read sensitive documents and accompany him on trips. But the access granted to the Kagans, whose think-tank work has been embraced by Republican politicians, went even further.

The general made the Kagans de facto senior advisers, a status that afforded them numerous private meetings in his office, priority travel across the war zone and the ability to read highly secretive transcripts of intercepted Taliban communications, according to current and former senior US military and civilian officials who served in the HQ at the time.

The Kagans used those privileges to advocate substantive changes in the US war plan, including a harder-edged approach than some officers advocated in combating the Haqqani network, a Taliban faction in eastern Afghanistan, the officials said.

The pro bono relationship, which is now being scrutinised by military lawyers, yielded valuable benefits for the general and the couple. The Kagans’ proximity to Petraeus, the country’s most famous living general, provided an incentive for defence contractors to contribute to Kim Kagan’s think tank. For Petraeus, embracing two respected national security analysts in Republican circles helped to shore up support for the war among Republican leaders on Capitol Hill.

Fred Kagan, speaking in an interview with his wife, acknowledged the arrangement was “strange and uncomfortable” at times. “We were going around speaking our minds, trying to force people to think about things in different ways and not being accountable to the heads” of various departments in the headquarters, he said.

The extent of the couple’s involvement in Petraeus’s headquarters was not known to senior White House and Pentagon officials involved in war policy, two of those officials said. More than a dozen senior military officers and civilian officials were interviewed for this article; most spoke on the condition of anonymity to discuss personnel matters. Petraeus, through a former aide, declined to comment for the piece.

As war-zone volunteers, the Kagans were not bound by the stringent rules that apply to military personnel and private contractors. They could raise concerns directly with Petraeus, instead of going through subordinate officers, and were free to speak their minds without repercussion.

Some military officers and civilian US government employees in Kabul praised the couple’s contributions — one general noted that “they did the work of 20 intelligence analysts”. Others expressed deep unease about their activities in the headquarters, particularly because of their affiliations and advocacy in Washington.

Fred Kagan, who works at the conservative American Enterprise Institute, was one of the intellectual architects of President George W Bush’s troop surge in Iraq and has sided with the Republican Party on many national security issues. Kim Kagan runs the Institute for the Study of War, which favours an aggressive US foreign policy. The Kagans supported President Obama’s decision to order a surge in Afghanistan, but they later broke with the White House on the subject of troop reductions. Both argue against any significant drawdown in forces there next year.

After the couple’s most recent trip in September, they provided a briefing on the war and other foreign policy matters to the Republican vice-presidential candidate Paul Ryan.

The Kagans said they continued to receive salaries from their think-tanks while in Afghanistan. Kim Kagan’s institute is funded in part by large defence contractors. During Petraeus’s tenure in Kabul, she sent out a letter soliciting contributions so the organisation could continue its military work, according to two people who saw the letter.

On 8 August 2011, a month after he relinquished command in Afghanistan to take over at the CIA, Petraeus spoke at the institute’s first “President’s Circle” dinner, where he accepted an award from Kim Kagan. The private event, held at the Newseum in Washington, also drew executives from defence contractors who fund the institute.

“What the Kagans do is they grade my work on a daily basis,” Petraeus said, prompting chortles from the audience. “There’s some suspicion that there’s a hand up my back, and it makes my lips talk, and it’s operated by one of the Doctors Kagan.”

Before the Iraq war hit rock bottom, the Kagans were little-known academics with doctorates in military history from Yale University who taught at West Point. He specialised in the Soviets, she in the ancient Greeks and Romans.

In 2005, Fred Kagan jumped to the American Enterprise Institute and joined the fractious debate over the Iraq war, arguing against the Bush administration’s planned troop withdrawals. His follow-on research, conducted with his wife and retired General Jack Keane, the former vice chief of staff of the Army, provided the strategic underpinning for the troop surge Bush approved in January 2007. After Obama was elected, he made clear that his strategic priority was Afghanistan. In March 2009, they co-wrote an opinion piece in The New York Times that called for sending more forces to Afghanistan.

When General Stanley McChrystal assumed command of the war that summer, he invited several national security experts to help draft an assessment of the conflict for the Defence Secretary, Robert Gates. The 14-member group included experts from several Washington think-tanks. Among them were the Kagans. The Afghan assessment struck an alarming tone that helped McChrystal make his case for a troop surge, which Obama eventually authorised.

The Kagans should have been thrilled, but they soon grew concerned. They thought McChrystal’s headquarters was not providing enough information to them about the state of the war. The military began to slow-roll their requests to visit Afghanistan. In early 2010, they wrote an email to McChrystal, copied to Petraeus, that said they “were coming to the conclusion that the campaign was off track and that it was not going to be successful,” Fred Kagan said. Worried about the consequences of losing the Kagans, McChrystal authorised the trip, according to the staff members.

After their trip, which lasted about two weeks, the Kagans penned a piece for the Wall Street Journal. “Military progress is steadily improving dynamics on the ground,” they wrote.

“We obviously came away with… a more nuanced view that persuaded us that we were incorrect in the assessment that we had gone in with,” Fred Kagan said in the interview. The Defence Department permits independent analysts to observe combat operations, but the practice became far more common when Petraeus became the top commander in Iraq. He has said that conversations with outside specialists helped to shape his strategic thinking.

The take-home benefit was equally significant: when the opinion makers returned home, they inevitably wrote in newspapers, gave speeches and testified before Congress, generally imparting a favourable message about progress under Petraeus, all of which helped him sell the war effort and expand his popularity. Petraeus called them his “directed telescopes” and urged them to focus on the challenge of tackling corruption and building an effective government in Afghanistan.

When they returned in September 2010, the Kagans’ writ no longer resembled the traditional think tank visit or an assessment mission intended to inform an incoming commander.

They were given desks in the office of the Strategic Initiatives Group, the commander’s in-house think-tank, which typically is staffed with military officers and civilian government employees. The general’s staff helped upgrade their security clearances from “Secret” to “Top Secret/Sensitive Compartmented Information, the highest-level of US government classification.

The new clearances allowed the Kagans to visit “the pit”, the high-security lower level of the Combined Joint Intelligence Operations Centre on the headquarters. There, they could read transcripts of Taliban phone and radio conversations monitored by the National Security Agency.

“They’d spend hours in there,” said one former senior civilian official at the headquarters. “They talked about how much they loved reading intel.”

Their immersion occurred at an opportune time. Petraeus was fond of speaking about the importance of using troops to protect Afghan communities from insurgents, but he recognised that summer that the Obama White House wanted to narrow the scope of the war. As a consequence, the general decided to emphasise attacking insurgent strongholds – and so did the Kagans. They focused on the Haqqani network, which US officials believe is supported by Pakistan’s intelligence service. Haqqani fighters have conducted numerous high-profile attacks against US and Afghan targets in Kabul and other major cities.

The Kagans believed US commanders needed to shift their focus from protecting key towns and cities to striking Haqqani encampments and smuggling routes, according to several current and former military and civilian officials familiar the issue.

In the summer of 2010, they shared their views with field officers during a trip to the east. “They implied to brigade commanders that Petraeus would prefer them to devote their resources to killing Haqqanis,” said Doug Ollivant, a former adviser to the two-star general in charge of eastern Afghanistan. But Petraeus had not yet issued new directives to his three-star subordinate or the two-star in the east. “It created huge confusion,” a senior officer said. “Everyone knew the Kagans were close to Petraeus, so everyone assumed they were speaking for the boss.”

While the Kagans refused to discuss their work in detail — they said it was privileged and confidential — Fred Kagan insisted that they were careful to note before every meeting “that we were not speaking for Petraeus”.

Fred Kagan said he and his wife wanted to facilitate conversations about vital tactical issues, exposing field commanders “to different ideas and different ways of looking at the problem.”

The Kagans are prolific contributors to debates about national security policy, cranking out a stream of opinion pieces and convening panel discussions at their respective institutions. But once they began working for Petraeus, they ceased writing and commenting in public. “When we were in Afghanistan… we were not playing the Washington game,” Fred Kagan said. “We were not thinking about anything … except how to defeat the enemy.”

Although they functioned as members of Petraeus’s staff, they said they did not want to be paid. “There are actual patriots in the world,” Fred Kagan said. “It was important to me not to be seen to be profiting from the war.” Military officials said the Defence Department travel rules permit civilian experts to provide services to the military without direct compensation. A spokesman for the US Central Command, Colonel John Robinson, said that the military was still examining to what extent Petraeus’s arrangement with the Kagans “satisfied regulations regarding civilian services to government organisations”.

The Kagans’ volunteerism was an open secret at the headquarters, and it bred suspicion. Some officers questioned whether they funnelled confidential information to Republicans – a claim the Kagans deny. Others worried that the couple was serving as in-house spies for Petraeus. A colonel who worked for Petraeus said the Kagans “did great work,” but “the situation was very, very weird. It’s not how you run an HQ.”

For Kim Kagan, spending so many months away from research and advocacy work in Washington could have annoyed many donors to the Institute for the Study of War. But her major backers appear to have been pleased that she cultivated such close ties with Petraeus, who went from Kabul to head the CIA before resigning this autumn over his affair with Broadwell. At the August 2011 dinner honouring Petraeus, Kagan thanked executives from two defence contractors who sit on her institute’s corporate council, DynCorp International and CACI International. The event was sponsored by General Dynamics. All three firms have business interests in the Afghan war.

Kagan told the audience that their funding allowed her to assist Petraeus. “The ability to have a 15-month deployment essentially in the service of those who needed some help – and the ability to go at a moment’s notice – that’s something you have sponsored,” she said.

After accepting the award, Petraeus heaped praise on the institute. “Thanks to all of you for supporting an organisation that General Keane very accurately described as filling a niche — a very, very important one,” he said. “It’s now a deployable organisation. We’re going to start issuing them combat service stripes.”

Timeline: David Petraeus

7 November 1952: Born in New York.

1972: Marries Holly Knowlton.

2006: Meets Paula Broadwell, a Harvard graduate.

October 2008: Promoted to head of US Central Command.

June 2010: Appointed head of international forces in Afghanistan.

September 2011: Takes up post as director of the CIA. November 2011: Starts affair with Ms Broadwell.

January 2012: Ms Broadwell publishes book on General David Petraeus.

June 2012: FBI establishes harrassing emails between Broadwell and Jill Kelley.

22-29 October: Petraeus admits to affair with Ms Broadwell, but denies leaking any security information.

9 November: President Obama accepts his resignation.

13 November: General John Allen, the top US commander in Afghanistan, under internal investigation.