Inspiration
My teammate and I were always fascinated by how much Ai could do and we were wondering how far into our lives can we integrate them in? So we wanted to build an Ai that would help manage our Gmail by like sending emails, helping us organize our email, etc. But we were worried it might sent it to the wrong people or delete important emails, which could cause miscommunication or harm the relationships that we have build. This is why we decided to make this project. This project, ARGUS, would help us by slowly allowing us to trust the Ai.
What it does
You click an email, type a command like "reply saying thanks but I can't make it," and ARGUS drafts it. You review it, click approve, done. It handles the Gmail stuff for you but keeps you in control the whole time. No auto-sending, no surprises. If it does things right, its trust level will slowly move up and it will be autonomous. However, if it does things wrong, it will lose its trust level and it will have restrictions.
Also has a trust system so if you keep replying to people safely, it starts letting you do things faster. And if you try to send to someone sketchy, it'll ask extra questions to ensure your safety.
How we built it
We used Python + Flask for the backend, SQLite for the audit log, vanilla JS + HTML/CSS for the frontend (no frameworks used), OpenAI API for command parsing, and Gmail API for all email operations.
We built a trust system modeled after how human trust works. When you accomplish a simple task your trust moves up by a bit, however if you fail the simple task, your trust drops by a lot. If you accomplish a difficult task, your trust moves up by a lot, however if you fail it drops by a bit as its understandable.
We also made a Fail-safe controls layer. Seven independent safety mechanisms: emergency stop, rate limiting, private contacts, timeout windows, deduplication, reason caps, and invalid-transition locks. Each control is designed for a fail-safe.
We also have an audit trail system where you can see if anyone tried to temper with the logs and like what actions were done like message was able to sent or if message is blocked from sending.
We also added an undo window (delay before sending) so you can review before it goes out.
Challenges we ran into
OAuth redirect URIs are fragile. Deploying to Replit exposed a gap: localhost redirect URIs don't work on live URLs. Had to make the redirect URI environment-configurable and wire it through Google Cloud Console. One typo in the secret name (GOOGLE_CLIENT_SECERT) broke everything and was invisible until looking at logs.
Trust gauge inertia was invisible. We built a visual trust gauge to show how trustworthy ARGUS is based on past successes/failures on risky actions. It looked great in early testing — but after 2-3 successful sends, the gauge jumped to "Trusted." That's wrong. Turns out we needed a minimum sample size (about 5 events per action) before the signal stabilizes. Without inertia baked in, the gauge was just noise. Fixing this meant redesigning how we weight user history and seeding enough demo data to actually hit the threshold.
Crash recovery for sent emails. Building a system where you can safely restart mid-send without duplicating emails was way more difficult than we expected. The problem was that after we created a Gmail draft and Argus starts sending it, the server crashes. When it restarts, how do we know if drafts.send() actually executed or just failed silently? We ended up checking whether the draft still exists in Gmail — if it's gone, it sent; if it's there, resume; if we can't tell, mark it as ambiguous. This works but required rethinking the entire execution model to make drafts atomic and recoverable.
Accomplishments that we're proud of
We're proud that we actually got Gmail OAuth working and connected it to our app. We also built a trust system that doesn't break — it actually learns from your actions and adjusts restrictions. Most importantly, the whole thing works end-to-end: you click an email, type a command, it drafts it, you approve it, and the email actually sends. We tested it ourselves with real emails and it worked every time. And the safety features actually block risky stuff like we planned.
What we learned
We learned that we should always test things as the website seemed fine on the outside but when you try to use it, more and more bugs slowly got revealed. We also learnt how api keys work as in this project, we had to use a lot of Api keys from mainly google and some from OpenAi. We also learned that safety features are important, when something goes wrong, it is better to block the action than accidentally allow something unsafe.
What's next for ARGUS
We planned to add a similar system for Google Calender and Outlook. Maybe add a way for the template to be self improving so it would see what the user likes to reply and try to format it as close as possible to that.
Built With
- css
- gmail-api-(google-oauth-2.0)
- html
- javascript
- openai
- openai-api
- python-(flask)
- replit
- sqlite
Log in or sign up for Devpost to join the conversation.