Keeping agent guardrails off the hot path

How to keep an agent's guardrails off the hot path: four ordered checks, a judge that never sees untrusted text, and owner interruptions budgeted like latency.

November 20264 min readSecurityAgent systemsPerformanceA governed personal agent

Three incomplete chalk arcs and a small faded rose plane sit on a thin, open olive ground above a stuttering charcoal line.
On this page
  1. Stripping out the safety gate
  2. Four guardrails at one pre-action check
  3. Attention as a budget
  4. Capability in the tool layer

Ask an agent to free disk space and it will stop, yet again, to confirm before deleting build output. That reflex comes from the field’s default for agent safety, defense in depth: taint labels, approval gates before sending, buying, or deleting, and a second model reviewing actions. Each mechanism is defensible in isolation, especially in multi-tenant software where a mistake crosses customer boundaries. Stacked together, they make an agent slow and timid, interrupting often enough to defeat the point of delegating the work.

For a single owner on their own machines, the primary instruments are an audit record, undo, and a stop switch, with hard lines only where an action cannot be undone: money, a message to a stranger, or a wiped disk. The principle is capability first, treating the owner’s attention as a budget like latency and keeping every remaining check virtually free on the hot path. Clearing node_modules never prompts; a $100 t-shirt order or a cursing email to my boss does reach me. That is the rule governing my personal agent platform, where coding threads, project staff, and a chief agent running errands over my messaging channels all operate with my authority.

Stripping out the safety gate

When I reviewed the platform’s initial architecture in November 2026, the agents drafting the specification had converged on that exact safety gate. The correction began with code mode, where the design forbade the model from writing raw JavaScript itself; as I put it in the review, “I need this thing as capable, and as fast, as it can possibly be.”

The resulting design follows one rule: anything that stops, slows, or second-guesses an agent is removed or rebuilt to cost nothing on the normal path. What remains is everything that protects the system without constraining execution: crash correctness so recovery never submits a payment twice, encryption against outsiders, credentials kept out of logs, and visibility through audit history, rewind, and undo.

Four guardrails at one pre-action check

Everything that requires intervention sits in a single pre-action check with four ordered guardrails, each with its own latency budget, where the first decisive match wins. On ordinary calls that match nothing, the check runs locally against in-memory rules and touches no socket, database, or model.

  1. A never list. Commands whose only outcome is losing a machine, such as wiping system or home directories, are blocked in microseconds. Matching runs after a tokenizer resolves sudo, ~, and .., so wrapper commands and relative paths cannot slip past while targeted deletes inside a project go straight through.
  2. A pattern filter. A table-driven check under 50 µs flags calls worth a second look, including force pushes, wide deletes, and public posts, aimed at fewer than 2% of calls.
  3. Money and messages. Under 1 ms, any payment not pre-authorized or message to a new personal contact prompts for confirmation; known conversations and pre-authorized recipients pass through.
  4. A small-model judge. Invoked only for filtered calls not resolved above, it asks whether this is a destructive or regrettable action the owner did not ask for.

The judge sees only the owner’s own words and the proposed action, never outside text from web pages, emails, or tool output, so prompt-injected content cannot argue with it. Although the model call takes about 1.6 s, it starts as soon as the tool call’s arguments finish streaming, overlapping with the round’s other calls. On timeout, irreversible actions ask the owner, while reversible ones proceed after capturing a pre-image and are marked unjudged.

Attention as a budget

A guardrail layer without an interruption budget drifts toward noise, because every false positive looks minor on its own until the owner starts rubber-stamping prompts. The design targets price attention explicitly: fewer than three judge prompts a week, and a scripted day of about 2,000 tool calls that surfaces only the confirmations the explicit rules require.

Holding that line also means watching for drift in agent-written code, where conservative defaults creep back easily. A review caught regressions in both directions: a command runner unconditionally refusing escalated commands, and the pre-action check failing open on payment errors. Both were fixed.

Capability in the tool layer

Deferred tool search and code mode are established patterns, already present in Codex and other harnesses. Here, every agent holds thirteen core tools whose names models were trained on, rather than loading a full capability catalog up front. Everything else is found on demand through BM25 search, and matched definitions are appended to the context instead of spliced into the initial prompt, so the prefix never changes and prompt-cache hits hold across tool discovery.

For multi-step work that should not pay a model round trip per call, a code-mode tool runs model-written TypeScript directly in a Bun worker. Startup takes about 0.5 ms, against 11 to 58 ms in QuickJS, an embedded JavaScript engine, keeping short scripts cheap enough to use routinely. Every nested call inside a script passes through the same pre-action check and is journaled, so a crash mid-script resumes without repeating a completed call.

Chris Chabot, November 2026