withHumanOct 29, 20264 min read

HumanLayer alternatives for AI agent approvals

Looking for a HumanLayer alternative? See how withHuman handles tool approvals, reviewer routing and feedback, and what changes from HumanLayer's SDK.

HumanLayer's approval SDK let AI agents ask a person before running a function. That SDK is now retired. The team is building a different product under the same name. If you're looking for a replacement, withHuman lets you hold tool calls for approval and choose who reviews them.

This guide looks at withHuman as an alternative to HumanLayer's approval SDK. We'll cover what it can replace, what works differently and what an integration looks like.

What is withHuman?

withHuman is an approval layer between AI agents and their tools. Before a tool runs, withHuman intercepts the tool call and checks it against your approval rules. Those rules can approve it automatically, deny it or send it to a person for approval. The agent waits (or pauses) until a decision is made.

For example, an AI on-call assistant might be allowed to roll back a deployment or fix an issue in staging automatically. Changes to production need approval from the on-call engineer.

Your team manages the rules and reviewers outside the agent's code. Several agents can use the same approval process, even if they're built differently. Check withHuman's repository for more details.

What can it replace?

Start with the parts of HumanLayer your agent used:

HumanLayer capabilityHow it works with withHuman
require_approval()An SDK integration holds the tool call and requests a decision before it runs.
Reviewers set through contact_channelEscalation paths choose who gets notified. You manage them outside the agent's code.
Approvals through Slack or email repliesNotifications link to the request. Reviewers decide in the web app or phone apps.
Denial feedback returned to the agentA denied call doesn't run. The agent receives the reason as the tool's result and can use the feedback to propose a new tool call.
human_as_tool()Planned.

The main fit is replacing tool approvals. If your agent also asks people open questions, you'll need to keep a separate way to collect those answers.

How reviewers and routing change

With HumanLayer, you could configure a Slack channel or email contact in the SDK. In withHuman, you set up approval pipelines and escalation paths.

The pipeline decides which calls need a person. For the release agent, a rule can check the deployment's environment argument and send production changes for review. Your team can update that rule without deploying the agent again.

The escalation path chooses the reviewers. You can notify the release team first, then the on-call lead if nobody answers within 15 minutes. Working hours let you control when people are contacted.

Reviewers receive a link through Slack, email, SMS, WhatsApp, Discord or a push notification. They inspect the tool call and its arguments in the web app or the iPhone and Android apps, then approve or deny it with a note. Replying to a Slack notification doesn't decide the request.

What does an integration look like?

withHuman uses an SDK integration in place of HumanLayer's decorator. You can check calls in your own tool loop or add middleware to an existing agent.

Your own tool loop

Install the core SDK:

pip install agentapprovalprotocol

Check the proposed call before running your deployment function:

import os
from agentapprovalprotocol import Call, Client, Gate

gate = Gate(Client("https://app.withhuman.ai/api/aap", os.environ["WITHHUMAN_TOKEN"]))

def run_deployment(run_id: str, tool_call) -> str:
    call = Call(
        key=f"{run_id}:{tool_call.id}",
        tool="deploy_release",
        arguments=tool_call.args,
    )
    with gate.guard(call) as verdict:
        return deployments.create(**tool_call.args) if verdict else verdict.reason

Here, tool_call comes from your tool loop and provides the call's id and args. Replace deployments.create with your application's deployment function. It runs only when the gate allows the call. Keep the same key when retrying a tool call.

LangChain and LangGraph

For an existing LangChain or LangGraph agent, add ApprovalMiddleware when you create it:

pip install "agentapprovalprotocol[langgraph]"
import os
from langchain.agents import create_agent
from agentapprovalprotocol.langgraph import ApprovalMiddleware

approvals = ApprovalMiddleware(
    "https://app.withhuman.ai/api/aap",
    os.environ["WITHHUMAN_TOKEN"],
)
agent = create_agent(model, tools=tools, middleware=[approvals])

Use your agent's existing model and tool functions for model and tools. The middleware checks each tool call before it runs, so you don't need to wrap tools individually.

The SDK setup guide covers credentials. The LangGraph integration guide covers setup and pausing runs. Both examples use the Agent Approval Protocol, an open standard between the integration and the approval service.

What to check before switching

Reviewers decide in the app. Your team can still receive Slack or email notifications, but approving a request takes them to withHuman.

Long reviews need pause and resume. By default, the SDK waits about nine minutes for a decision. If nobody answers, the call doesn't run and the agent is told why. For longer reviews, configure pause and resume.

Try it with one tool

Start with one tool you previously protected with require_approval(). Connect it using the SDK guide, then test an approval and a denial. Confirm that the approved call runs and the denied call returns feedback without taking the action.

If you want to compare approval approaches across the wider category, see our guide to human-in-the-loop tools for AI agents.