Former US president Barack Obama has warned against complacency in taking the benefits of liberal democracies for granted, saying rights like freedom of speech, freedom of association, protection of minorities and the rule of law have to be fought for and defended, sources say.

In a speech that drew a standing ovation from guests at a private dinner at the Art Gallery of New South Wales on Friday night, Mr Obama said he was by nature a congenital optimist, not an alarmist. But the world was at a “fork in the road”, a time when the international order established after World War 2, and the core values rooted in the enlightenment – pluralism, science and reason – were being tested.

He said social and political structures had not yet worked out how to deal with rapidly changing communications technology, a world in which people no longer watched the same TV channels or read the same newspapers. The rapid pace of change was having a flow-on effect across the globe, and was likely to get faster still. Discourse was becoming increasingly fragmented, with people becoming hermetically sealed off from each other inside very different information universes. “If I watched Fox News, I wouldn’t vote for me” he joked.