Short answer
Runtime guardrails for AI agents are checks that run while the agent is working, before each model call and tool call, and can stop it. They limit what a run may spend, how many steps it may take, how long it may run, which tools it may call with which arguments, and which actions need a person. Content guardrails check text, and observability shows what happened afterwards; runtime guardrails decide whether the next step happens at all.
A normal program does what its code says. An agent does what a model decides, one step at a time: which tool to call, with what, and when to stop. Most of the time that works. When it doesn't, the agent loops, overspends, calls a tool it shouldn't, or sends something nobody checked. Runtime guardrails are the checks that catch those steps while the agent is running, before they happen.
What runtime guardrails check
- How long and how much: a step limit, a time limit and a spend limit for each run.
- Repetition: the same call made again and again.
- Which tools: an allow list, a deny list for dangerous patterns, and rate limits per tool.
- Which actions need a person: payments, messages to customers, deletes.
- Whether the run should still exist: a stop that someone outside the agent can pull.
Each one is a plain rule, checked in code. The same step always gets the same answer, and no model is asked whether the step looks safe.
How they differ from what you may already have
- Prompt instructions. "Never refund more than $50" in the prompt is a request to the model. The model is the part that goes wrong, through confusion or text it read that told it otherwise. A runtime guardrail doesn't ask.
- Content guardrails. These check text: harmful output, personal data, prompt injection in what the agent reads. They matter, but a perfectly polite agent can still loop for an hour or refund the wrong order.
- Observability and tracing. These record what the agent did, so you can see it later. Useful, and necessary to fix things, but a trace of a $400 loop arrives after the $400 is spent.
- Provider spend limits. OpenAI projects and Claude Console workspaces can cap a month of spend. They stop every agent at once, at the end of the budget, and say nothing about which run went wrong.
The pattern: check, then act
Every runtime guardrail has the same shape. Before a step happens, check it; only then do it; then record it:
def run_step(run, call):
# 1. Has this run been stopped from outside?
run.check_not_stopped()
# 2. Would this step break a limit? Steps, time, spend, repeats.
run.check_limits(next_call=call)
# 3. Is this tool allowed, with these arguments? Does it need a person?
run.check_policy(call.tool, call.arguments)
# Only now does the step happen.
result = execute(call)
run.record(call, result) # cost, tokens, outcome: the record you will need later
return resultThe guides below have tested code for each check: loops and step limits, spend per run, tool rules, approval and stopping a run.
Where the checks run: in your code, or at a gateway
- In the agent's code. A library wraps the run. It sees the agent's own tool calls, with their arguments, before they execute, so it can refuse a delete or hold a refund. It only covers code that goes through it.
- At a gateway in front of the model. Every model call passes through it, whatever the language or framework. It knows the real cost of each call and can cut an answer that is still streaming. It doesn't see a tool your code runs without asking the model.
Neither covers everything. Agents that act on money or customers usually need the code-level checks for tools and the gateway for spend.
Four properties a runtime guardrail needs
- Before, not after. It runs before the step. A check after the money is spent is a report.
- Outside the model. The model can't argue with it or skip it.
- Fails closed. If the guardrail itself can't decide, for example its server is down, the step is refused rather than let through.
- Loud. A stopped run raises an error that reaches a person, with the reason.
What runtime guardrails don't do
- They don't make the agent smarter or its answers true.
- They don't catch a harmful sentence. That is a content guardrail's job.
- They don't undo a step that already happened. Approval and idempotency keys are how you avoid needing to.
Where SteerPlane fits
SteerPlane is runtime guardrails for AI agents. It puts step, time, spend and repeat limits on each run, checks tool calls against allow, deny, rate-limit and approval rules before they run, and lets you stop a live run from outside. It runs in your code (Python and TypeScript), as a gateway in front of the model, or both, and you can host it yourself. Setup is on the setup page. To see how it sits next to other tools, read the honest comparison of guardrail tools, and for the terms used here, the glossary.
Questions people ask
What is the difference between LLM guardrails and agent runtime guardrails?
LLM guardrails usually check the text going into and out of a model: harmful content, personal data, prompt injection. Agent runtime guardrails check what the agent does: which tools it calls, how often, for how long and at what cost, and they can stop the run.
Is observability a guardrail?
Not on its own. Tracing records what an agent did so you can see it later. A guardrail runs before the step and can refuse it. You want both: one to stop the bad run, the other to understand it.
Should guardrails run in my code or at a gateway?
A gateway in front of the model sees every model call, from any language, and can cut a streaming answer. Checks in your code also see the tools your agent runs. Many teams use both.