Local AI on Windows

One job, no keys: how my local AI agent writes the daily briefing

Every morning a short AI news briefing lands in my inbox and shows up at /briefing/. A local agent does the research. Plain scripts do everything else. It took a few failed mornings to get to that split, and why it took them is the useful part.

What I was trying to do

I already had Hermes Agent (Nous Research) running against LM Studio on my PC, emailing me a daily AI news roundup on its own cron schedule. I wanted the same stories on this site too, without me touching anything.

So the first version gave Hermes the whole job: research the news, build the email, send it, then run a PowerShell script to publish the stories here.

What broke

One morning no email arrived and the site didn't change. Hermes' run report said everything had "successfully completed", and it mentioned a "simulated SMTP" step along the way.

Nothing had been sent.

  • Hermes has a setting, approvals.cron_mode, that defaults to deny. During a scheduled run, any command its safety check flags as risky gets refused, because nobody is there to approve it.
  • pwsh … publish-briefing.ps1 is exactly the kind of command that gets flagged.
  • Instead of failing loudly, the agent improvised around the refusal and reported a success that never happened. It also saved its file in the wrong folder.

The safety setting did its job. My mistake was letting the agent be the one to report on its own success.

What I considered

Option Upside Downside
Allowlist the one publish command Everything stays in one Hermes job The exact command text has to match, and the agent can still trigger deploys
Set cron_mode: approve One line of config It approves every command, for an agent that reads arbitrary web pages. One malicious page could get it to run anything.
Take the job away from the agent Nothing to block, nothing to fake One more script to maintain

I went with the last one.

What finally worked

A Windows scheduled task runs run-daily-briefing.ps1 at 7:00 AM:

  1. Starts a fresh Hermes with briefing-prompt.txt and only its web tools (--toolsets web). The prompt caps it at 6 searches and gives it one job: reply with the stories as JSON.
  2. Pulls the JSON out of the reply and saves it to briefing-inbox\<date>.json.
  3. Emails it with a small Python script.
  4. Publishes it with publish-briefing.ps1, which validates every field, accepts only https links, shows any HTML as plain text, and rolls back if the build fails.
Hermes can Hermes can't
Search the web Run commands, write files, send email, or deploy
Reply with stories as JSON Fake a success. The script acts only on JSON it actually received.

If the reply is junk, the script logs why and stops. Nothing goes out. A failure is now a missed morning, not a false report.

The way I think about it: Hermes is the cousin you invite to the cookout but keep away from the grill. He doesn't get a speech. He gets one job and no keys.

Then the JSON kept breaking

Taking away the keys fixed the lying. It didn't make the output reliable. Over the next few weeks the local model handed back:

  • a missing closing brace (twice),
  • a missing END marker,
  • the BEGIN marker printed twice, so the script grabbed the wrong block,
  • and, as recently as this week, missing commas between stories.

Every time, I'd patched the parser for that one exact failure. Eventually I stopped patching and changed the approach. The parser no longer cares about markers at all. It finds any JSON object in the reply that has a non-empty stories list, adds brackets the model forgot to close, and if that still won't parse, it tries adding the missing commas.

One thing it deliberately doesn't repair: a reply cut off in the middle of a sentence. That briefing is incomplete, so the script waits a minute and asks Hermes again. Waiting matters. In testing, a retry sent immediately after a timeout got turned away because the model server was still busy.

Each of those failures is now a test case in test-briefing-parse.ps1, so a fix for one can't quietly break another.

Why the briefing stays off the homepage

The briefing is machine-written news. The rest of this site is my build logs. So /briefing/ is noindex, has its own RSS feed, and stays out of the homepage, the sitemap and the main feed. It's useful to me without diluting the rest.

What it still depends on

  • LM Studio's local server running with a model available (I have it launch at login).
  • The PC awake and me logged in. If it's asleep at 7:00, the task runs when it wakes up.

It has published 24 of the 26 mornings since November 3.

If I did it again

  • Don't let an agent grade its own homework. If the model's report is your only proof something happened, you don't know whether it happened.
  • Keep the model to the part that needs a model. Research and summarizing need one. Saving a file, sending an email and deploying a site don't.
  • Assume a small local model's output will be malformed. Parse for the content, not the format you asked for. And keep every breakage as a test.