Controls · LoopGuard

Stop repeated code by structure.

LoopGuard hashes the structure of the code, not the wording of the prompt. The probe runs in a Firecracker microVM. It is included on every plan.

LoopGuard in the REA console. The chart compares model calls with calls that were not sent. The cache table is below it.
LoopGuard in the console. A row in the cache is a structural hash, not the prompt.

The fingerprint

Incoming code is parsed into an abstract syntax tree and reduced to a 64-bit structural hash. Comments and whitespace do not create a new key. Two infinite loops that differ only in wording still match.

The probe

A new structure is probed in a Firecracker microVM. If the pool cannot run it, the status is SANDBOX_BUSY, the code check is skipped, and the call can still be forwarded.

A cache hit replays the stored stop. It never replays a vendor answer, and a cache hit does not create a new vendor call.

A first-seen failure can still call the model. REA does not publish a universal savings percentage.

The other controls

PreFlight runs before this check. TraceGuard is the tool receipt, not this probe. The long version is on Architecture.

What the caller sees

A stopped loop is not an HTTP error. The caller receives a normal completion. The assistant text says the model was not called, and it includes the structural hash. rea_meta.mode is block. rea_meta.sandbox_status is BLOCKED_TIMEOUT. The vendor is not called, and the vendor is not billed for that stop.

A repeat of that same structure is the stored stop, from cache. rea_meta.cache_hit is true. It is not a stored vendor answer, and it does not create a new vendor call.

If the pool cannot run the probe, the status is SANDBOX_BUSY. The code check is skipped, the call can still be forwarded, and rea_meta.loopguard is degraded. The caller then sees the vendor's answer.

If the check itself cannot run, the caller gets HTTP 503 and the message “LoopGuard check is temporarily unavailable.”

Questions

What does the caller see when LoopGuard stops a loop?

A completion, not an error page. The assistant text says the model was not called and gives the structural hash. The status on the reply is BLOCKED_TIMEOUT.

Does a repeat call the model?

No. The stored stop is replayed from cache. The cache does not store the vendor's answer. A new structure is probed once in a Firecracker microVM. If that probe does not stop it, the model can still be called.

What is compared?

The structure of the code. Comments and whitespace do not make a new hash. Two loops that differ only in wording still match. The wording of the prompt is not the key.

What if the sandbox is busy?

The check is skipped. The call can still go to the vendor. The reply is marked degraded. That call can be billed by the vendor.

Does it stop every infinite loop?

No. A new structure is probed once. If that probe stops it, the model is not called. If the probe does not stop it, the model can still be called. A later call with the same structure is the stored stop. If the pool is busy, the check is skipped and the call can still be forwarded.

Is there a savings percentage?

No. A repeated structure is the case that is not sent again. A first-seen failure can still call the model. REA does not publish a universal percentage.