Loopstation / Blog / Agent workflows

Agent workflows · November 9, 2026

Guardrails stop the big mistakes, and scheduled sweeps catch the rest. Here is how we run both, with a real catch from August 2026.

AI agents handle errors best when you stop most of them before they start, then watch closely for the rest. In 2026 the models themselves are reliable, and made-up answers have become an edge case, so in our experience the real risk sits in the process around the agent. We use two layers: guardrails written into the agent's instructions, and scheduled sweeps that look for trouble and send it to a person.

This is how we build every one of our AI agent workflows for contractors, and the sweep described below runs every week at Ravensearch, our sister company.

How do AI agents handle errors before they happen?

With guardrails and hard no's. Before we build, each client tells us which mistakes would hurt them most. Then we write those into the agent's system prompt as rules it may not break. So far, in our experience, models follow those rules, and follow them reliably.

A few of the lines we hold on every build:

  • The agent can draft a quote, but a person approves it before it goes out. Presenting quoting as fully automated is, in our view, dangerous.
  • Anything that touches billing stays with a person.
  • Anything that touches security stays with a person.
  • A step that moves the work into its next phase, especially with the client watching, is a person's call.

To write your own, ask one question: what is the one message this agent must never send? Then write the answer down as a rule, in plain words, and test it on purpose before you go live.

What is a scheduled sweep?

Put simply, a sweep is a check that runs on a timer and reads the health of the whole system, so problems surface before a client finds them. Its goal is to see the problem coming and send it straight to management and the engineers.

At Ravensearch the sweep runs a full pass at 7:00 Pacific every Monday, Wednesday and Friday. It also runs a focused pass shortly after any error alert, at most once every 30 minutes for each kind of error. Next, each pass looks at:

  • New and growing issues in the error tracker.
  • Server errors on the hosting platform.
  • 28 saved health checks against the database, such as jobs stuck at one step, texts that failed to send, replies waiting for review, billing that was not recorded and inbound channels gone quiet.
  • Whether the background schedulers are still running.
  • Whether the consent text shown to technicians has drifted from the approved wording.

Does a sweep fix the error on its own?

No, and that is on purpose. The sweep is read only: it never changes data and never writes a fix. Instead it opens a report with its evidence and its best guess at the cause, and it emails the operator directly. We added the email because platform notifications alone proved unreliable. Then a person reads the report and decides whether a fix runs.

That split matters. An agent that both finds and fixes its own errors can turn one small problem into a larger one. So the machine does the watching, and a person makes the call.

How fast can a sweep catch a problem?

In minutes. For example, on August 24, 2026, Ravensearch shipped a new audit log. Its first error alert fired at 15:50 UTC, and the sweep's report was up about nine minutes later.

But that report did more than restate the alert. It traced the error to a background job that had been reading an out-of-date copy of the job list for over 40 days while its writes went through live. Because every effect of that fault had been a quiet no-op, nothing had flagged it before. The report also ruled out the theory the team had on record about that job. As a result the real fix shipped the same day.

What about errors that make no noise?

Some failures throw no error at all, so you have to watch for silence too. We learned this in August 2026. A text provider's webhook was deleted, and technician replies stopped reaching us for six days. Because our code never ran, it never failed, and the error tracker saw nothing.

Since then the sweep runs a check for exactly that shape: if we are still sending texts but nothing has come back in 24 hours, it flags it. That's why the general lesson is to pair every "did something break" check with a "did something stop" check.

How to set up error prevention for your own agent

You don't need our exact stack to use the idea. Start small:

  • List the three mistakes that would cost you the most, and write them into the agent's instructions as hard rules.
  • Pick the five numbers that tell you the work is flowing, such as jobs stuck, messages failed and replies waiting, and check them on a schedule.
  • Add one silence check for every channel that should never go quiet.
  • Send every finding to a named person, by email, with the evidence attached.
  • Keep fixes with people. Let the sweep find, and let a person decide.

Once that is in place, it gets much safer to hand an agent the jobs it suits best, such as the repetitive status work most offices run on.

What to ask an agency about errors

If someone else builds your agent, ask how they will know when it goes wrong, and who fixes it. It is one of the checks in our guide to what an AI automation agency does. That way you learn a lot fast: a good answer names the rules, the checks, the schedule and the person. A vague one is a warning sign.

Above all, ask to see it on your own work. That is the same advice we give anyone choosing a virtual staging company: whatever the service, test it on your own material before you sign.

Contact

Build an agent that tells you when it breaks.