With the US concerned about protecting troops deployed to the Middle East, potentially within foreign armies, one neuroscience company is developing advanced brain-scanning technology that could detect just how trustworthy an individual is.

Dubbed “HandShake,” the new system is being developed by Virginia-based Veritas Scientific, and can track blood flow in the brain while analyzing electromagnetic signals to determine how likely someone is to harbor anti-American views – as well as the possibility that they would act on them.

According to Defense One, the system works like so: The military would place a special helmet onto an Iraqi or Afghan soldier and guide them through a variety of tests, one of which would be composed of image recognition. Some would depict key locations, faces of other people, or possibly bomb parts, but it would be vital to choose very specific images in order to limit potentially inaccurate readings.

The key to the whole operation lies in the P300 response, which was described as a “200 to 500 microsecond hiccup” that occurs when you recognize a picture “of emotional significance.” Since this reaction takes place too quickly to be guarded against, the data can be especially helpful to those in the armed forces. All this information is fed through an algorithm called “Friend or Foe,” which can determine the likelihood that someone would act on traitorous instincts with an accuracy rate between 80 and 95 percent.

Speaking with the Futurist magazine, Veritas Scientific founder Eric Elbot described some of the obstacles that went into designing HandShake. Simply showing someone an image of an improvised explosive device, for example, would not necessarily help in determining risk.

“But if I flash you a picture of a diagram that shows you how to build an IED, that would be a pretty strong indicator that you might be a foe,” he said. “You wouldn’t be studying how to make an IED if you were a friend.”

“Some of it is to relax the mind. The full nature of the interaction is about a balance between what the brain will or will not react to and then finding a pattern.”

Elbot added that the technology could even be adapted to analyze reactions to various sound and smells.

The HandShake enters headlines as the US military expresses concern over assisting security forces in Iraq due to the threat of insider attacks. A New York Times report earlier this week revealed the Pentagon’s belief that US advisers in Iraq are at risk from Sunni extremists who have infiltrated the army or pro-Iran Shiite soldiers. Insider attacks in Afghanistan have also risen over the last few years, with 61 NATO troops dying in 2012 as a result.

Still, employing technology like the HandShake won’t be easy or cheap. Elbot told Defense One that adapting the system for Iraq would cost $1.2 million over two months. Another $1.6 million would be needed for software and software, tests, and establishing the operation. Once set up, maintaining the whole thing would cost about $500,000 a month for each site it’s used.

“The US is engaged in a dangerous multi-fronted, contradiction-loaded, counter-intuitive game [in Iraq],” he added. “Our technology if it were fully tested would be up to this sort of advanced challenge. I can assure you that we would do the best to work under these time and battlefield conditions and that we can make a major difference in managing complex inputs and outcomes.”

This isn’t the only brain-scanning technology the Pentagon is interested in, however. Last year, a new undertaking by the Defense Advanced Research Projects Agency called for research into technology that would allow the military to scan the brains of puppies so that officials can identify which dogs would be most ideal to train for military operations.

“The objective of this effort is two-fold; first, to optimize the selection of ideal service dogs, both in operational military and therapy environments, and second, to use real-time neural feedback to optimize canine training, shortening training duration, reducing costs, and increasing learned responses.”