← Back to the blog

Prompt to Inbox: Build AI News and YouTube Briefs with Gmail

Build personal AI news and YouTube creator briefs with regular Gmail or Google Workspace. Full guide, copyable Codex source, compact kit and narration PDF; live-account checkpoints explained.

Issiah Hill10 min read

Build two personal briefs: AI News and YouTube Creator Watch. Choose regular Gmail or Google Workspace, using the same source feeds and workflow without a local Postfix server.

Build-along release, September 24, 2026 — revision 2. Practice, source-package checks, real public feeds, regular-Gmail authorization and two actual Inbox receipts are verified. The live test exposed Gmail replacing Message-ID headers; revision 2 corrects delivery tracking. Real label rotation, Workspace policy approval, token refresh and an overnight scheduled run remain unverified. Complete your own account checkpoints before enabling a schedule.

Start here: read the guide below, copy the full Codex Markdown, or download the compact kit.

Downloads and copyable source

Save the full Markdown as a .md file. No large video download is required. The Markdown ZIP works if JavaScript is unavailable.

Give this to Codex

Open a new local workspace and attach the complete Markdown. Ask Codex to extract and verify every source file, run the tests and practice example, then preview the public feeds. Complete Google sign-in privately. Approve your two self-addressed test emails before sending; verify both in Inbox before enabling the timers.

Full Codex build Markdown — copy and paste

The complete source loads only when you expand or copy it. The large viewer kit never downloads automatically.

Expand the complete build Markdown

Expand to load the complete source, or use the Markdown ZIP download above.

Choose your account

Route Address Google project audience Same result
Regular Gmail Your own address at gmail.com External; your account is a test user during Testing AI news + Creator Watch
Google Workspace Your existing Google-hosted domain mailbox Internal when eligible in an organization-owned project; otherwise the appropriate External setup AI news + Creator Watch

Workspace is a paid account option; buying a domain or viewing a website mailbox in a mail app does not make that mailbox Google-hosted. This guide does not migrate domain DNS or website mail. Use the Google account’s own address for both sender and recipient. This is personal delivery to yourself, not a newsletter sender.

See Google Workspace business email and Google’s audience options.

What runs where

Public RSS/Atom feeds → your Linux computer → two HTML/text reports → Gmail API → your authorized mailbox.

The computer still runs Python and the schedule. Keep it awake, powered and online. Default collection: 02:00 America/Edmonton; archive: 03:00. No automatic wake and no daytime catch-up. No model API key is needed for routine collection. The source descriptions are excerpts, not full-article analysis, video transcripts or fact-checking.

The source directory retains the news and creator examples from the original Prompt to Inbox project. Availability changes; inspect every preview’s coverage. News covers the preceding 24 hours. Creator Watch covers today and yesterday in your configured time zone, within the feed lookback. Maximum 24 news items and 100 creator posts; long briefs become compact linked rows within a 192 KiB message limit. Public feeds can truncate history. Posts published after collection wait for the next run.

1. Get a clean workspace

Extract the viewer ZIP into a new folder. Open a terminal in VIEWER-KIT; commands below run there. Do not replace an existing working service or copy its private files. The demonstrated platform is Linux with Python 3.11 or newer and systemd user timers. Windows/macOS scheduling is not tested here.

On Ubuntu/Debian, if Python or venv is missing, install your distribution packages:

sudo apt update
sudo apt install python3 python3-venv

Then:

python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m unittest discover -s tests -v
.venv/bin/python ai_news.py practice

The practice command never contacts Google or fetches live feeds. Open the generated news.html and creators.html under practice-output/data/reports. The newest path is also written to practice-output/data/latest-report.txt.

Checkpoint: two readable PRACTICE ONLY reports, passing tests, no account connection.

2. Choose sources and preview

Edit config/sources.yaml, config/creators.yaml and config/topics.yaml in a text editor. Use enabled: true or false. Preserve valid YAML indentation. Use actual feed URLs and correct channel IDs; do not guess a creator’s identity from a similar handle. Start with a small selection if you prefer.

