The Cloudflare Blog: Building an AI Agent that puts humans in the loop with Knock and Cloudflare’s Agents SDK

Source URL: https://blog.cloudflare.com/building-agents-at-knock-agents-sdk/
Source: The Cloudflare Blog
Title: Building an AI Agent that puts humans in the loop with Knock and Cloudflare’s Agents SDK

Feedly Summary: How Knock shipped an AI Agent with human-in-the-loop capabilities with Cloudflare’s Agents SDK and Cloudflare Workers.

AI Summary and Description: Yes

**Summary:**
The text discusses building AI agents using the Cloudflare Agents SDK and Knock’s messaging infrastructure, emphasizing the importance of human-in-the-loop interactions for decision-making processes. It describes creating an AI agent for a virtual card issuing workflow that necessitates human approval before proceeding with actions, thereby highlighting practical approaches to integrating AI with user interaction in security-sensitive applications.

**Detailed Description:**
The text outlines a comprehensive approach to developing an AI agent designed for real-time user interactions while ensuring a human input mechanism is in place for critical decision points. Key points include:

– **Definition of AI Agents:**
– Autonomous systems that perform tasks and make decisions without human intervention.
– Acknowledges the need for human guidance, particularly where external interactions are concerned.

– **Human-in-the-Loop (HITL) Interaction:**
– Introduces the HITL model, which requires human input for certain decisions, enhancing the AI’s effectiveness.

– **Use of the Knock Messaging Infrastructure:**
– Describes Knock as a multi-channel messaging platform that facilitates communication across various channels like email, SMS, and in-app notifications.
– Exemplifies how to leverage Knock’s messaging capabilities to manage human input workflows effectively.

– **Cloudflare Agents SDK Features:**
– Discusses the SDK’s structure that allows for the integration of real-time, stateful AI agents via Durable Objects.
– Highlights benefits such as serverless architecture, persistence, and the ease of scaling horizontally.

– **Workflow Design and Implementation:**
– Explains how to set up an approval workflow using Knock’s visual workflow builder.
– Demonstrates building a chat interface and using the Agents SDK to manage AI agent interactions.

– **Approval Process Workflow:**
– Describes the integration process where the AI agent can issue card requests that require approval from specified users.
– Accentuates the asynchronous nature of the approval, with webhooks handling the callback from user interactions.

– **Compliance and Security Considerations:**
– Emphasizes the importance of managing and tracking tool approvals to prevent issues such as duplicate card issuance.
– Suggests tracking tool call statuses internally within the agent’s state to ensure accurate processing.

– **Conclusion and Practical Applications:**
– Affirms that utilizing the Agent SDK and Knock facilitates the creation of more robust AI agents capable of handling sensitive workflows while ensuring compliance and user preferences in notifications.

By incorporating human feedback loops into AI workflows, security and compliance professionals can better manage critical decision points, enhancing the overall robustness and reliability of automated systems. The integration of these systems also highlights the significance of user preferences and governance in designing AI applications, ensuring that interactions adhere to privacy and security standards.