Function runPostApprovalGuardrails

  • Runs post-approval guardrails against tool call arguments to catch destructive actions that slipped past the HITL handler.

    This is the core safety net: even when auto-approve, LLM judge, or a human approves a tool call, the configured guardrails get a final say. If any guardrail returns action: 'block', the approval is overridden.

    Parameters

    • toolName: string

      The tool that was approved.

    • args: Record<string, unknown>

      The arguments the tool would be called with.

    • guardrailIds: string[]

      Ordered list of guardrail IDs to evaluate.

    • Optional callbacks: AgencyCallbacks

      Optional event callback map for emitting override events.

    Returns Promise<GuardrailHitlOverrideResult>

    A result indicating whether the guardrails passed.