A free-kick straight off the training ground in the 57th minute settled the contest as Wade Elliott fed Aaron Wilbraham in the box and his first-time pass allowed Agard to shoot low past Oldham goalkeeper Paul Rachubka.
Agard almost scored an audacious second with a chip from 50-yards as City stretched their unbeaten start to the season to 16 games.
A high quality first half began with Jabo Ibehre shooting just wide for Oldham, but it was City who created the most chances.
Joe Bryan hit the top of the crossbar with an eighth-minute cross, Aden Flint twice went close with headers from corners and Agard forced a fine save from Racubka before volleying over when he might have scored.
Oldham were always a threat as a fast, open contest developed with the result in doubt right to the final whistle.
Breaking news, transfer gossip, line ups and goal alerts from your football club – delivered direct to your mobile. Sign up for Sky Sports Alerts