> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Stealth Mode

> Configure anti-detection features for your browser sessions

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

Notte sessions include built-in stealth features to help your automations avoid detection by anti-bot systems.

## Built-in Stealth Features

All Notte sessions automatically include:

* **Clean browser fingerprints** - Realistic browser signatures
* **Navigator properties** - Proper webdriver, plugins, and language settings
* **Canvas fingerprinting protection** - Randomized canvas signatures
* **WebGL fingerprinting protection** - Unique WebGL parameters
* **Timezone and locale matching** - Consistent geolocation data
* **Chrome DevTools Protocol hiding** - CDP detection prevention

## Basic Usage

Stealth features are enabled by default. Simply create a session:

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session() as session:
      page = session.page
      page.goto("https://bot-detection-test.com")
      # Stealth features automatically active
  ```
</CodeGroup>

## Enhanced Stealth with Proxies

Combine stealth mode with residential proxies for maximum anonymity:

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session(
      proxies=True,  # Enable residential proxies
      browser_type="chrome"  # Use Chrome for best compatibility
  ) as session:
      page = session.page
      page.goto("https://example.com")
  ```
</CodeGroup>

## Custom User Agents

Override the default user agent for specific requirements:

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session(
      user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
  ) as session:
      page = session.page
      page.goto("https://example.com")
  ```
</CodeGroup>

## Stealth Best Practices

### 1. Use Realistic Behavior

Avoid patterns that look automated:

{/* @sniptest testers/sessions/stealth/realistic_behavior.py */}

```python realistic_behavior.py theme={null}
import random
import time

from notte_sdk import NotteClient

client = NotteClient()

with client.Session() as session:
    page = session.page
    page.goto("https://example.com")

    # Bad: Instant actions
    page.click("button")
    page.fill("input", "text")

    # Good: Human-like delays
    page.click("button")
    time.sleep(random.uniform(0.5, 1.5))
    page.fill("input", "text")
```

### 2. Rotate Proxies

Use different proxies for different sessions:

{/* @sniptest testers/sessions/stealth/rotate_proxies.py */}

```python rotate_proxies.py theme={null}
from notte_sdk import NotteClient

client = NotteClient()

# Session 1 with US proxy
with client.Session(proxies="us") as session:
    # automation
    pass

# Session 2 with UK proxy
with client.Session(proxies="gb") as session:
    # automation
    pass
```

### 3. Match Viewport to Real Devices

Use common screen resolutions:

{/* @sniptest testers/sessions/stealth/match_viewport.py */}

```python match_viewport.py theme={null}
from notte_sdk import NotteClient

client = NotteClient()

# Desktop
with client.Session(viewport_width=1920, viewport_height=1080) as session:
    pass

# Laptop
with client.Session(viewport_width=1366, viewport_height=768) as session:
    pass
```

### 4. Combine Multiple Techniques

Layer stealth features for best results:

{/* @sniptest testers/sessions/stealth/combine_techniques.py */}

```python combine_techniques.py theme={null}
from notte_sdk import NotteClient

client = NotteClient()

with client.Session(
    browser_type="chrome",
    proxies=True,
    viewport_width=1920,
    viewport_height=1080,
    user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
) as session:
    # Maximum stealth configuration
    pass
```

## Testing Stealth

Test your stealth configuration against detection services:

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  test_sites = [
      "https://bot.sannysoft.com/",
      "https://arh.antoinevastel.com/bots/areyouheadless",
      "https://fingerprint.com/demo/"
  ]

  with client.Session(proxies=True) as session:
      page = session.page

      for site in test_sites:
          page.goto(site)
          page.screenshot(path=f"stealth_test_{site.split('//')[1].split('/')[0]}.png")
  ```
</CodeGroup>

## What Stealth Can't Do

Stealth features help avoid detection, but they cannot:

* ❌ Bypass login rate limits (use delays between attempts)
* ❌ Avoid behavioral analysis (act like a human)
* ❌ Bypass IP-based blocking (use proxy rotation)
* ❌ Solve all captchas automatically (use captcha solving)

## Stealth + Captcha Solving

Combine stealth with automatic captcha solving for comprehensive protection:

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session(
      solve_captchas=True,
      proxies=True
  ) as session:
      page = session.page
      page.goto("https://example.com/login")
      # Both stealth and captcha solving active
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Proxies" icon="network-wired" href="/features/sessions/proxies">
    Configure residential proxies
  </Card>

  <Card title="CAPTCHA Solving" icon="shield-check" href="/features/sessions/captcha-solving">
    Automatically solve captchas
  </Card>

  <Card title="Browser Types" icon="browser" href="/features/sessions/browser-types">
    Choose the right browser engine
  </Card>

  <Card title="Multi-Region Support" icon="globe" href="/features/sessions/multi-region">
    Run sessions in different regions
  </Card>
</CardGroup>
