[FEATURE] Support Human-in-the-Loop (HIL) capabilities
Problem Statement
Consider to provide Human-in-the-Loop (HIL) capabilities to enable human intervention at any point during execution
Proposed Solution
Enhancement on existing mechanism that could be used to implement HIL patterns:
Callback Handler System
Through the callback handler system. The Agent class accepts a callback_handler parameter that receives events throughout execution and processes events during the event loop cycle.
Tool-Based Intervention Points
Through custom tools that can pause execution and request human input. The tool system supports custom Python functions decorated with @tool, and tools can access the agent context through parameter injection.
Streaming Interface for Real-time Monitoring
Through stream_async() that yields events as they occur. This could enable real-time monitoring and intervention, though it would require custom implementation to pause execution.
Request State Management
The event loop maintains a request_state that can be modified during execution in event loop. A custom implementation could use this to signal when human intervention is needed.
Use Case
Provide robust mechanisms for pausing workflows, collecting human input, and resuming execution with the provided feedback or modifications, which are common cases in regulation impose and data sensitive industries, e.g. Finance
Alternatives Solutions
No response
Additional Context
No response
Status
- [x] Support interruption from BeforeToolCallEvent hooks
- PR: https://github.com/strands-agents/sdk-python/pull/987
- [x] Support interruption from tool definitions
- PR: https://github.com/strands-agents/sdk-python/pull/1041
- [x] Support elicitation in MCP tool.
- PR: https://github.com/strands-agents/sdk-python/pull/1094
- Note, we support elicitation by conventional means of an elicitation callback. There are plans though to have Strands translate elicitations into interrupts when the user does not provide an elicitation callback. This will be follow up work that we track separately.
- [x] Signal that interrupts are not supported for direct tool calls.
- PR: https://github.com/strands-agents/sdk-python/pull/1097
- [x] Support same interrupt mechanism for multi-agent workflows.
- [x] Swarm PR: https://github.com/strands-agents/sdk-python/pull/1193
- [x] Graph PR: https://github.com/strands-agents/sdk-python/pull/1606
Updates
We still have graph interrupts left to support. The following is our progress:
- 2025-01-13: We are going to release a PR that introduces interrupt support in hooks only. Following, we will release support for node executor interrupts.
- 2025-01-14: Adding support for hook based interrupts in graphs with https://github.com/strands-agents/sdk-python/pull/1478
- Will need to follow up to allow interrupts from agent and multiagent nodes.
- 2025-01-15: Merged in support for raising interrupts from hooks in graphs (will go out with next release). Next I am working on supporting interrupts from agent nodes. The last item will be supporting interrupts from multi-agent nodes.
- 2025-01-21: Adding support for raising interrupts from agent nodes in https://github.com/strands-agents/sdk-python/pull/1533. Last task is supporting interrupts from multi-agent nodes.
- 2025-01-30: Adding support for raising interrupts from multi agent nodes in https://github.com/strands-agents/sdk-python/pull/1606
- This is the last and final PR to close out this feature request.
- 2025-02-02: Last PR is merged and will go with in the next release on Wednesday. Will close this ticket after release.
Thank you for your feedback @yike5460. We have created https://github.com/strands-agents/sdk-python/issues/214 to encompass several multi-agent and return of control (HIL) features. This task is part of that epic.
We should also consider how hooks might also contribute to HIL scenarios. For instance, if a hook could somehow indicate that the loop should stopped, it'd be one way to implement tool consent.
Resumption from any point in the event_loop is also something we should be considering
MCP released Elicitation which will play a role in HIL.
For further discussion on this topic, you can share feedback in https://github.com/strands-agents/sdk-python/discussions/666. Here we have detailed the approaches we started considering.
Update: PRs are in progress right now.
https://github.com/strands-agents/sdk-python/pull/987: hooks - before tool call event - interrupt
Remaining tasks:
- [x] Support interruption from BeforeToolCallEvent hooks
- PR: https://github.com/strands-agents/sdk-python/pull/987
- [x] Support interruption from tool definitions
- PR: https://github.com/strands-agents/sdk-python/pull/1041
- [x] Support elicitation in MCP tool.
- PR: https://github.com/strands-agents/sdk-python/pull/1094
- Note, we support elicitation by conventional means of an elicitation callback. There are plans though to have Strands translate elicitations into interrupts when the user does not provide an elicitation callback. This will be follow up work that we track separately.
- [ ] Support same interrupt mechanism for multi-agent workflows.
- PR: https://github.com/strands-agents/sdk-python/pull/1193
- [x] Signal that interrupts are not supported for direct tool calls.
- PR: https://github.com/strands-agents/sdk-python/pull/1097
- [ ] Emit appropriate metrics/traces around interrupts.
-Docs: https://strandsagents.com/latest/documentation/docs/user-guide/concepts/interrupts/
Remaining tasks:
- [x] Support interruption from BeforeToolCallEvent hooks
- PR: https://github.com/strands-agents/sdk-python/pull/987
- [x] Support interruption from tool definitions
- PR: https://github.com/strands-agents/sdk-python/pull/1041
- [x] Support elicitation in MCP tool.
- PR: https://github.com/strands-agents/sdk-python/pull/1094
- Note, we support elicitation by conventional means of an elicitation callback. There are plans though to have Strands translate elicitations into interrupts when the user does not provide an elicitation callback. This will be follow up work that we track separately.
- [x] Signal that interrupts are not supported for direct tool calls.
- PR: https://github.com/strands-agents/sdk-python/pull/1097
- [ ] Support same interrupt mechanism for multi-agent workflows.
- [x] Swarm PR: https://github.com/strands-agents/sdk-python/pull/1193
- [ ] Graph PR: In progress
Wanted to give an update, I got back to the Graph interrupt PR. Everything is coded up. I am now going through testing and validation.
Note, we support elicitation by conventional means of an elicitation callback. There are plans though to have Strands translate elicitations into interrupts when the user does not provide an elicitation callback. This will be follow up work that we track separately.
@pgrayy , any update on when it will be possible to interrupt an agent on an MCP elicitation? Otherwise, how can we request more input from the users if we can't interrupt the agent?
Note, we support elicitation by conventional means of an elicitation callback. There are plans though to have Strands translate elicitations into interrupts when the user does not provide an elicitation callback. This will be follow up work that we track separately.
@pgrayy , any update on when it will be possible to interrupt an agent on an MCP elicitation? Otherwise, how can we request more input from the users if we can't interrupt the agent?
Unfortunately, there are no immediate plans to work on this right now and so you will have to use elicitation callbacks to request input from the user. The difference between an elicitation callback and a Strands interrupt is that the elicitation callback thread and agent invocation remain open. The user request is thus performed concurrently (example). The challenge in translating this procedure to a Strands interrupt is that the mcp client connection must remain open.
hey @karllessard, while we do not plan on prioritizing elicitation through interrupts in the short term, I think the idea makes sense.
That said, I think it requires design and discussion ahead of time. If you would like to work on it, feel free to create an issue with the problem statement and your proposed design. We can discuss further there, and we can take contributions on this topic (provided we agree on the design first)
Progress Summary for Newcomers
For anyone discovering this issue, here's the current state of Human-in-the-Loop (HIL) support:
✅ Already Available (Released)
- Hook-based interrupts - BeforeToolCallEvent (#987)
- Tool-level interrupts - Built into tool definitions (#1041)
- MCP elicitation - Via callbacks (#1094)
- Swarm interrupts - Multi-agent swarm support (#1193)
- Direct tool call signaling - Clear error messages (#1097)
- Graph hook interrupts - Merged Jan 15 (#1478)
🚧 In Progress
- Graph node interrupts - @pgrayy is working on agent & multi-agent node support (last update Jan 15)
💡 Future Consideration
- MCP elicitation → interrupt translation - Not currently prioritized, but @mkmeral indicated contributions would be considered with proper design discussion
📚 Documentation
Comprehensive docs available at: https://strandsagents.com/latest/documentation/docs/user-guide/concepts/interrupts/
For Contributors
If you're interested in the elicitation-to-interrupt feature:
- Create a new issue with your problem statement and proposed design
- Discuss with maintainers before implementing (design agreement required)
- Note the technical challenge: MCP client connection must remain open during interrupts
Bottom line: Core HIL functionality is already available. The remaining work is completing graph node interrupts, which is actively being developed.
🤖 This is an AI agent response from the Strands community, powered by Strands Agents SDK. Feedback helps us improve! If you prefer human assistance, please let us know.