Two variants
This pattern has two variants with different trade-offs:
For truly irreversible actions, use Variant 1. For actions that can be unwound or that are lower stakes, Variant 2 is sufficient and imposes no user-visible latency.
Variant 1: Pre-execution gate
How it works
Framework requirements
Variant 1 requires the agent framework to support intercepting tool calls before execution. This works with:- LangGraph — add a conditional edge before the tool node that routes to an approval subgraph
- Semantic Kernel — implement a
FunctionInvocationFiltermiddleware - Custom MCP server — wrap dangerous tool handlers in the approval gate
- LangChain custom tools — override
_run/_arunwith the gate wrapper
Approval-gating wrapper
LangGraph integration
Slack approval bot
The simplest approval service for many teams is a Slack bot with Approve/Reject buttons. This avoids deploying a separate service and integrates with where engineers already work.Variant 2: Post-detection review
When pre-execution gating is not feasible, configure Cognisafe to detect and alert on high-risk tool calls after they complete. This creates an audit trail and informs future policy even if it does not block the action.Configure the custom scorer
Webhook receiver: post-detection review ticket
High-risk tool classification
Not all tools need HITL. Apply the gate selectively to preserve agent velocity for low-risk operations. Classify tools by the reversibility of their side effects and the blast radius of a mistake.Custom scorer for dangerous tool detection
Compliance value
OWASP LLM06 — Excessive Agency
HITL is the primary control for LLM06. The OWASP guidance states: “Limit the permissions of LLM-integrated systems and implement human-in-the-loop controls for actions that are irreversible or have significant impact.” Document the approval gate as the LLM06 control in your security posture assessment.EU AI Act Article 14 — Human Oversight
For AI systems classified as “high-risk” under the EU AI Act (Annex III), Article 14 requires that natural persons are able to “oversee the functioning” of the AI system and “intervene or interrupt” it. A pre-execution HITL gate satisfies this requirement for the specific actions it covers. Document each tool category in your AI Act technical documentation.SOC 2 CC6.1 — Logical Access Controls
The approval service functions as a logical access control: the AI agent cannot execute a privileged action without an authorised human granting access for that specific invocation. Include the HITL gate in your CC6.1 control evidence:“High-risk tool calls made by AI agents require approval from an authorised human operator before execution. Approvals are logged in the Cognisafe audit trail with the approver identity, timestamp, and decision. The approval gate is implemented as a synchronous block in the agent tool wrapper and defaults to rejection on timeout.”
Operational considerations
Latency
HITL adds human response time. An approval workflow that requires a human to click Approve adds seconds to minutes to hours of latency to the agent task. Design agent tasks accordingly:- Set agent timeout longer than your approval SLA: if your Slack approval SLA is 5 minutes, set the agent task timeout to 10 minutes
- Inform end users that high-risk actions are queued for human review: “I need to transfer funds — this action is pending approval and will complete within 5 minutes”
- Define a business-hours policy: if approvals are only reviewed during working hours, agents should not initiate high-risk actions outside those hours unless there is an on-call roster
Approval fatigue
If the approval queue receives too many requests, approvers start rubber-stamping without reviewing. Counter this by:- Calibrating the high-risk tool list — do not gate low-stakes operations
- Providing maximum context in the approval message so the review takes 30 seconds, not 5 minutes
- Setting a volume alert: if more than 10 approvals are pending simultaneously, something is wrong with the agent

