For five years, Ben Watson served in the United States Army, spending part of that time in public affairs in Kandahar, Afghanistan, writing news releases, working as a combat cameraman and accompanying a reporter who was embedded with the troops. Now he is on the other side of the divide, working as the news editor at Defense One, a digital publication owned by Atlantic Media that covers military issues and global security.

Mr. Watson said his time in the military had left him with sympathy for government officials stationed on the line between freedom and security — people like the Customs and Border Protection agent who inspected his passport on Thursday at Dulles International Airport outside Washington.

“They need broad leeway to ask questions,” Mr. Watson, 37, said in an interview. “I understand that. Their job is to keep us safe.”

But what happened in the airport that day crossed the line, he added.

According to an account that Mr. Watson co-wrote for Defense One, the agent asked him what he did for living, and he replied, “Journalism.”