Modi, a Hindu nationalist who is the front-runner to win the five-week election starting on April 7, has taken an aggressive tone against the two neighbouring nations. On the campaign trail, he has warned Beijing to shed its "mindset of expansionism" and in the past he has railed against Pakistan, an Islamic state, for attacks by Muslim militants in India.
"I swear in the name of the soil that I will protect this country," Modi said at a rally in the northeastern state of Arunachal Pradesh last month, a region claimed by China.
India, China and Pakistan are all nuclear powers. They are also jockeying to take positions in Afghanistan as Western troops start to withdraw from the war-torn nation after a 12-year insurgency.
India has fought three wars with Pakistan and had a 1962 border skirmish with China. It came close to a fourth war with Pakistan in 2001 but since then, its foreign policy has been mostly benign.
Modi has painted the ruling Congress party, which has been in power for more than 50 of the 67 years since India became independent, as weak on national security. However, the country is one of the top buyers worldwide of military hardware, purchasing about $12.7 billion in arms during 2007-2011, according to the Stockholm International Peace Research Institute, everything from basic military goods to an aircraft carrier.
Modi's two advisers said that while his foreign policy would be muscular, it would also aim to keep a lid on regional tensions to allow a focus on reviving the economy.
"Ours will be an economy-driven foreign policy and the whole idea is to build India's economy so solidly that you can deal with other countries on our own terms," said a strategist involved in formulating the manifesto of Modi's Bharatiya Janata Party (BJP).
As leader of the economic-powerhouse state of Gujarat for more than a decade, Modi has courted investment from China. As prime minister, the advisers say, he would seek to steer a course between defending India's security interests and growing business links with the world's second-biggest economy.
Modi has never clearly spelled out his foreign policy vision, but he has praised former BJP prime minister Atal Behari Vajpayee - who ordered a series of nuclear tests in 1998 - for adopting a strategy based on both 'Shakti' and 'Shanti', Sanskrit for power and peace.
"The Chinese will understand the new PM is not a wimp and they won't do anything adventurous," the BJP strategist said.
HUNDREDS OF INTRUSIONS
According to India, China has made hundreds of intrusions along their disputed border in recent years. China denies crossing into Indian territory. Adding to disquiet in India are China's forays into the Indian Ocean and its involvement in building a string of ports stretching from Pakistan's Gwadar to Chittagong in Bangladesh.
The BJP wants a rapid naval build-up and a firmer response to border violations. It also plans to speed up construction of roads and communication lines along the land border to narrow the gap with China's infrastructure on the Tibetan plateau.
The advisers, who spoke on condition of anonymity because the BJP's manifesto is still under wraps, said Modi would move quickly to lay out India's core security interests in its neighbourhood, replacing what they dismissed as a reactive policy under the Congress party.
Topping the list will be an early settlement of the border dispute with China, an assertion of India's primacy in the Indian Ocean, and a low tolerance of Muslim militancy that India believes is often backed by Pakistan.
"You will see a more nationalistic approach on issues relating to terrorism in our neighbourhood. It is a much more hard view of these things," said one of the advisers.
Outgoing Prime Minister Manmohan Singh has pushed for peace with Pakistan, and had hoped to visit his birthplace in Pakistan's Punjab province in a final gesture of reconciliation before leaving office.
But his efforts were stymied by opposition at home over Islamabad's failure to act against those India holds responsible for masterminding a 2008 attack on the city of Mumbai in which 166 people were killed by 10 gunmen from Pakistan.
Rajiv Dogra, a former Indian ambassador to Pakistan, expects a more forceful policy under a BJP government, both because of domestic pressure and an uncertain regional environment as the United States pulls out troops from Afghanistan.
"So far there has been a consensus in India - irrespective of the complexion and change in government - on the broad foreign policy contours," he said. "But this time, if there is a change in government, I do expect a break from that tradition."