Give Your AI Agent Access to Gmail & Google Calendar | Hermes Agent Setup, by Andika Yudha | AI & Automation Explorer on YouTube. 14 min 49 s.
- Video length
- 14 min 49 s
- Time to do it
- 25 minutes
- Difficulty
- Medium
- Steps
- 10
What you need
Steps
Set up the Telegram side first, since Hermes takes its commands from a Telegram chat. Message @BotFather, run /newbot, pick a name, and copy the token it returns.
Paste the Telegram bot token into the Hermes configuration and start the agent. Send it a test message to confirm it replies before you touch Google.
Restrict the bot to your own Telegram numeric ID so nobody else can command it. Add that ID to the allowed users list in the Hermes config and restart the agent.
Open the Google Cloud Console, create a project, and enable both the Gmail API and the Google Calendar API from the API library.
Configure the OAuth consent screen as External, add yourself as a test user, and add the Gmail and Calendar scopes Hermes asks for.
Create an OAuth 2.0 Client ID of type Desktop app, then download the client credentials JSON file and keep it private.
Paste the client ID and client secret into the Google settings in Hermes and start the Google auth command.
Open the authorization link Hermes prints, sign in to the Google account you want to connect, and approve the Gmail and Calendar permissions.
If the flow shows a redirect URL or code, paste it back into the agent so it can finish the token exchange and save the refresh token.
Test it: ask the agent to list your last three emails, then to create a calendar event. Check that both show up correctly in Gmail and Google Calendar.
Tips and common mistakes
Use a spare Google account for the first run so a wrong scope does not touch your main inbox.
Keep the client secret and the saved token file out of shared folders and Git repositories.
You can revoke the agent's access at any time from myaccount.google.com/permissions.
If the agent stops working later, re-run the auth command to refresh the expired token.
Questions
Do I need a paid Google Workspace account?
No. A normal free Gmail account works. On a Workspace account, an admin may need to allow the OAuth app first.
Why does Google warn that the app is unverified?
Because the OAuth app is your own and has not gone through Google verification. Click Advanced and continue as the test user you added.
Can the agent send emails without asking me?
It can once it holds the Gmail send scope. Grant read-only scopes if you only want it to read and summarise mail.
This guide was drafted from the video's details and general task knowledge. It has not been checked against the full video. Check the video and relevant product instructions before following a procedure. Report a correction.