.venv/bin/python ai_news.py preview

Open news.html and creators.html in the new data/reports folder printed by the command. No email is sent. Follow a few source links. Check publication dates and coverage: an unavailable source is different from a source with no recent post. The run fails if either brief has no reachable source. Preview does not consume delivery history.

3. Create your own Google connection

Do this privately, off-camera. Use your own Google Cloud console. Create/select a project, enable Gmail API, configure Google Auth platform Branding/Audience/Data Access, and create an OAuth client of type Desktop app. Download its JSON configuration. Each viewer supplies their own client; the kit contains no shared client, password or token.

Use Google’s Python quickstart for the current console navigation. Our application uses a different scope than the read-only quickstart.

Regular Gmail: select External. While Testing, add your own account to Test users. Gmail-scope authorization in External Testing expires after seven days. Before scheduling ongoing use, review the personal-use exception, configure the appropriate In Production status, and authorize again. An unverified-app warning may remain. Only proceed for the client you created and code you reviewed; do not treat the warning as an instruction to trust unknown apps.

Google documents personal-use and Internal exceptions. A public multi-user hosted service has different obligations; this kit teaches individual local installations, not operating a shared unverified service.

Workspace: an organization-owned project used only within that organization can use Internal where available. An administrator may need to allow Gmail access. If your project/account is not eligible, do not force Internal; use the applicable External route with your administrator. Gmail must be enabled for the account. See audience and administrator restrictions.

Refresh tokens can also become invalid after revocation, certain password changes or policy changes. In Production does not mean permanent authorization. See Google OAuth token expiration.

4. Save the client privately and authorize

Create the private directory:

mkdir -m 700 .private

Using your file manager, place the downloaded Desktop client JSON inside .private and name it client.json. Do not open or paste its contents into chat. Then:

chmod 700 .private
chmod 600 .private/client.json
.venv/bin/python ai_news.py auth
.venv/bin/python ai_news.py health

Run auth on the desktop computer with a browser. The loopback authorization flow is not a headless server setup. The browser opens Google’s sign-in page; choose the mailbox you intend to use and review the permission. The CLI avoids printing authorization URLs and tokens. A private token.json is stored for future runs.

Scope: https://www.googleapis.com/auth/gmail.modify. This enables sending, reading and label changes. It grants broad mailbox access; it is not technically confined to this project’s label. The application restricts its operations to ledger-owned messages, but that code boundary is distinct from Google’s account permission. No immediate permanent-delete scope is requested. See Gmail scopes.

Checkpoint: health reports mailbox_authorization_verified. It does not send mail. Do not publish .private, data, backups, logs, credentials, or account screenshots.

5. Send and verify one test pair

This command really sends two emails to the same account you authorized:

.venv/bin/python ai_news.py send --test --allow-mailbox-changes
.venv/bin/python ai_news.py verify --test

Open Gmail and confirm both test messages in Inbox. A Sent-only copy is insufficient. The verifier retains Gmail’s provider message ID and checks a unique delivery marker, brief type, sender/recipient and HTML content against the durable local record, then saves the received .eml. Gmail can replace the original RFC Message-ID. If a send response is lost, a bounded date/subject search is only a candidate lookup: the unique marker and complete content checks must still match. Ambiguous matches stop without resending.

If receipt is pending, wait and run verify again. Do not resend, delete the database, or make a fresh workspace to bypass an uncertain send. A second send for the same day’s test key reuses the record; it does not submit again. Check Gmail filters and Spam manually when appropriate. An ambiguous failed submission needs reconciliation, not automatic replay.

After midnight, add –date YYYY-MM-DD to verify the original local send date (and keep –test for a test pair). For example: .venv/bin/python ai_news.py verify --test --date 2026-09-24. This only inspects the recorded pair; it does not resend.

There is one test pair per local calendar day. To change the content, preview as often as needed. The normal daily pair is a separate key:

.venv/bin/python ai_news.py send --allow-mailbox-changes
.venv/bin/python ai_news.py verify

6. Archive older owned briefs

.venv/bin/python ai_news.py archive --allow-mailbox-changes

