# Stealth Automation

**Browser Swarm** offers robust stealth automation features to help your browser sessions mimic real user behavior, effectively bypassing anti-bot mechanisms and ensuring seamless automation workflows.

***

### 🧩 Basic Stealth Mode

**Basic Stealth Mode** is designed to handle common detection techniques by:

* **Randomizing Browser Fingerprints**: Automatically generating realistic browser fingerprints for each session.
* **Dynamic Viewports**: Assigning random, realistic viewport sizes to emulate various devices.
* **CAPTCHA Solving**: Detecting and solving most visual CAPTCHAs automatically.

These features work out-of-the-box, eliminating the need for manual configuration and reducing the likelihood of detection.

***

### 🛡️ Advanced Stealth Mode

For more sophisticated anti-bot systems, **Advanced Stealth Mode** provides enhanced capabilities:

* **Custom Chromium Build**: Utilizing a specially crafted version of Chromium to better mimic human-like behavior.
* **Enhanced Fingerprinting Techniques**: Implementing advanced methods to avoid detection by more rigorous systems.
* **Optimized for Scale**: Designed for high-volume automation tasks requiring greater stealth.

*Note: Advanced Stealth Mode is available for users on the Scale Plan. Contact support to enable this feature.*

***

### 🤖 CAPTCHA Solving

CAPTCHAs can disrupt automation workflows. **Browser Swarm** addresses this by:

* **Automatic Detection**: Identifying CAPTCHAs during session execution.
* **Background Solving**: Attempting to solve CAPTCHAs without manual intervention, typically within 30 seconds.
* **Proxy Integration**: Enhancing success rates by routing traffic through residential proxies.

To disable CAPTCHA solving, set `solveCaptchas` to `false` in your session configuration.

***

### ⚙️ Enabling Stealth Features

To activate stealth features in your sessions:

#### Example:

{% tabs %}
{% tab title="Node.js " %}

```javascript
import { BrowserSwarm } from 'browser-swarm-sdk';

const bs = new BrowserSwarm({ apiKey: process.env.BROWSER_SWARM_API_KEY });

const session = await bs.sessions.create({
  projectId: process.env.BROWSER_SWARM_PROJECT_ID,
  browserSettings: {
    advancedStealth: true,
    solveCaptchas: true,
  },
  proxies: true,
});
```

{% endtab %}

{% tab title="Python" %}

```python
from browser_swarm import BrowserSwarm
import os

bs = BrowserSwarm(api_key=os.environ["BROWSER_SWARM_API_KEY"])

session = bs.sessions.create(
    project_id=os.environ["BROWSER_SWARM_PROJECT_ID"],
    browser_settings={
        "advanced_stealth": True,
        "solve_captchas": True,
    },
    proxies=True,
)
```

{% endtab %}
{% endtabs %}

*Ensure that your account has the necessary permissions to use Advanced Stealth Mode.*

***

### 💡 Best Practices

* **Use Proxies**: Enhance anonymity and reduce detection by routing sessions through residential proxies.
* **Avoid Custom Fingerprinting**: Rely on Browser Swarm's automated fingerprinting for optimal results.
* **Monitor Sessions**: Utilize the Session Inspector to observe and debug sessions in real-time.

By leveraging Browser Swarm's stealth automation features, you can execute reliable and undetectable browser automation tasks at scale.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://browserswarm.gitbook.io/docs/advanced-features/stealth-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
