agentic-stealth-browser 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. agentic_stealth_browser-0.8.0/.env.example +2 -0
  2. agentic_stealth_browser-0.8.0/CHANGELOG.md +82 -0
  3. agentic_stealth_browser-0.8.0/LICENSE +21 -0
  4. agentic_stealth_browser-0.8.0/MANIFEST.in +10 -0
  5. agentic_stealth_browser-0.8.0/PKG-INFO +195 -0
  6. agentic_stealth_browser-0.8.0/README.md +160 -0
  7. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/PKG-INFO +195 -0
  8. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/SOURCES.txt +96 -0
  9. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/dependency_links.txt +1 -0
  10. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/entry_points.txt +2 -0
  11. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/requires.txt +8 -0
  12. agentic_stealth_browser-0.8.0/agentic_stealth_browser.egg-info/top_level.txt +11 -0
  13. agentic_stealth_browser-0.8.0/ai/__init__.py +0 -0
  14. agentic_stealth_browser-0.8.0/ai/ai_hooks.py +126 -0
  15. agentic_stealth_browser-0.8.0/audit/__init__.py +0 -0
  16. agentic_stealth_browser-0.8.0/audit/logger.py +449 -0
  17. agentic_stealth_browser-0.8.0/behavior/__init__.py +0 -0
  18. agentic_stealth_browser-0.8.0/behavior/adaptive_tuner.py +175 -0
  19. agentic_stealth_browser-0.8.0/behavior/human_behavior.py +825 -0
  20. agentic_stealth_browser-0.8.0/behavior/orchestration.py +141 -0
  21. agentic_stealth_browser-0.8.0/behavior/persona_rotator.py +380 -0
  22. agentic_stealth_browser-0.8.0/core/__init__.py +0 -0
  23. agentic_stealth_browser-0.8.0/core/account_health.py +309 -0
  24. agentic_stealth_browser-0.8.0/core/account_warming.py +315 -0
  25. agentic_stealth_browser-0.8.0/core/agent_browser.py +1676 -0
  26. agentic_stealth_browser-0.8.0/core/connection_pool.py +115 -0
  27. agentic_stealth_browser-0.8.0/core/error_messages.py +191 -0
  28. agentic_stealth_browser-0.8.0/core/py.typed +0 -0
  29. agentic_stealth_browser-0.8.0/core/session_checkpoint.py +354 -0
  30. agentic_stealth_browser-0.8.0/core/types.py +169 -0
  31. agentic_stealth_browser-0.8.0/docs/THREAT_MODEL.md +95 -0
  32. agentic_stealth_browser-0.8.0/docs/using-as-library.md +164 -0
  33. agentic_stealth_browser-0.8.0/examples/recipes/README.md +10 -0
  34. agentic_stealth_browser-0.8.0/examples/recipes/linkedin.md +5 -0
  35. agentic_stealth_browser-0.8.0/linkedin/__init__.py +5 -0
  36. agentic_stealth_browser-0.8.0/linkedin/actions.py +154 -0
  37. agentic_stealth_browser-0.8.0/production/Dockerfile +83 -0
  38. agentic_stealth_browser-0.8.0/production/__init__.py +7 -0
  39. agentic_stealth_browser-0.8.0/production/cli.py +240 -0
  40. agentic_stealth_browser-0.8.0/production/docker-compose.yml +45 -0
  41. agentic_stealth_browser-0.8.0/production/docker-healthcheck.py +14 -0
  42. agentic_stealth_browser-0.8.0/production/metrics.py +140 -0
  43. agentic_stealth_browser-0.8.0/production/otel_export.py +210 -0
  44. agentic_stealth_browser-0.8.0/production/rate_limiter.py +291 -0
  45. agentic_stealth_browser-0.8.0/proxy/__init__.py +0 -0
  46. agentic_stealth_browser-0.8.0/proxy/proxy_manager.py +369 -0
  47. agentic_stealth_browser-0.8.0/pyproject.toml +73 -0
  48. agentic_stealth_browser-0.8.0/recovery/__init__.py +0 -0
  49. agentic_stealth_browser-0.8.0/recovery/anti_block_orchestrator.py +791 -0
  50. agentic_stealth_browser-0.8.0/recovery/detectors.py +263 -0
  51. agentic_stealth_browser-0.8.0/recovery/explain_blocked.py +98 -0
  52. agentic_stealth_browser-0.8.0/scraping/__init__.py +0 -0
  53. agentic_stealth_browser-0.8.0/scraping/scraper.py +88 -0
  54. agentic_stealth_browser-0.8.0/sessions/__init__.py +0 -0
  55. agentic_stealth_browser-0.8.0/sessions/cookie_manager.py +823 -0
  56. agentic_stealth_browser-0.8.0/sessions/session_manager.py +283 -0
  57. agentic_stealth_browser-0.8.0/setup.cfg +4 -0
  58. agentic_stealth_browser-0.8.0/stealth/__init__.py +0 -0
  59. agentic_stealth_browser-0.8.0/stealth/advanced_stealth.py +487 -0
  60. agentic_stealth_browser-0.8.0/stealth/cache.py +160 -0
  61. agentic_stealth_browser-0.8.0/stealth/headers.py +42 -0
  62. agentic_stealth_browser-0.8.0/stealth/presets.py +279 -0
  63. agentic_stealth_browser-0.8.0/stealth/profiles.py +226 -0
  64. agentic_stealth_browser-0.8.0/stealth/tls_fingerprint.py +264 -0
  65. agentic_stealth_browser-0.8.0/stealth/tls_ja3_ja4.py +157 -0
  66. agentic_stealth_browser-0.8.0/tests/debug_nowsecure.py +117 -0
  67. agentic_stealth_browser-0.8.0/tests/detection_check.py +30 -0
  68. agentic_stealth_browser-0.8.0/tests/detection_runner.py +235 -0
  69. agentic_stealth_browser-0.8.0/tests/fingerprint_scorecard.py +306 -0
  70. agentic_stealth_browser-0.8.0/tests/run_detection_tests.py +39 -0
  71. agentic_stealth_browser-0.8.0/tests/test_account_health.py +239 -0
  72. agentic_stealth_browser-0.8.0/tests/test_account_warming.py +273 -0
  73. agentic_stealth_browser-0.8.0/tests/test_adaptive_tuner.py +116 -0
  74. agentic_stealth_browser-0.8.0/tests/test_basic.py +19 -0
  75. agentic_stealth_browser-0.8.0/tests/test_cdp_snapshots.py +116 -0
  76. agentic_stealth_browser-0.8.0/tests/test_connection_pool.py +154 -0
  77. agentic_stealth_browser-0.8.0/tests/test_contract_agent_browser.py +285 -0
  78. agentic_stealth_browser-0.8.0/tests/test_detectors.py +237 -0
  79. agentic_stealth_browser-0.8.0/tests/test_differential.py +120 -0
  80. agentic_stealth_browser-0.8.0/tests/test_docker_config.py +134 -0
  81. agentic_stealth_browser-0.8.0/tests/test_e2e_anti_block_recovery.py +227 -0
  82. agentic_stealth_browser-0.8.0/tests/test_e2e_protected_sites_placeholder.py +27 -0
  83. agentic_stealth_browser-0.8.0/tests/test_golden_master.py +120 -0
  84. agentic_stealth_browser-0.8.0/tests/test_human_behavior_fuzz.py +384 -0
  85. agentic_stealth_browser-0.8.0/tests/test_integration_modules.py +87 -0
  86. agentic_stealth_browser-0.8.0/tests/test_linkedin_actions.py +116 -0
  87. agentic_stealth_browser-0.8.0/tests/test_mcp_contract.py +151 -0
  88. agentic_stealth_browser-0.8.0/tests/test_mutation_stealth.py +163 -0
  89. agentic_stealth_browser-0.8.0/tests/test_persona_rotator.py +278 -0
  90. agentic_stealth_browser-0.8.0/tests/test_phase7_fixes.py +525 -0
  91. agentic_stealth_browser-0.8.0/tests/test_proxy_manager.py +259 -0
  92. agentic_stealth_browser-0.8.0/tests/test_recovery_phase1.py +223 -0
  93. agentic_stealth_browser-0.8.0/tests/test_session_checkpoint.py +332 -0
  94. agentic_stealth_browser-0.8.0/tests/test_stealth_cache.py +274 -0
  95. agentic_stealth_browser-0.8.0/tests/test_stealth_coverage.py +211 -0
  96. agentic_stealth_browser-0.8.0/tests/test_stealth_modules.py +369 -0
  97. agentic_stealth_browser-0.8.0/tests/test_stress_multi_account.py +160 -0
  98. agentic_stealth_browser-0.8.0/tests/test_tls_ja3_ja4.py +88 -0
