These cannot skip a tool. For that, use loopHooks.beforeToolExec.
Guardrails — teachers who can send you back
Input runs before the model sees the question. Fail → the run throws.Output runs after the answer. Fail → the run throws (and a cached answer is dropped).
guardrails: { input: [{ name: "no-secrets", validate: async (input) => { const text = typeof input === "string" ? input : ""; if (text.includes("sk-")) return { pass: false, reason: "looks like an API key" }; return { pass: true }; }, }],}