Feature Area
Core functionality
Is your feature request related to a an existing bug? Please link it here.
Problem: Currently, the Crew AI system handles the HITL interctions on the task level, once the model runs a query, the execution of different tasks within the query are operated. In many real world scenarios the tasks can have different level of sensitivity as follows:
Case 1: Scrap data from kaggle and create a summary of statistical features of the data.
In this case, there is no sensitive execution as of now, the model performs as per the query, requires no additional approval.
Case 2: Analyze the transaction pattern and freeze the crypto wallet.
In such cases, where there is a high stake or financial executions, a subtle inaccuracy in the prompt or the model understanding can cause the model to freeze a wallet or make a bigger wire transfer [for example].
Describe the solution you'd like
The solution is to propose a parameter called "requires_human_approval" directly inside the tool decorator, which defaults to "false" for base cases such as case 1, and can be set as true for sensitive cases like case 2.
When an agent attempts to use a tool with this flag set to True, the execution pauses, shows the user the exact arguments the LLM wants to use, and waits for a Y/n or text feedback. If rejected, the feedback is sent back to the agent as an observation so it can course-correct.
Timeout Fallback: Introduce a human_approval_timeout (e.g., default 60 seconds). If no human responds, the tool safely aborts and returns an "Approval Timeout" observation to the agent.
Callback Support: Allow the approval prompt to trigger a callback function instead of a terminal input(), so developers can route the approval request to a Slack webhook, a Streamlit button, or a custom UI.
Describe alternatives you've considered
None for now, open to alternative ideas as per the feedbacks.
Additional context
Design examples:
Case 1: Default Behavior (Fully Autonomous)
from crewai.tools import tool
# Defaults to False. Runs automatically without pause.
@tool("Kaggle Scraper")
def scrape_kaggle(dataset_url: str):
"""Scrapes statistical features from Kaggle data."""
return fetch_data(dataset_url)
Case 2:
Case 2: Sensitive Execution (Requires Approval)
# User explicitly opts-in to the safety check
@tool("Freeze Wallet", requires_human_approval=True)
def freeze_wallet(wallet_address: str):
"""Freezes a suspected illicit crypto wallet."""
return execute_freeze(wallet_address)
Willingness to Contribute
Yes, I'd be happy to submit a pull request
Feature Area
Core functionality
Is your feature request related to a an existing bug? Please link it here.
Problem: Currently, the Crew AI system handles the HITL interctions on the task level, once the model runs a query, the execution of different tasks within the query are operated. In many real world scenarios the tasks can have different level of sensitivity as follows:
Case 1: Scrap data from kaggle and create a summary of statistical features of the data.
In this case, there is no sensitive execution as of now, the model performs as per the query, requires no additional approval.
Case 2: Analyze the transaction pattern and freeze the crypto wallet.
In such cases, where there is a high stake or financial executions, a subtle inaccuracy in the prompt or the model understanding can cause the model to freeze a wallet or make a bigger wire transfer [for example].
Describe the solution you'd like
The solution is to propose a parameter called "requires_human_approval" directly inside the tool decorator, which defaults to "false" for base cases such as case 1, and can be set as true for sensitive cases like case 2.
When an agent attempts to use a tool with this flag set to True, the execution pauses, shows the user the exact arguments the LLM wants to use, and waits for a Y/n or text feedback. If rejected, the feedback is sent back to the agent as an observation so it can course-correct.
Timeout Fallback: Introduce a human_approval_timeout (e.g., default 60 seconds). If no human responds, the tool safely aborts and returns an "Approval Timeout" observation to the agent.
Callback Support: Allow the approval prompt to trigger a callback function instead of a terminal input(), so developers can route the approval request to a Slack webhook, a Streamlit button, or a custom UI.
Describe alternatives you've considered
None for now, open to alternative ideas as per the feedbacks.
Additional context
Design examples:
Case 1: Default Behavior (Fully Autonomous)
Case 2:
Case 2: Sensitive Execution (Requires Approval)
Willingness to Contribute
Yes, I'd be happy to submit a pull request