Implement Human-in-the-Loop Controls
How to let users take control of Steel browser sessions
Steel's debug URL feature allows you to implement human-in-the-loop workflows where users can directly interact with and control browser sessions. This is particularly useful when you need users to take temporary control of automated browser sessions.
Prerequisites
-
Basic familiarity with Steel sessions
-
Understanding of debug URLs
-
A Steel API key
Making Sessions Interactive
To enable human interaction with a session, you'll need to configure two key parameters when embedding the session viewer:
-
interactive=true: Enables users to interact with the page through clicks, scrolling, and form inputs -
showControls=true: Shows the navigation bar where users can enter URLs and use forward/back controls
1<iframe2src={`${session.debugUrl}?interactive=true&showControls=true`}3style="width: 100%; height: 600px; border: none;"4></iframe>
When both parameters are enabled, users can:
-
Click and interact with elements on the page
-
Scroll the page
-
Enter new URLs in the navigation bar
-
Use browser-style forward/back navigation
-
Fill out forms and input fields
-
Navigate through websites naturally
If you’re building user facing agents, this is particularly useful when you need users to:
-
Take control of an automated session that needs assistance
-
Enter sensitive information like login credentials
-
Solve CAPTCHAs
-
Verify or correct automated actions
-
Demonstrate actions that will be automated
Implementation Examples
React Implementation
Here's how to embed an interactive session viewer into a React Application:
1// SessionViewer.tsx2import React from 'react';34type SessionViewerProps = {5debugURL: string;6};78const SessionViewer: React.FC<SessionViewerProps> = ({ debugURL }) => {9return (10<div className="session-container">11<div12className="status-banner"13style={{14background: '#f0f0f0',15padding: '10px',16marginBottom: '10px',17textAlign: 'center',18}}19>20Automated session - Click inside to take control21</div>2223<iframe24src={`${debugURL}?interactive=true&showControls=true`}25style={{26width: '100%',27height: '600px',28border: 'none',29}}30title="Browser Session"31/>32</div>33);34};3536export default SessionViewer;3738// Usage in App.tsx39import React from 'react';40import SessionViewer from './SessionViewer';4142const App: React.FC = () => {43return (44<div className="App">45<h1>Browser Automation Dashboard</h1>46<SessionViewer debugURL="YOUR_debug_URL" />47</div>48);49};5051export default App;
Best Practices
-
Ensure your iframe container is large enough for comfortable interaction (recommended minimum height: 600px)
-
Make it clear to users when they can interact with the session
-
Remember that any actions taken in an interactive session affect the actual browser session & state
What's Next
Learn about session timeouts for managing interactive sessions:
Session Lifecycle
Learn how to start and release browser sessions programatically.