# 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.
