Frameworks
ControlFlow
Use Humanlayer with ControlFlow
Overview
Humanlayer integrates seamlessly with ControlFlow to add human oversight to your AI applications. This guide shows you how to use Humanlayer with ControlFlow.
Installation
Install the required packages:
Basic Example
Let’s create a simple math agent that performs basic arithmetic operations with human oversight.
How it Works
- We create a HumanLayer instance with an optional
run_id
to identify this agent in the approval history - Define two math functions:
add
andmultiply
- Use
@hl.require_approval()
to require human approval before themultiply
function can be called - Create a ControlFlow task that uses these functions as tools
- The agent will request approval before executing the multiply function
Running the Example
- Set up your environment variables in
.env
- Run the example:
When the agent attempts to use the multiply
function, it will pause and request human approval through your configured contact channel (Slack, Email, etc).
Next Steps
- Learn more about require_approval
- Configure contact channels
- Explore response options
For more framework examples, see https://github.com/humanlayer/humanlayer/tree/main/examples