This checks today’s daily pair. Only after both are in Inbox does it add AI Daily Briefs to older owned messages and remove INBOX. Gmail labels differ from traditional folders; this uses message-level changes, not whole-thread changes. Unrelated messages are not targets. See Google’s label model.

Keep data/history.sqlite3 and data/instance.json with the workspace. They bind duplicate prevention and message ownership to this installation/account. Backups live under data/sent and data/received. Restore a complete consistent backup while the service is stopped; never run two restored copies simultaneously.

Automatic trash is off by default. Optional trash_old_briefs: true in settings permits eligible archived owned messages older than server_retention_days (minimum 30) to be moved to Trash after backup checks. The program does not permanently delete them. Gmail’s own Trash retention still applies. Removing INBOX alone does not free mailbox storage. Local reports/backups remain until you manage them; keep an off-device backup and monitor disk space.

7. Enable the Linux schedule after manual verification

Edit config/settings.yaml first. It contains the time zone, send window and archive hour.

.venv/bin/python tools/setup_timers.py

This generates files under timers/ only. Review them. To install and enable the two user timers:

.venv/bin/python tools/setup_timers.py --install
systemctl --user list-timers 'prompt-inbox-gmail-*'

Existing different unit files are preserved and require review. To run user services after logout, you may need your administrator to enable user lingering:

loginctl enable-linger "$USER"

Lingering does not prevent suspend or power on the computer. The installer does not change power settings. Observe the first real scheduled run and check its two receipts. A generated timer file is not proof that an overnight run occurred.

Inspect or stop:

journalctl --user -u prompt-inbox-gmail-send.service -n 40 --no-pager
journalctl --user -u prompt-inbox-gmail-archive.service -n 40 --no-pager
systemctl --user disable --now prompt-inbox-gmail-send.timer prompt-inbox-gmail-archive.timer

A scheduled run has one recorded attempt per local day. Failures are visible; they do not trigger repeated mail submission.

Troubleshooting

Result Next action
No recent posts, feed reachable Check dates and time zone; this can be normal.
One whole feed category unavailable Fix sources/network before sending.
run_auth_first or expired authorization Run the private auth flow; check Testing status/admin policy.
gmail_http_403 Check enabled API, granted scope and Workspace administrator policy.
gmail_http_429 Check Google’s usage limits; do not blindly replay a send.
SUBMISSION_UNCERTAIN / receipt pending Inspect mailbox and run verify for the same daily/test pair.
WAITING_FOR_NEW_PAIR Confirm today’s two daily briefs in Inbox; older messages stay put.
verified_backup_required Repair/restore the local backup; do not bypass the guard.
account_changed_use_a_separate_workspace The existing ledger belongs to another Google mailbox. Keep each account separate.
existing timer differs Review it; don’t overwrite another working installation.

Build with Codex

Give Codex the whole FULL-SETUP-HANDOFF.md in a new local workspace. Ask it to materialize the embedded files and verify their hashes; install dependencies in .venv; run the tests, practice and live-feed preview; then stop for your private Google authorization. After you explicitly approve the test-send command, verify both real Inbox receipts. Enable timers only after the manual checks succeed. Require a report distinguishing simulation, real feeds, actual mailbox delivery and actual overnight operation.

Do not ask an agent to paste or print credentials. Do not share the live workspace as a ZIP. Share the original public kit or rebuild an explicit allowlist of public source and docs.

Credits and assets

Created for Issiah Hill and The Sp_ceman Channel, based on the earlier local Python news collector. Deterministic collection does not imply SRR executed it. The service names Gmail, Google Workspace and YouTube identify the supported services; this is an independent tutorial, not a Google endorsement.

The owner chose text instead of logos. No Google/YouTube logo pack is redistributed. Inter’s included license applies to the font. Source lists contain public links, not creator videos or thumbnails. Practice items are generated examples.

The Sp_ceman Channel · Codex video-editing tutorial · SRR waitlist · Newsletter · Support independent SRR development

Follow the next update

Get SupRrrAi development notes and new posts by email.