Answers you can trust, from Codeables
Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.
Explore CodeablesHow do I deal with bot protection and proxy requirements when automating legitimate web workflows at scale?
Most engineering teams don’t hit bot protection limits because they’re “too automated.” They hit them because their automation looks nothing like a real user session—wrong IP patterns, brittle cookies, inconsistent device fingerprints, and no notion of continuity across steps.
If you’re trying to automate legitimate workflows at scale—think account dashboards, KYC portals, or ecommerce checkouts—you need to design for two things from day one:
- How you interact with bot protection systems
- How you provision and manage proxies as part of that interaction
Below I’ll walk through how I approach this now, and how MultiOn’s browser-operating agents change the shape of the problem compared to hand-rolled Playwright/Selenium farms.
Why bot protection and proxies become your scaling bottleneck
Once you move past “a few internal scripts,” you start to see the same failure patterns:
- Logins work on dev IPs, fail randomly from the data center
- Checkout flows die at the payment step with “suspicious activity”
- Dynamic UIs never fully render unless you wait an arbitrary number of seconds
- A/B tests and personalization make your fragile selectors useless overnight
The root causes are usually:
-
Non-human traffic signatures
- Headless browsers with default user agents
- No GPU/Canvas/WebGL fingerprint
- No real mouse or scroll activity, just DOM-level interactions
-
Bad IP hygiene
- Bursts of high-volume traffic from a narrow IP range
- Mixing test and production flows on the same proxy pool
- Country/region mismatches between user accounts and ingress IPs
-
Broken session continuity
- New browser instances for every step (login, then checkout, then payment)
- Lost cookies, inconsistent localStorage, no shared session state
- Bot systems seeing “a different device” at each milestone
-
Ad‑hoc handling of challenges
- No strategy for CAPTCHAs, email/SMS verification, or “unusual activity” checks
- Scripts that panic and crash when a single element’s XPath moves
You can throw more proxies and more retries at this, but you’re just making entropy more expensive. Instead, you want to design a system that:
- Looks like a real device in a real browser
- Keeps a stable, long-lived session across steps
- Routes traffic through sane, compliant proxy strategies
- Surfaces bot protection friction as a first-class signal, not a random crash
Principle 1: Treat session continuity as the real unit of automation
If your automation doesn’t preserve session state, bot defenses will assume “new device, new risk.” That’s why session continuity matters more than individual selectors.
With MultiOn, the unit of continuity is the session_id.
How MultiOn models sessions
You start a workflow with the Agent API (V1 Beta):
curl -X POST https://api.multion.ai/v1/web/browse \
-H "Content-Type: application/json" \
-H "X_MULTION_API_KEY: $MULTION_API_KEY" \
-d '{
"url": "https://www.example.com/login",
"cmd": "Log in with the test account and land on the account dashboard."
}'
The response includes a session_id. That ID maps to a secure remote browser session with:
- Cookies
- LocalStorage / sessionStorage
- In-page state, including JS runtime context
Every subsequent step uses that same session_id:
curl -X POST https://api.multion.ai/v1/web/browse \
-H "Content-Type: application/json" \
-H "X_MULTION_API_KEY: $MULTION_API_KEY" \
-d '{
"session_id": "SESSION_FROM_FIRST_CALL",
"cmd": "Navigate to the billing page and update the payment method."
}'
This “Sessions + Step mode” is your core defense against bot suspicion:
- The device fingerprint stays stable across login → dashboard → checkout
- The IP and browser profile don’t randomly change mid-flow
- Cookies and risk-scoring tokens stay intact
If you’re not using MultiOn and you’re still on Playwright/Selenium:
- Reuse a single
BrowserContext(Playwright) or session (Selenium) per user workflow - Persist cookies and storage between runs when appropriate
- Detect and treat “forced relogin” or “suspicious activity” pages as explicit states, not just test failures
Principle 2: Make proxies a first-class part of your architecture
Proxies aren’t an afterthought; they’re one of the main features bot defenses observe. Even if your intent is fully legitimate, a poor proxy strategy will make you look hostile.
What a sane proxy strategy looks like
-
Match IP geography to user/account geography
- US accounts? Use US exit nodes.
- EU-only content? Don’t route from US or APAC.
-
Segment traffic by use case
- Separate pools for:
- Production user flows
- Load/performance tests
- QA / staging automation
- This reduces cross-contamination; a test flood won’t poison production behavior.
- Separate pools for:
-
Control concurrency per domain
- Cap concurrent sessions per domain and per IP block.
- Spread workflows across time: bursts at the top of the hour are suspicious.
-
Avoid “one proxy per request” flapping
- Keep a stable IP per
session_idfor the life of the workflow. - Changing IP mid-session is one of the fastest ways to trigger fraud checks.
- Keep a stable IP per
How MultiOn fits into proxy management
MultiOn is built around secure remote sessions and native proxy support for “tricky bot protection.” Practically, that means:
- MultiOn runs your workflows in a real browser environment behind its own proxy and infrastructure layer.
- You get session continuity via
session_idwithout building a “remote Chrome farm” yourself. - You don’t have to manually stitch together data center IPs, residential proxies, and region routing just to make a simple checkout work.
Instead of wiring proxies into every Playwright/Selenium node, you:
- Create a MultiOn API key.
- Call
POST https://api.multion.ai/v1/web/browsewith yourcmd+url. - Let MultiOn’s infrastructure handle:
- Browser profile
- Session persistence
- Proxy routing and bot protection ergonomics
You still need to be a good actor—respect rate limits, follow the site’s terms, and avoid abusive concurrency—but you’re not on the hook for low-level proxy orchestration and fingerprint hacks.
Principle 3: Use “real-browser” signals, not just DOM-level automation
Modern bot systems don’t rely only on request headers. They look at how a session behaves:
- Is there mouse movement?
- Does the scroll behavior resemble a human?
- Do events fire in realistic sequences, or does the script “teleport” through the DOM?
Headless automation often fails here because:
- It uses default user agents and empty fingerprints.
- It fires
click()andtype()on elements without any on-screen interaction. - It loads pages without running JavaScript fully.
What “real-browser behavior” means in practice
With MultiOn’s Agent API, the agent operates a real browser session, not an HTTP client:
- JavaScript rendering is native, not an afterthought.
- Dynamic content, modals, and lazy-loaded elements are handled by the actual runtime.
- The agent performs actions like a user rather than patching HTTP calls around the UI.
When you want structured output instead of actions, you switch to Retrieve:
curl -X POST https://api.multion.ai/v1/web/retrieve \
-H "Content-Type: application/json" \
-H "X_MULTION_API_KEY: $MULTION_API_KEY" \
-d '{
"url": "https://www2.hm.com/en_us/men/products/jeans.html",
"cmd": "Return a JSON array of objects with name, price, colors, productUrl, and imageUrl for each listed product.",
"renderJs": true,
"scrollToBottom": true,
"maxItems": 50
}'
Key controls here:
renderJs: true— ensures bot-protected, JS-heavy pages actually renderscrollToBottom: true— triggers lazy loading and infinite scroll contentmaxItems— caps how much you pull per request; less bursty, safer behavior
Output is a JSON array of objects, which you can store or feed into other systems, without writing scrapers that break every time the DOM changes.
Principle 4: Handle bot challenges as explicit states, not random failures
Even with good hygiene, you will still see:
- CAPTCHAs
- “Verify this login via email/SMS”
- “Unusual activity detected” extra steps
If your automation treats these as untyped exceptions, you’ll never scale reliably.
How to operationalize challenges
-
Detect challenge templates
- Build detectors around page content, URLs, and specific DOM signatures:
contains("verify your identity")- CAPTCHAs iframe patterns
- MFA-specific routes (
/auth/challenge,/2fa, etc.)
- Build detectors around page content, URLs, and specific DOM signatures:
-
Route challenges differently
- For some flows, bail and mark as “human review required.”
- For specific domains where you have a business relationship, implement appropriate verification paths (e.g., webhook-based approvals, internal inbox checks).
-
Feed this back into your proxy/session strategy
- Track which IP ranges and patterns correlate with more challenges.
- Adjust concurrency and geolocation based on those signals.
With MultiOn, your application sees the full rendered page in the agent’s context, so you can:
- Use the
cmdto make the agent navigate past a known, legitimate challenge page. - Or detect when the agent surfaces a challenge and stop the workflow intentionally.
Because the agent runs in a secure remote browser, you’re not hacking around challenge HTML from a purely HTTP perspective—you’re interacting like a real user.
Principle 5: Design for scale from the start
At small scale, you can survive on duct-taped proxies and ad-hoc selectors. At hundreds or thousands of workflows per day, they become operational nightmares.
What “scale-ready” looks like
-
Parallelism as a backend concept
- Many workflows running in parallel instead of one monolithic queue.
- Bounded concurrency per domain/IP, but horizontal scale across tasks.
-
Visibility into failure modes
- Distinguish:
- Element not found
- Bot challenge hit
- Network/proxy failure
- Payment gating (e.g., “402 Payment Required” from an API)
- Don’t bury everything under “timeout.”
- Distinguish:
-
Explicit billing and quotas
- When you use platforms like MultiOn, you’ll see constraints in the API contract (e.g.,
402 Payment Required). - Treat these as first-class signals so you don’t overrun budgets as you scale.
- When you use platforms like MultiOn, you’ll see constraints in the API contract (e.g.,
MultiOn is designed for “infinite scalability with parallel agents”—millions of concurrent AI agents ready to run—so you’re not building your own remote Chrome farm, autoscaling it, and bolting on proxy management.
Your core loop becomes:
- Task: “Order this item on Amazon for this user,” “Post to X,” “Extract these products from H&M.”
- Mechanism:
POST https://api.multion.ai/v1/web/browseor/v1/web/retrievewithcmd,url, andsession_id. - Output: Completed action in a real browser, or a structured JSON array of objects.
Concrete patterns for dealing with bot protection and proxies
Here’s how I’d implement a production-ready, legitimate workflow at scale.
Example: Amazon checkout flow at scale
Goal: Automate Amazon orders for users who explicitly authorize your app to act in their account.
Pattern:
-
User connects account
- Store user’s Amazon preferences (address, payment method alias, region).
-
Start a MultiOn session
curl -X POST https://api.multion.ai/v1/web/browse \ -H "Content-Type: application/json" \ -H "X_MULTION_API_KEY: $MULTION_API_KEY" \ -d '{ "url": "https://www.amazon.com/", "cmd": "Log in to the user account using the provided credentials and land on the homepage." }'- Save the
session_idfor this order workflow.
- Save the
-
Navigate and add to cart
curl -X POST https://api.multion.ai/v1/web/browse \ -H "Content-Type: application/json" \ -H "X_MULTION_API_KEY: $MULTION_API_KEY" \ -d '{ "session_id": "SESSION_FROM_LOGIN", "cmd": "Search for the specified product, open the correct result, and add one unit to the cart." }' -
Checkout
curl -X POST https://api.multion.ai/v1/web/browse \ -H "Content-Type: application/json" \ -H "X_MULTION_API_KEY: $MULTION_API_KEY" \ -d '{ "session_id": "SESSION_FROM_LOGIN", "cmd": "Proceed to checkout, ensure the saved address and payment method are selected, and place the order." }'
Every step:
- Uses the same
session_id→ consistent device + IP - Runs in a real browser → no obvious headless fingerprints
- Rides on MultiOn’s secure remote sessions and native proxy support
If a bot challenge appears, the agent will surface that page in context. Your system can detect the pattern (e.g., “we need an extra OTP”) and either:
- Stop and ask the user for input, or
- Mark this workflow as “requires manual fulfillment.”
Example: H&M catalog extraction with Retrieve
Goal: Turn a dynamic, JS-heavy catalog into structured data without scraping gymnastics.
-
Call Retrieve:
curl -X POST https://api.multion.ai/v1/web/retrieve \ -H "Content-Type: application/json" \ -H "X_MULTION_API_KEY: $MULTION_API_KEY" \ -d '{ "url": "https://www2.hm.com/en_us/men/products/jeans.html", "cmd": "Return a JSON array of objects with name, price, colors, productUrl, and imageUrl for each listed product.", "renderJs": true, "scrollToBottom": true, "maxItems": 100 }' -
Receive a JSON array of objects representing products.
This approach:
- Respects the site’s JS rendering and scrolling behavior.
- Uses a real browser session behind the Retrieve function.
- Lets you throttle
maxItemsand call frequency to stay within responsible usage.
Putting it all together: a decision framework
When you’re dealing with bot protection and proxies for legitimate workflows at scale:
-
Anchor on session continuity
- Design around long-lived, consistent sessions (
session_idin MultiOn,BrowserContextin Playwright). - Avoid mid-flow IP changes.
- Design around long-lived, consistent sessions (
-
Make proxies an architectural concern, not a patch
- Align IP geography, segment traffic, and control concurrency by domain.
- Prefer platforms with native proxy support and secure remote sessions over DIY farms.
-
Use real browsers, not HTTP hacks
- Let the browser execute JS, render dynamic content, and behave like a user.
- With MultiOn, that’s built into the Agent API and Retrieve surfaces.
-
Treat challenges as states, not noise
- Detect and log CAPTCHAs, MFA steps, and “unusual activity” pages.
- Adjust your strategy and traffic patterns based on those signals.
-
Scale via parallel agents, not one giant script
- Run many workflows concurrently, with explicit error and billing semantics.
- MultiOn’s “millions of concurrent AI Agents ready to run” framing matches this model.
If you’re tired of babysitting brittle Playwright/Selenium scripts and fighting with bot protection at every release, it’s time to move the heavy lifting into a platform that’s built around real browser control, secure remote sessions, and native proxy support.