Last September I went on assignment with a translator to Dagestan, a Russian republic on the Caspian Sea. Since we were reporting on the Islamic insurgency, which has been simmering there since the 1990s, it wasn’t particularly encouraging when our taxi was stormed by four huge men in blue camouflage who pointed assault rifles and shouted threats. It further dawned on me that the situation had become problematic when the operatives pushed us out of the car and marched us at gunpoint into the dreaded “Department Six” anti-terrorism headquarters. The penny finally dropped when I saw the sign above the door of the interrogation room. It read, “For the Wanted.” Just then, a particularly aggressive man barked that we would never get out.

“Um, not good,” the translator whispered.

We had both known that detention was a risk on this trip, as she had been arrested a couple of times before. Frankly, I should have known better, because I teach conflict-zone reporting and spend hours telling other people how to avoid such perils. We had foolishly ignored Rule No. 1: Don’t stumble into a danger trap. I’m normally a cautious wimp, and had been careful earlier in the week about whom to approach. We hired drivers who remained ignorant about our mission. We never sent sensitive e-mails.

But we got sloppy on this afternoon, when we impulsively poked around the town of Khasayurt, a goryachaya tochka, or hot spot, where security forces were rounding up suspected terrorists and shooting them. We should have alerted the former deputy mayor, with whom we dined the previous night, to arrange an official escort. We should have turned around when military helicopters whirled overhead. But we didn’t.

Unbeknownst, we had blundered into a “special operation” against the Islamic extremists who want to establish an independent Muslim state in Russia’s North Caucasus region. The stunning mountainous area is a growing stage for an international jihad, and bombs and shootings occurred daily the week we were there. Authorities deem the rebellion the biggest security threat in Russia, and they don’t look fondly upon independent journalists who witness their harsh responses.

All this was flitting through my head as the snarling man told us what he thought about human rights—not much—and waved his AK-47. Meanwhile, two secret service agents inspected our documents. Rule No. 2 is to have a contingency plan and we did, thank God. We regularly checked in with our editors, so they would notice if we didn’t call that evening. Our wills were in order. We coded incriminating information and were carrying clean notebooks with the names of Very Important People. Our credentials looked fine. We had emergency contacts on speed dial. Back at the hotel I had piled dirty laundry on top of my computer. If agents bothered to face the mess, all they would find was a dummy laptop that I used for traveling. It had innocuous files and a clean browser history and no suspicious software. Our cover story was bland and true: I was researching a book about mountains and conflict.

However, the fact that Khasayurt was far from the hills troubled our interrogators, as did the fact that we had made contact with a woman whose son their buddies had assassinated. I tried to divert their attention by pointing out we had committed no crime. (Rule No. 3: Know the law and don’t break it.) To which the barking man replied: “Our notion of democracy is different from yours.” He touched his gun for extra effect.

The two secret agents, meanwhile, played a classic “good cop, bad cop” routine, complete with offering cigarettes (bad cop) and health warnings (the good one). “Take it,” the mean cop snarled, pushing the tempting smokes toward me. “Don’t! Smoking is unhealthy,” urged the nice one. Spotting an opening, the translator beckoned the good cop into the hall. (Rule No. 4: Gain control of the situation.) She informed him that I was an extremely famous person whose capture would cause a diplomatic mess. “You wouldn’t want that,” she counseled, to which he replied, “Oh, no.” Upon returning to the cell he dismissed the barking policeman with an apologetic, “These guys are unprofessional.”

Judith Matloff is a contributing editor to the Columbia Journalism Review. She is a veteran foreign correspondent, who teaches a course on conflict reporting at Columbia, and is the author of Fragments of a Forgotten War and Home Girl.