All posts

Guardrails in production: what a trading system taught me about AI agents

Jake

It's one thing to let an AI agent write code you'll review later. It's another to let agents make decisions that act on markets in real time.

That's what EdgeSeeker does. It's an event-driven trading system I built for prediction markets. Live news comes in, a pipeline of five AI agents turns it into a structured signal, and the system decides whether to act. When software is acting on its own, the guardrails aren't a nice extra. They're the product.

Here's how it's built, and what carries over to any agent system.

Five agents, one job each

The first version of anything like this is usually one big prompt: "read this news and tell me what to trade." That's hard to test and harder to trust.

EdgeSeeker splits the work across five agents, each with its own step. What comes out the end isn't a paragraph of opinion. It's a structured signal with fields the rest of the system can check.

Smaller steps with structured outputs are easier to test. When a signal looks wrong, you can trace which step went wrong.

Certainty buckets, not a confidence number

Ask a language model how confident it is, and you'll get a number that sounds precise but isn't. 0.82 and 0.87 don't mean much.

So EdgeSeeker sorts signals into certainty buckets: a small set of clear levels, each with its own rules for what the system is allowed to do.

Buckets are easier to reason about and easier to test. And a small wobble in a number doesn't change the decision.

Limits the agents can't talk their way past

The most important rule: the agents suggest, and plain code decides. Every limit lives outside the models, in code they can't change.

  • Spend limits. A cap on how much can go out, no matter how good a signal looks.
  • Exposure caps. A limit on how much can ride on any one position, so one bad read can't sink everything.
  • Drawdown circuit breakers. If losses pass a set threshold, trading stops.

These checks don't ask the agents' opinion. A very persuasive signal hits the same wall as a weak one.

When in doubt, do nothing

Most AI demos are built to always produce an answer. A system that acts on its own needs the opposite instinct. If a signal is malformed or a data source is acting up, "no action" is often the safest answer.

That's what layered risk controls are for. No single check has to be perfect, because a bad signal has to get past every one of them.

What carries over to any agent system

You probably aren't building a trading system. The lessons still apply anywhere agents can take actions that matter:

What to do:

  • Split the work into small steps with structured outputs.
  • Turn fuzzy model confidence into a few clear levels with clear rules.
  • Put hard limits in code the agents can't touch.
  • Add a circuit breaker that stops everything and calls a human.
  • When in doubt, do nothing.

Agents are good at reading messy input and making a call. They're not good at knowing when to stop. That part is your job, and it should be written in code.

If you're putting agents in charge of real actions and want help designing the guardrails, reach out.

EdgeSeeker is a personal engineering project. Nothing here is financial advice.