Cummins, on 25, and Agar, on 22, put on an unbeaten 49- run partnership for the ninth wicket but Australia still trail the hosts by 67 in their first innings.
Spinners Mehedi Hasan and Shakib Al Hasan struck crucial blows in the first two sessions to reduce the visitors to 144 -8.
The left-right batting combination of number nine Agar and number 10 Cummins frustrated the Bangladesh bowlers, forcing skipper Mushfiqur Rahim to rotate his options.
The pair came together after Mehedi Hasan trapped Mathew Wade leg-before for five and Shakib had Glenn Maxwell stumped on 23 in the post-lunch session.
Mehedi and Shakib had taken three wickets in the morning session, including skipper Steve Smith for eight.
Off-spinner Mehedi bowled Smith, who added just five to his overnight score, in the third over of the morning after the tourists resumed on a precarious 18 for three.
Disclaimer: No Business Standard Journalist was involved in creation of this content