Security considerations for Email Agent.
Email Agent never sends emails automatically.
- Code design: Only
users.drafts.create()API used - Pre-commit pygrep hook: Prevents commits containing
.send(in src/ - CI ruff check: Catches any bypassed commits
- Tests: Verify no send calls exist
- AI can make mistakes
- User should review all responses
- Liability protection
- Trust without verification
Credentials stored in credentials/ folder:
credentials.json- OAuth client secretstoken.json- OAuth access tokens
Never commit credentials or tokens to git:
credentials/- OAuth secrets and tokensconfig.yaml- May contain sensitive patterns
- Tokens auto-managed by Google auth library
- Stored in
credentials/token.json(not encrypted at rest by this app) - User can revoke at any time via Google account
- LLM runs on your machine (Ollama)
- Email content never sent to external AI services
- No cloud dependencies for AI processing
Required network access:
localhost:11434- Ollama APIoauth2.googleapis.com- Token refreshgmail.googleapis.com- Email access
config.yaml may contain:
- Email addresses (not secrets)
- Domain patterns (@company.com)
No passwords or API keys stored.
# Linux/macOS
chmod 600 config.yaml credentials/
# Windows
# Ensure files not shared publiclyOnly minimum necessary scopes:
gmail.readonly- Read emails onlygmail.labels- Manage labels onlygmail.compose- Create drafts only
No access to:
- Send emails
- Delete emails
- Modify emails
- Review drafts before sending
- Revoke access when not using agent
- Keep Ollama local - don't expose to network
- Update regularly - keep dependencies current
- Monitor logs - check for unusual activity