# Case study: how we run our own AI agents every night

URL: https://dailymind.eu/agent-ops/how-we-run-our-own-agents/

**Short answer:** DailyMind's own repositories are maintained by AI agents every night. They review and fix one slice of the code until it is clean, update documentation, and send a short report of tables in the morning. Tests gate every fix, rounds are capped, and the agents commit but never push or deploy. A human approves every production release.

## What runs every night

- Toolchain updates, so agents and humans work on current versions.
- A documentation pass: bring docs up to date, remove duplicates, and delete what is obsolete.
- Code review and fix rounds on one slice of the codebase, repeated until the reviewer finds nothing actionable. The slices rotate, so the whole codebase is reviewed every 17 nights.
- A read-only status pass that compares plans with what has actually been published.
- On Sundays, an architecture-rule check on one frontend codebase.

## Guardrails

- Tests must pass before a fix is committed.
- Review-and-fix runs at most 5 rounds per night, so an agent cannot loop forever or burn budget.
- Agents commit locally but never push or deploy. Production releases need an explicit human approval each time.
- Read-only access wherever reading is enough, for example when checking published content.
- The morning report is tables only, delivered to a chat, and a full log of each night is kept for review.

## Guardrails in interactive sessions

Every interactive agent session gets the same rules injected by hooks: make the smallest understandable change, check the premise before acting, list the decisions made, and review the diff until no actionable issues remain.

Deploys run through one script per site. It writes a log per run with credentials redacted, stores logs readable only by the owner, and records how long each step takes.

## What went wrong, and what we changed

Agents can produce diffs that look much larger than the real change. In one case an editor normalized mixed Windows and Unix line endings, so every untouched line showed up as changed and a reviewer could easily miss the lines that mattered. We now compare the plain diff size with a whitespace-insensitive one, and restore the original line endings when they differ.

## What this means for clients

The same patterns carry over to your agents: a bounded loop, tests as the gate, no unattended production changes, a report a person can read in a minute, and logs that show what each agent did. We set them up on your stack and hand them over.

## Frequently asked questions

**Why not let agents push to production?** Because the cost of a bad change in production is much higher than the cost of a human approval. Agents do the work; a person decides when it ships.

**How do you stop agents from looping?** With a hard cap on review-and-fix rounds per run and a clear stop condition: nothing actionable left, or the cap is reached.

**How do you know the agents did good work?** Tests must pass, every change is a reviewable commit, and the morning report lists what changed for a person to review. Nothing reaches production without that person.

Author: Katerina Bletsch, DailyMind LTD. Updated 2026-10-24. Contact: https://dailymind.eu/contact/
