Australia had been scheduled to travel to Dhaka and Chittagong for two tests in October 2015, but the trip was postponed after national cricket authorities received security warnings from the Australian government's Department of Foreign Affairs and Trade.
The Australians haven't played a test in Bangladesh in more than a decade, but did play in a three-match limited-overs international series in Dhaka in 2011.
O'Keefe and Starc were two of the better bowlers on Australia's last tour to the Indian subcontinent, which ended in a 2-1 win for India, but were missing from the squad announced on Friday.
O'Keefe took 12-70 in Pune to help Australia to a 333-run win in the series-opening test against India, but he struggled in the remaining three tests -- taking seven wickets at 53.14 -- as India rallied on home soil.
After returning from India, O'Keefe was fined and suspended from the New South Wales state team after making "highly inappropriate comments" at an official function in April.
The 23-year-old Agar has played two tests, including a stunning debut when he scored 98 batting at No. 11 against England in 2013 and claimed Alastair Cook as his first test wicket, and has been working to improve his left-arm orthodox spin.
"Ashton has continued to impress us with his form and we believe his bowling is at a level where he deserves to be playing on the highest stage," national selector Trevor Hohns said.
"He will work nicely in tandem with Nathan Lyon and also brings a great all-round package to the team."
Australian team physiotherapist David Beakely said Starc was due to have follow-up scans for a stress fracture after the Champions Trophy in England, as part of his recovery plan.
But Beakeley said the scans indicated his previous stress fracture "has still not fully healed to the extent we would like" and the paceman needed a rest from bowling with the aim of returning for a limited-overs series against India in September.
Selectors have allowed for a replacement for Starc to be added, and it is expected that selection will take place following the Australia A tour of South Africa.
The Australian squad will arrive in Bangladesh on Aug. 18 and play a two-day tour match in Fatullah from Aug. 22, then play tests in Dhaka beginning Aug. 27 and Chittagong from Sept. 4.
Cricket Australia executive general manager Pat Howard said the Bangladesh Cricket Board and the Bangladesh government have provided "satisfactory levels of assurance and security for this tour to proceed at this stage, and we're very grateful to them for this."
"We will continue to work with them to finalize plans but also monitor advice from government agencies and our own, security advisers about the security risk. Our No. 1 priority will always be the safety and security of our players and support staff when travelling to any country."
Australia: Steve Smith (captain), David Warner, Matt Renshaw, Usman Khawaja, Peter Handscomb, Glenn Maxwell, Hilton Cartwright, Matthew Wade, Pat Cummins, James Pattinson, Josh Hazlewood, Nathan Lyon, Ashton Agar.
ashton agarAustralia squadAustralia vs BangladeshMitchell Starcshakib al hasanStephen O'Keefesteve smith
First Published: June 16, 2017, 12:22 PM IST