@@ -0,0 +1,2 @@
1
+ STEALTH_REGION=japan
2
+ PROXY_URL=
@@ -0,0 +1,82 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Agentic Stealth Browser will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [Unreleased] — Phase 8 DX & Debug Release (2026-05)
11
+
12
+ ### Added — High-Value DX Features (closes #265, #273, #288, #281, #257, #297, #241 and many documentation issues)
13
+
14
+ - **Debug Mode (#265)**: `AgentBrowser(launch(debug=True))` now produces exact, machine-readable + human-pretty dumps of:
15
+ - TLS fingerprint (full ciphers, extensions, curves, signature algorithms, launch args)
16
+ - Exact HTTP headers sent to Playwright
17
+ - All stealth JS patches applied
18
+ - Full `debug_report(print_report=True)` and `stealth_debug_report()` in MCP
19
+ - Structured debug JSONL logs alongside normal audit trails (`AuditLogger` + `DebugReporter`)
20
+
21
+ - **"Explain Why Blocked" Analyzer (#273)**: New `explain_why_blocked()` + orchestrator integration + MCP `stealth_explain_blocked()`.
22
+ - Returns clear English explanation, root cause hypothesis, and **prioritized, copy-paste actionable recommendations**.
23
+ - LinkedIn/Amazon/Cloudflare-specific advice.
24
+ - Perfect companion to debug dumps when you hit a wall.
25
+
26
+ - **Platform Presets for 2026 (#288)**: `stealth/presets.py` + first-class support in `launch(preset=...)` and `apply_preset()`.
27
+ - `linkedin_2026` (P1 target): US TLS, heavy behavior, heavy warm-up, 6 retries, professional persona notes.
28
+ - `amazon_2026`, `upwork_2026`, `cloudflare_generic`, `general_high_stealth`.
29
+ - `stealth_list_presets()`, `stealth_apply_preset("linkedin_2026")`, MCP exposure.
30
+ - `build_launch_config_from_preset` for easy extension.
31
+
32
+ - **Status / Health Command (#281)**: `get_health_status()`, enhanced `stealth_status()`, `stealth_health()`.
33
+ - Launched state, current preset, TLS profile, recent blocks, cookie health, current URL, recovery stats.
34
+ - Immediately useful for operators, dashboards, and MCP consumers.
35
+
36
+ - **Quick-Start Notebook (#257)**: `examples/quick_start.ipynb` (created) with runnable cells covering:
37
+ - Basic launch, safe_goto, warm-up
38
+ - Debug mode + full fingerprint dump
39
+ - LinkedIn 2026 preset end-to-end
40
+ - explain_blocked + health checks
41
+ - MCP usage patterns
42
+
43
+ - **Changelog & Release Notes Experience (#297)**: This `CHANGELOG.md` + docs/THREAT_MODEL.md + improved README sections.
44
+ - Clear "Unreleased" section linking to closed issues.
45
+ - Future releases will follow the same format.
46
+
47
+ - **Security / Threat Model Documentation (#241)**: `docs/THREAT_MODEL.md`
48
+ - What the library actually defends against vs. limitations
49
+ - Operational security best practices for 2026
50
+ - Responsible use guidance
51
+
52
+ ### Changed / Improved
53
+ - `AgentBrowser.launch()` now accepts `debug`, `preset`, `region` — fully backwards compatible.
54
+ - MCP tools (`stealth-playwright-mcp/mcp_tools.py` + `stealth_mcp.py`) expose all new DX capabilities.
55
+ - `AuditLogger` extended with `enable_debug_mode()`, `log_debug_dump()`, `DebugReporter` class.
56
+ - Recovery orchestrator now produces richer logs when blocks occur.
57
+ - README updated with "Quick Start", "Debugging & Diagnostics", "Platform Presets 2026", "Health & Status", "MCP DX Tools".
58
+
59
+ ### Documentation
60
+ - Many [documentation] and [DX] issues addressed via the above + inline docstrings, preset notes, and threat model.
61
+
62
+ ---
63
+
64
+ ## [0.2.0] — 2026-05 (Phase 7 Reliability)
65
+
66
+ - Core context manager (`async with AgentBrowser()`) — #292
67
+ - Major bug fixes (BUG-01..05): rng, Page vs Context, page_getter for detection, rate limiter correctness
68
+ - Recovery integration improvements
69
+ - Test coverage for critical paths (`tests/test_phase7_fixes.py`)
70
+
71
+ ---
72
+
73
+ ## [0.1.0] — Initial Public Foundation (2026-05)
74
+
75
+ - First release of modular stealth + recovery + human behavior + TLS fingerprinting architecture.
76
+ - Basic AgentBrowser, AuditLogger, presets groundwork, MCP skill skeleton.
77
+
78
+ ---
79
+
80
+ [Unreleased]: https://github.com/shanewas/agentic-stealth-browser/compare/v0.2.0...HEAD
81
+ [0.2.0]: https://github.com/shanewas/agentic-stealth-browser/releases/tag/v0.2.0
82
+ [0.1.0]: https://github.com/shanewas/agentic-stealth-browser/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shane W
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include .env.example
5
+ include docs/THREAT_MODEL.md
6
+ include docs/using-as-library.md
7
+ recursive-include stealth *.js *.json
8
+ recursive-include production Dockerfile docker-healthcheck.py
9
+ recursive-include examples *.md
10
+ recursive-include tests *.py *.json
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-stealth-browser
3
+ Version: 0.8.0
4
+ Summary: Production-grade, human-mimicking browser automation framework for autonomous agents. Survives modern anti-bot systems.
5
+ Author-email: Shane W <shanewas@users.noreply.github.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/shanewas/agentic-stealth-browser
8
+ Project-URL: Repository, https://github.com/shanewas/agentic-stealth-browser
9
+ Project-URL: Issues, https://github.com/shanewas/agentic-stealth-browser/issues
10
+ Project-URL: Documentation, https://github.com/shanewas/agentic-stealth-browser/tree/master/docs
11
+ Project-URL: Changelog, https://github.com/shanewas/agentic-stealth-browser/blob/master/CHANGELOG.md
12
+ Keywords: stealth,browser,automation,playwright,anti-bot,scraping,agent
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
22
+ Classifier: Topic :: Software Development :: Testing
23
+ Classifier: Framework :: AsyncIO
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: playwright
28
+ Requires-Dist: aiohttp
29
+ Requires-Dist: cryptography
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-asyncio; extra == "dev"
33
+ Requires-Dist: pytest-cov; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # Agentic Stealth Browser
37
+
38
+ [![CI](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
40
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
41
+ [![Tests](https://img.shields.io/badge/tests-493%20passing-brightgreen)](tests/)
42
+
43
+ A Python framework that makes browser automation look human. Built for autonomous agents that need to navigate websites protected by Cloudflare, LinkedIn, Amazon, and other anti-bot systems.
44
+
45
+ ## Why This Exists
46
+
47
+ Standard browser automation (`page.goto()`, `page.click()`) gets detected instantly. This framework solves that by combining:
48
+
49
+ - **TLS fingerprint spoofing** — matches real browser TLS handshakes
50
+ - **Human behavior simulation** — natural mouse, typing, scrolling with realistic imperfections
51
+ - **Automatic recovery** — detects blocks (CAPTCHAs, rate limits) and recovers without crashing
52
+ - **Account lifecycle management** — warming, health scoring, cooling off
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install agentic-stealth-browser
58
+ playwright install --with-deps chromium
59
+ ```
60
+
61
+ ## Quick Start
62
+
63
+ ```python
64
+ from core.agent_browser import AgentBrowser
65
+ import asyncio
66
+
67
+ async def main():
68
+ browser = AgentBrowser(session_name="demo")
69
+ await browser.launch(headless=True)
70
+
71
+ # This handles stealth, human behavior, and recovery automatically
72
+ await browser.safe_goto("https://example.com")
73
+
74
+ # Add human-like actions
75
+ await browser.human.scroll_naturally(400)
76
+ await browser.human.think(1500, 2800)
77
+
78
+ await browser.close()
79
+
80
+ asyncio.run(main())
81
+ ```
82
+
83
+ ## Real-World Example
84
+
85
+ For protected sites, load real cookies and use a platform preset:
86
+
87
+ ```python
88
+ browser = AgentBrowser(session_name="linkedin")
89
+ await browser.launch(preset="linkedin_2026")
90
+ await browser.load_cookies_from_file("cookies.json")
91
+ await browser.warm_up_before_work(intensity="heavy")
92
+ await browser.safe_goto("https://www.linkedin.com/feed/", platform="linkedin")
93
+ ```
94
+
95
+ The flow: **cookies → warm-up → navigate → recover if blocked → act human**.
96
+
97
+ ## How It Works
98
+
99
+ ```
100
+ AgentBrowser
101
+ ├── Stealth → TLS profiles, canvas/WebGL spoofing, WebRTC isolation
102
+ ├── Behavior → Bézier mouse, natural typing, distraction simulation
103
+ ├── Recovery → Detects blocks → rotates proxy/session → retries
104
+ ├── Accounts → Health scoring, 14-day warming, session checkpointing
105
+ └── Proxy → Residential proxy with rotation and health tracking
106
+ ```
107
+
108
+ ## Key Features
109
+
110
+ | Feature | What It Does |
111
+ |---|---|
112
+ | **TLS Fingerprinting** | Region-specific profiles (US, Japan, EU, Korea) with JA3/JA4 support |
113
+ | **Human Behavior** | Mouse with wobble, typing with mistakes, variable scrolling, fatigue |
114
+ | **Auto Recovery** | Detects CAPTCHAs, rate limits, blocks — recovers automatically |
115
+ | **Account Warming** | 14-day gradual ramp-up so new accounts don't get flagged |
116
+ | **Session Checkpoints** | Export/import browser state for cross-host migration |
117
+ | **Platform Presets** | Pre-configured profiles for LinkedIn, Amazon, Cloudflare |
118
+ | **MCP Server** | Integration with AI agents via Model Context Protocol |
119
+
120
+ ## Configuration
121
+
122
+ ### Environment Variables
123
+
124
+ | Variable | Description | Default |
125
+ |---|---|---|
126
+ | `STEALTH_REGION` | TLS fingerprint region | `japan` |
127
+ | `STEALTH_HEADLESS` | Run browser headless | `true` |
128
+ | `STEALTH_PROXY` | Use residential proxy | `false` |
129
+
130
+ ### Platform Presets
131
+
132
+ ```python
133
+ await browser.launch(preset="linkedin_2026") # LinkedIn
134
+ await browser.launch(preset="amazon_2026") # Amazon
135
+ await browser.launch(preset="cloudflare") # Cloudflare-protected sites
136
+ ```
137
+
138
+ ## Project Structure
139
+
140
+ ```
141
+ agentic-stealth-browser/
142
+ ├── core/ # AgentBrowser main class
143
+ ├── stealth/ # TLS fingerprinting, script injection, caching
144
+ ├── behavior/ # Human-like mouse, typing, scrolling, personas
145
+ ├── recovery/ # Block detection, anti-block orchestrator
146
+ ├── proxy/ # Proxy management and rotation
147
+ ├── sessions/ # Session and cookie management
148
+ ├── audit/ # Structured logging and audit trails
149
+ ├── ai/ # AI hooks and content analysis
150
+ ├── production/ # CLI, Docker, rate limiting, metrics
151
+ ├── linkedin/ # LinkedIn-specific actions
152
+ ├── scraping/ # Safe page scraping utilities
153
+ ├── docs/ # Architecture Decision Records and guides
154
+ └── tests/ # 493 tests across 23 files
155
+ ```
156
+
157
+ ## Documentation
158
+
159
+ - [Architecture Decision Records](docs/adr/)
160
+ - [Visual Debugging Guide](docs/VISUAL_DEBUGGING.md)
161
+ - [Stealth Limitations](docs/STEALTH_LIMITATIONS.md)
162
+ - [Threat Model](docs/THREAT_MODEL.md)
163
+ - [Common Pitfalls](docs/COMMON_PITFALLS.md)
164
+ - [Rate Limiting & Backoff](docs/RATE_LIMITING_BACKOFF.md)
165
+ - [Cookie & Session Resilience](docs/COOKIE_SESSION_RESILIENCE.md)
166
+
167
+ ## Security
168
+
169
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting and best practices.
170
+
171
+ ## Responsible Use
172
+
173
+ This framework is designed for legitimate automation use cases such as:
174
+
175
+ - Testing your own applications and infrastructure
176
+ - Automating workflows on platforms that permit automation
177
+ - Research and security analysis
178
+ - Accessibility testing
179
+
180
+ **Important:** Many websites (including LinkedIn, Amazon, and others) prohibit automated access in their Terms of Service. Always:
181
+
182
+ 1. Review the target site's Terms of Service and robots.txt
183
+ 2. Obtain proper authorization before automating access
184
+ 3. Respect rate limits and avoid causing harm to services
185
+ 4. Use this tool responsibly and legally
186
+
187
+ This project is provided as-is under the MIT License. Users are responsible for complying with applicable laws and terms of service.
188
+
189
+ ## Contributing
190
+
191
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
192
+
193
+ ## License
194
+
195
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,160 @@
1
+ # Agentic Stealth Browser
2
+
3
+ [![CI](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
6
+ [![Tests](https://img.shields.io/badge/tests-493%20passing-brightgreen)](tests/)
7
+
8
+ A Python framework that makes browser automation look human. Built for autonomous agents that need to navigate websites protected by Cloudflare, LinkedIn, Amazon, and other anti-bot systems.
9
+
10
+ ## Why This Exists
11
+
12
+ Standard browser automation (`page.goto()`, `page.click()`) gets detected instantly. This framework solves that by combining:
13
+
14
+ - **TLS fingerprint spoofing** — matches real browser TLS handshakes
15
+ - **Human behavior simulation** — natural mouse, typing, scrolling with realistic imperfections
16
+ - **Automatic recovery** — detects blocks (CAPTCHAs, rate limits) and recovers without crashing
17
+ - **Account lifecycle management** — warming, health scoring, cooling off
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install agentic-stealth-browser
23
+ playwright install --with-deps chromium
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ ```python
29
+ from core.agent_browser import AgentBrowser
30
+ import asyncio
31
+
32
+ async def main():
33
+ browser = AgentBrowser(session_name="demo")
34
+ await browser.launch(headless=True)
35
+
36
+ # This handles stealth, human behavior, and recovery automatically
37
+ await browser.safe_goto("https://example.com")
38
+
39
+ # Add human-like actions
40
+ await browser.human.scroll_naturally(400)
41
+ await browser.human.think(1500, 2800)
42
+
43
+ await browser.close()
44
+
45
+ asyncio.run(main())
46
+ ```
47
+
48
+ ## Real-World Example
49
+
50
+ For protected sites, load real cookies and use a platform preset:
51
+
52
+ ```python
53
+ browser = AgentBrowser(session_name="linkedin")
54
+ await browser.launch(preset="linkedin_2026")
55
+ await browser.load_cookies_from_file("cookies.json")
56
+ await browser.warm_up_before_work(intensity="heavy")
57
+ await browser.safe_goto("https://www.linkedin.com/feed/", platform="linkedin")
58
+ ```
59
+
60
+ The flow: **cookies → warm-up → navigate → recover if blocked → act human**.
61
+
62
+ ## How It Works
63
+
64
+ ```
65
+ AgentBrowser
66
+ ├── Stealth → TLS profiles, canvas/WebGL spoofing, WebRTC isolation
67
+ ├── Behavior → Bézier mouse, natural typing, distraction simulation
68
+ ├── Recovery → Detects blocks → rotates proxy/session → retries
69
+ ├── Accounts → Health scoring, 14-day warming, session checkpointing
70
+ └── Proxy → Residential proxy with rotation and health tracking
71
+ ```
72
+
73
+ ## Key Features
74
+
75
+ | Feature | What It Does |
76
+ |---|---|
77
+ | **TLS Fingerprinting** | Region-specific profiles (US, Japan, EU, Korea) with JA3/JA4 support |
78
+ | **Human Behavior** | Mouse with wobble, typing with mistakes, variable scrolling, fatigue |
79
+ | **Auto Recovery** | Detects CAPTCHAs, rate limits, blocks — recovers automatically |
80
+ | **Account Warming** | 14-day gradual ramp-up so new accounts don't get flagged |
81
+ | **Session Checkpoints** | Export/import browser state for cross-host migration |
82
+ | **Platform Presets** | Pre-configured profiles for LinkedIn, Amazon, Cloudflare |
83
+ | **MCP Server** | Integration with AI agents via Model Context Protocol |
84
+
85
+ ## Configuration
86
+
87
+ ### Environment Variables
88
+
89
+ | Variable | Description | Default |
90
+ |---|---|---|
91
+ | `STEALTH_REGION` | TLS fingerprint region | `japan` |
92
+ | `STEALTH_HEADLESS` | Run browser headless | `true` |
93
+ | `STEALTH_PROXY` | Use residential proxy | `false` |
94
+
95
+ ### Platform Presets
96
+
97
+ ```python
98
+ await browser.launch(preset="linkedin_2026") # LinkedIn
99
+ await browser.launch(preset="amazon_2026") # Amazon
100
+ await browser.launch(preset="cloudflare") # Cloudflare-protected sites
101
+ ```
102
+
103
+ ## Project Structure
104
+
105
+ ```
106
+ agentic-stealth-browser/
107
+ ├── core/ # AgentBrowser main class
108
+ ├── stealth/ # TLS fingerprinting, script injection, caching
109
+ ├── behavior/ # Human-like mouse, typing, scrolling, personas
110
+ ├── recovery/ # Block detection, anti-block orchestrator
111
+ ├── proxy/ # Proxy management and rotation
112
+ ├── sessions/ # Session and cookie management
113
+ ├── audit/ # Structured logging and audit trails
114
+ ├── ai/ # AI hooks and content analysis
115
+ ├── production/ # CLI, Docker, rate limiting, metrics
116
+ ├── linkedin/ # LinkedIn-specific actions
117
+ ├── scraping/ # Safe page scraping utilities
118
+ ├── docs/ # Architecture Decision Records and guides
119
+ └── tests/ # 493 tests across 23 files
120
+ ```
121
+
122
+ ## Documentation
123
+
124
+ - [Architecture Decision Records](docs/adr/)
125
+ - [Visual Debugging Guide](docs/VISUAL_DEBUGGING.md)
126
+ - [Stealth Limitations](docs/STEALTH_LIMITATIONS.md)
127
+ - [Threat Model](docs/THREAT_MODEL.md)
128
+ - [Common Pitfalls](docs/COMMON_PITFALLS.md)
129
+ - [Rate Limiting & Backoff](docs/RATE_LIMITING_BACKOFF.md)
130
+ - [Cookie & Session Resilience](docs/COOKIE_SESSION_RESILIENCE.md)
131
+
132
+ ## Security
133
+
134
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting and best practices.
135
+
136
+ ## Responsible Use
137
+
138
+ This framework is designed for legitimate automation use cases such as:
139
+
140
+ - Testing your own applications and infrastructure
141
+ - Automating workflows on platforms that permit automation
142
+ - Research and security analysis
143
+ - Accessibility testing
144
+
145
+ **Important:** Many websites (including LinkedIn, Amazon, and others) prohibit automated access in their Terms of Service. Always:
146
+
147
+ 1. Review the target site's Terms of Service and robots.txt
148
+ 2. Obtain proper authorization before automating access
149
+ 3. Respect rate limits and avoid causing harm to services
150
+ 4. Use this tool responsibly and legally
151
+
152
+ This project is provided as-is under the MIT License. Users are responsible for complying with applicable laws and terms of service.
153
+
154
+ ## Contributing
155
+
156
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
157
+
158
+ ## License
159
+
160
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-stealth-browser
3
+ Version: 0.8.0
4
+ Summary: Production-grade, human-mimicking browser automation framework for autonomous agents. Survives modern anti-bot systems.
5
+ Author-email: Shane W <shanewas@users.noreply.github.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/shanewas/agentic-stealth-browser
8
+ Project-URL: Repository, https://github.com/shanewas/agentic-stealth-browser
9
+ Project-URL: Issues, https://github.com/shanewas/agentic-stealth-browser/issues
10
+ Project-URL: Documentation, https://github.com/shanewas/agentic-stealth-browser/tree/master/docs
11
+ Project-URL: Changelog, https://github.com/shanewas/agentic-stealth-browser/blob/master/CHANGELOG.md
12
+ Keywords: stealth,browser,automation,playwright,anti-bot,scraping,agent
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
22
+ Classifier: Topic :: Software Development :: Testing
23
+ Classifier: Framework :: AsyncIO
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: playwright
28
+ Requires-Dist: aiohttp
29
+ Requires-Dist: cryptography
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-asyncio; extra == "dev"
33
+ Requires-Dist: pytest-cov; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # Agentic Stealth Browser
37
+
38
+ [![CI](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/shanewas/agentic-stealth-browser/actions/workflows/ci.yml)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
40
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
41
+ [![Tests](https://img.shields.io/badge/tests-493%20passing-brightgreen)](tests/)
42
+
43
+ A Python framework that makes browser automation look human. Built for autonomous agents that need to navigate websites protected by Cloudflare, LinkedIn, Amazon, and other anti-bot systems.
44
+
45
+ ## Why This Exists
46
+
47
+ Standard browser automation (`page.goto()`, `page.click()`) gets detected instantly. This framework solves that by combining:
48
+
49
+ - **TLS fingerprint spoofing** — matches real browser TLS handshakes
50
+ - **Human behavior simulation** — natural mouse, typing, scrolling with realistic imperfections
51
+ - **Automatic recovery** — detects blocks (CAPTCHAs, rate limits) and recovers without crashing
52
+ - **Account lifecycle management** — warming, health scoring, cooling off
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install agentic-stealth-browser
58
+ playwright install --with-deps chromium
59
+ ```
60
+
61
+ ## Quick Start
62
+
63
+ ```python
64
+ from core.agent_browser import AgentBrowser
65
+ import asyncio
66
+
67
+ async def main():
68
+ browser = AgentBrowser(session_name="demo")
69
+ await browser.launch(headless=True)
70
+
71
+ # This handles stealth, human behavior, and recovery automatically
72
+ await browser.safe_goto("https://example.com")
73
+
74
+ # Add human-like actions
75
+ await browser.human.scroll_naturally(400)
76
+ await browser.human.think(1500, 2800)
77
+
78
+ await browser.close()
79
+
80
+ asyncio.run(main())
81
+ ```
82
+
83
+ ## Real-World Example
84
+
85
+ For protected sites, load real cookies and use a platform preset:
86
+
87
+ ```python
88
+ browser = AgentBrowser(session_name="linkedin")
89
+ await browser.launch(preset="linkedin_2026")
90
+ await browser.load_cookies_from_file("cookies.json")
91
+ await browser.warm_up_before_work(intensity="heavy")
92
+ await browser.safe_goto("https://www.linkedin.com/feed/", platform="linkedin")
93
+ ```
94
+
95
+ The flow: **cookies → warm-up → navigate → recover if blocked → act human**.
96
+
97
+ ## How It Works
98
+
99
+ ```
100
+ AgentBrowser
101
+ ├── Stealth → TLS profiles, canvas/WebGL spoofing, WebRTC isolation
102
+ ├── Behavior → Bézier mouse, natural typing, distraction simulation
103
+ ├── Recovery → Detects blocks → rotates proxy/session → retries
104
+ ├── Accounts → Health scoring, 14-day warming, session checkpointing
105
+ └── Proxy → Residential proxy with rotation and health tracking
106
+ ```
107
+
108
+ ## Key Features
109
+
110
+ | Feature | What It Does |
111
+ |---|---|
112
+ | **TLS Fingerprinting** | Region-specific profiles (US, Japan, EU, Korea) with JA3/JA4 support |
113
+ | **Human Behavior** | Mouse with wobble, typing with mistakes, variable scrolling, fatigue |
114
+ | **Auto Recovery** | Detects CAPTCHAs, rate limits, blocks — recovers automatically |
115
+ | **Account Warming** | 14-day gradual ramp-up so new accounts don't get flagged |
116
+ | **Session Checkpoints** | Export/import browser state for cross-host migration |
117
+ | **Platform Presets** | Pre-configured profiles for LinkedIn, Amazon, Cloudflare |
118
+ | **MCP Server** | Integration with AI agents via Model Context Protocol |
119
+
120
+ ## Configuration
121
+
122
+ ### Environment Variables
123
+
124
+ | Variable | Description | Default |
125
+ |---|---|---|
126
+ | `STEALTH_REGION` | TLS fingerprint region | `japan` |
127
+ | `STEALTH_HEADLESS` | Run browser headless | `true` |
128
+ | `STEALTH_PROXY` | Use residential proxy | `false` |
129
+
130
+ ### Platform Presets
131
+
132
+ ```python
133
+ await browser.launch(preset="linkedin_2026") # LinkedIn
134
+ await browser.launch(preset="amazon_2026") # Amazon
135
+ await browser.launch(preset="cloudflare") # Cloudflare-protected sites
136
+ ```
137
+
138
+ ## Project Structure
139
+
140
+ ```
141
+ agentic-stealth-browser/
142
+ ├── core/ # AgentBrowser main class
143
+ ├── stealth/ # TLS fingerprinting, script injection, caching
144
+ ├── behavior/ # Human-like mouse, typing, scrolling, personas
145
+ ├── recovery/ # Block detection, anti-block orchestrator
146
+ ├── proxy/ # Proxy management and rotation
147
+ ├── sessions/ # Session and cookie management
148
+ ├── audit/ # Structured logging and audit trails
149
+ ├── ai/ # AI hooks and content analysis
150
+ ├── production/ # CLI, Docker, rate limiting, metrics
151
+ ├── linkedin/ # LinkedIn-specific actions
152
+ ├── scraping/ # Safe page scraping utilities
153
+ ├── docs/ # Architecture Decision Records and guides
154
+ └── tests/ # 493 tests across 23 files
155
+ ```
156
+
157
+ ## Documentation
158
+
159
+ - [Architecture Decision Records](docs/adr/)
160
+ - [Visual Debugging Guide](docs/VISUAL_DEBUGGING.md)
161
+ - [Stealth Limitations](docs/STEALTH_LIMITATIONS.md)
162
+ - [Threat Model](docs/THREAT_MODEL.md)
163
+ - [Common Pitfalls](docs/COMMON_PITFALLS.md)
164
+ - [Rate Limiting & Backoff](docs/RATE_LIMITING_BACKOFF.md)
165
+ - [Cookie & Session Resilience](docs/COOKIE_SESSION_RESILIENCE.md)
166
+
167
+ ## Security
168
+
169
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting and best practices.
170
+
171
+ ## Responsible Use
172
+
173
+ This framework is designed for legitimate automation use cases such as:
174
+
175
+ - Testing your own applications and infrastructure
176
+ - Automating workflows on platforms that permit automation
177
+ - Research and security analysis
178
+ - Accessibility testing
179
+
180
+ **Important:** Many websites (including LinkedIn, Amazon, and others) prohibit automated access in their Terms of Service. Always:
181
+
182
+ 1. Review the target site's Terms of Service and robots.txt
183
+ 2. Obtain proper authorization before automating access
184
+ 3. Respect rate limits and avoid causing harm to services
185
+ 4. Use this tool responsibly and legally
186
+
187
+ This project is provided as-is under the MIT License. Users are responsible for complying with applicable laws and terms of service.
188
+
189
+ ## Contributing
190
+
191
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
192
+
193
+ ## License
194
+
195
+ MIT License. See [LICENSE](LICENSE) for details.