You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're designing a "Return of Control" pattern to enable human-in-the-loop workflows in Strands Agents. This will allow agents to pause execution for external approval, input, or review, then resume seamlessly.
The Problem
Currently, once an agent's event loop starts, it runs to completion without interruption. This prevents scenarios like:
Tool approval workflows ("Should I delete these files?")
Security reviews for sensitive operations
Budget approvals for costly actions
External system integration points
Proposed Solution
The following are ideas we have begun to explore (not final decisions):
1. Pause - Exception-Based Interruption
Hooks can raise special AgentInterruptException types to cleanly interrupt execution:
Paused agents can be resumed across different processes or sessions:
# Session 1: Agent gets pausedsession_manager=FileSessionManager("user_123")
agent=Agent(session_manager=session_manager, hooks=[ApprovalHook()])
# ... agent pauses and state is saved# Session 2: Resume from different processagent=Agent(session_manager=session_manager, hooks=[ApprovalHook()])
ifagent.state.status=="paused":
result=agent() # Resume from saved state
area-devxDeveloper experience improvementsarea-hooksFeatures or requests that might be implementable via hooks
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Return of Control
Overview
We're designing a "Return of Control" pattern to enable human-in-the-loop workflows in Strands Agents. This will allow agents to pause execution for external approval, input, or review, then resume seamlessly.
The Problem
Currently, once an agent's event loop starts, it runs to completion without interruption. This prevents scenarios like:
Proposed Solution
The following are ideas we have begun to explore (not final decisions):
1. Pause - Exception-Based Interruption
Hooks can raise special
AgentInterruptException
types to cleanly interrupt execution:2. Resume - Null Prompt Detection
Resume by calling the agent with no prompt (
agent()
) - this triggers automatic resume detection:3. State Check - Agent Status Property
Track agent state with a simple status property:
Complete Example
Session Persistence
Paused agents can be resumed across different processes or sessions:
Beta Was this translation helpful? Give feedback.
All reactions