Gilani made the remarks while participating in the programme Prime Minister Online on state-run PTV tonight.
He was responding to questions related to possible strains between the Pakistan People's Party-led civilian government on one side and the judiciary and military on the other.
He contended that the government, military and the Inter-Services Intelligence agency were on the same page on the issue of the controversial secret memorandum sent to the US military in the wake of the killing of Osama bin Laden.
There will be a joint reply from the government and army to the Supreme Court on the memo issue, he said.
The apex court today ordered the formation of a commission to investigate the Memogate controversy and sought responses on the issue within 15 days from the President, army chief and ISI chief.
The memo, made public by Pakistani-American businessman Mansoor Ijaz, states that the government sought help from the US to prevent a military coup in May.
In response to a question, Gilani said Pakistan's decision to boycott the Bonn Conference on Afghanistan to protest a NATO attack that killed 24 soldiers was final and taken collectively.
"How we can attend the Conference when our sovereignty was attacked?" he said.
Afghanistan's soil was used against Pakistan's sovereignty and integrity, and under such circumstances, Islamabad had to focus on its own security, he said.