HumanLayer – Human-in-the-Loop for AI Agents
HumanLayer is an API and SDK that enables AI Agents to contact humans for feedback, input, and approvals. It provides clean APIs that fit into your stack (Python, TypeScript, REST) and integrates with popular LLMs and orchestration frameworks. The platform emphasizes safe, auditable human oversight for long-running or high-stakes agent workflows.
How it works
- Get started quickly: Drop in the SDK and start building in minutes. It supports Python, TypeScript, REST, and works with OpenAI, LangChain, CrewAI, ControlFlow, FastAPI, Flask, and more.
- Define tools and actions: Expose functions as tools that can be called by the agent. Certain calls can require human approval before execution.
- Human-in-the-loop approvals: Use the @hl.require_approval() decorator to block specific function calls until a human approves. If denied, feedback is pushed to the LLM context.
- OmniChannel contact: Reach humans across Slack, Email, Discord, and more for quick responses.
- Advanced approvals: Coordinate approvals across teams with escalations and timeouts.
- Human as a tool: Treat humans as a callable tool for answers, advice, or feedback within agent workflows.
- Granular routing: Route approvals to specific individuals or teams.
- Bring your own LLM and frameworks: Works with any LLM and major orchestration frameworks that support tool calling.
- Asynchronous outer loops: Create long-running, outer-loop agent workflows with human-in-the-loop interactions.
- Pre-fill prompts & custom responses: Pre-fill response prompts for seamless human-agent interactions and escalations.
How to Use (Code Snippet Overview)
- Define tools and annotate with approval requirements:
- Example: a simple add tool without approval
- Mark certain tools with human approval:
- @hl.require_approval() def multiply(x: int, y: int) -> int: return x * y
- Collect responses and route to the right humans/teams
Sample usage patterns are shown in the documentation and GitHub examples, illustrating how to wire LLMs with HumanLayer to orchestrate approvals, feedback, and human input in real-time.
Key Features
- Require Human Approval for Function Calls: @hl.require_approval() blocks specific function calls until a human has consulted and approved.
- OmniChannel Contact: Engage humans via Slack, Email, Discord, and more.
- Advanced Approvals: Escalations, timeouts, and multi-team coordination for complex workflows.
- Human as Tool: Treat humans as an actionable tool for answers, advice, or feedback.
- Granular Routing: Route approvals to specific individuals or teams.
- Bring Your Own LLM + Framework: Works with any LLM and major orchestration frameworks.
- Asynchronous, Outer-Loop Workflows: Build long-running agent processes that pause for human input.
- Pre-fill Responses & Custom Escalations: Prepare prompts and escalation paths for seamless interactions.
- Datasets Export for Training & Evals: Export live feedback to labeled datasets for fine-tuning or evaluation.
Plans & Pricing (Overview)
- Starter (Free forever for hackers and tinkerers): 100 operations/month. Slack, Email, Discord integrations. Limited data retention.
- Premium: $500/month. Includes 2000 operations/month, advanced approval workflows, channels for MS Teams, SMS, RCS, and higher data retention. Custom branding and BYO app/keys.
- Enterprise: Custom deployments (VPC/on-prem), RBAC/SSO, volume discounts, and expert guidance for custom agent builds.
Note: See the official pricing page for detailed quotas and terms.
Safety & Governance
- Human approvals ensure responsible execution of sensitive actions.
- Denied approvals feed back into the agent context to improve decision-making.
- Exportable feedback datasets support compliant training and evaluation.
Why use HumanLayer?
- Invert the AI agent model by introducing human direction for hard, non-core parts while the automation handles routine tasks.
- Accelerate production-grade reliable agent workflows with built-in human oversight and collaboration channels.
Quick Start
- Install the SDK and connect with your preferred LLM.
- Define tools and annotate those requiring human approval.
- Add channels for human input (Slack, Email, Discord).
- Deploy and monitor approvals, escalations, and feedback loops.
See Also
- Official documentation
- GitHub examples
About
Trusted by engineers and teams building agent-based automation with required human oversight. Build responsible AI workflows that combine automation with expert human feedback where it matters most.