Full walkthrough: Human-in-the-loop for CrewAI. Reaching your own end-users on their phones is the Pushary Partner plan.
Human-in-the-loop for CrewAI. Replace the console
human_input=True prompt with a tool that reaches a real person on their phone and
blocks until they answer, fail-closed.
Requires the Pushary Partner plan.
pip install pushary-crewaiSet PUSHARY_API_KEY (get it in your dashboard).
from pushary_crewai import connect
link = connect("user_123") # show this to your end-user; one tap connects their phonefrom crewai import Agent, Task, Crew
from pushary_crewai import make_ask_human_tool
agent = Agent(
role="Ops",
goal="Ship safely",
backstory="Careful operator.",
tools=[make_ask_human_tool("user_123")],
)
task = Task(
description="Draft the release. Before finalizing, call ask_human to get approval.",
expected_output="approved release notes",
agent=agent,
)
Crew(agents=[agent], tasks=[task]).kickoff()The tool blocks until the person answers and returns a fail-closed instruction. The
external_id is bound when you build the tool, never taken from the model, so a
prompt-injected agent cannot ask the wrong person.
from pushary_crewai import ask_human
d = ask_human("Approve this refund?", external_id="user_123", type="confirm")
if d["approved"]:
issue_refund()connect(external_id, *, api_key=None, base_url=None)— enroll an end-user's phone.make_ask_human_tool(external_id, *, name=..., ...)— a CrewAIBaseToolbound to that user.ask_human(question, *, external_id, type="confirm", ...)— blocking, returns the decision dict.resolve_pushary_callback(raw_body, signature, secret)— verify + parse a callback for a durable path.describe_answer(type, result),is_affirmative(answer),deterministic_key(parts),SIGNATURE_HEADER.
A runnable example is in examples/.
MIT