OpenGuardrailsOpenGuardrailsDocs

The three altitudes

OGR guards an agent at up to three altitudes. Each sees something the others can't, and each is a different trade-off between richness of intent and adversary-resistance. A single logical action is correlated across all of them by one guard_id, so it yields one composed decision.

AltitudeWhereSeesCan block?Adversary-proof?
gatewayLLM request/responsefull prompt, completion, tool/MCP definitionsdepends on hostno — pre-execution intent
agent_hookthe agent's tool lifecycletool name + arguments, before dispatchyesno — sees declared args
sandboxthe real execactual argv, env, syscalls, networkyesyes — sees real behavior

Why three, not one

Defense-in-depth means each altitude covers the others' blind spots. In the Hermes integration, the agent hook blocks on intent and a real sandbox (srt or OpenShell) enforces on behavior.

Correlation by guard_id

The first altitude to see an action mints a guard_id and propagates it out-of-band (a guard-context that rides alongside the action). Downstream altitudes inherit it, so the Runtime knows the sandbox exec and the agent-hook tool_call are the same action. A later altitude can only tighten an earlier decision, never loosen it.

Graceful degradation

If an agent has no sandbox (e.g. Hermes' local backend with no srt), OGR still enforces at the agent-hook altitude — you lose the adversary-proof layer, not the protocol. The verdict records which altitudes were available.

Next: GuardEvent & Verdict — the wire types each altitude emits.