Agentic Security & Safety
What are the best practices for implementing human-in-the-loop (HITL) gatekeeping for agentic writes?
QUICK ANSWER
Implement human-in-the-loop gatekeeping for agentic writes by defining a whitelist of read-only tools and requiring explicit user authorization (via CLI prompts, Slack approval buttons, or web dashboards) before executing state-modifying actions like write files, run terminal commands, or make payments.
Implementing State-modifying Gatekeepers
- Identify Dangerous Actions: Classify tools into 'safe' (e.g., read, search, calculate) and 'critical' (e.g., write, delete, execute, transaction).
- Interrupt Execution Flow: In your agent runtime (e.g., LangGraph or custom loop), pause execution when the model requests a critical tool.
- Render Proposed Payload: Present the exact proposed parameters (e.g., code diff, CLI command, payment amount) to the user for review.
- Resume/Reject Callback: Feed the user's decision (Approve/Deny) back to the agent. If denied, return a system response to the model explaining that the action was rejected by the operator.
Verified against: LangGraph human-in-the-loop pattern