Security officials gave the men's ranks on condition of anonymity.
They did not say what the ISI officials were doing in the area.
Bajaur, one of Pakistan's seven federally administered tribal zones bordering Afghanistan, was the scene of an air strike on a school in October 2006 that killed 80 people.
Pakistani officials said it was an al-Qaeda training camp but locals said the victims were students.
In January 2006, a purported CIA missile strike aimed at Ayman al-Zawahiri, the Egyptian deputy al-Qaeda leader, killed 18 people.
Monday's "anti-terror" agreement was signed at a ceremony attended by tribal elders near Khar, the main town of the Bajur region, said Malik Abdul Aziz, head of Bajaur's tribal council.
Aziz said local activists said they will not shelter foreign fighters, but it was unclear whether the deal included measures to prevent them joining Taliban operations.
|"After hectic efforts and talks with [local fighters in the tribal region], we have signed a peace deal with the government to help it fight terrorism"|
Malik Abdul Aziz, head of Bajur's tribal council
Aziz said: "After hectic efforts and talks with [local fighters in the tribal region], we have signed a peace deal with the government to help it fight terrorism."
In return for the tribal elders' support, the government will expedite development projects in the region, he said.
Officials argue that the development projects will counter the poverty that helps extremist groups find recruits among the tribal region's young and unemployed.
Critics say the government's military pullback has instead handed even greater control to fighters.
Hundreds of al-Qaeda fighters and Taliban fugitives sought refuge in the tribal belt after the fall of the Taliban regime in Afghanistan in 2001.
Tuesday's attack which killed the Pakistani intelligence officers occurred around the time the principal of a high school in nearby Tank was abducted.
About a dozen armed pro-Taliban activists barged into the house of Farid Mehsud, principal of the Oxford Public School in Tank, which borders the South Waziristan tribal region, his relatives said.
They "manhandled" family members and took Mehsud and his brother Humayun away in waiting cars, a close relative of the abductees said, requesting not to be identified by name.
|Hundreds of foreign fighters sought refuge in|
the area after the Taliban rout in Afghanistan
The relative quoted the armed men as saying: "If you destroy us, you cannot expect safety."
The principal on Monday had called for police protection after a group of armed men visited his school and others in a bid to recruit youth to fight against Nato and US forces in Afghanistan.
In the same town, a militant recruiter and a policeman died in a clash on Monday.
Earlier on Tuesday, fighters fired eight rockets at a paramilitary troop fort in Tank and troops retaliated, but the exchange of fire caused no casualties, officials said.
Activists recently torched video shops and banned barbers from shaving beards in northwestern Pakistan, fuelling concern about the "Talibanisation" of the already conservative area.
Pakistan poured thousands of troops into parts of the tribal belt to combat fighters who fled Afghanistan. Operations in the area have left 700 soldiers and 1,000 fighters dead.