Steadfast
Browser agents that don't lose their sessions.
Steadfast is a Python library for running headless-browser automation across multiple accounts and platforms — with anti-detection, session persistence, and per-account isolation built in.
⚠️ Status: pre-alpha. APIs may shift before v0.1.0. Pin a commit if you depend on this in production today.
Why Steadfast?
Every browser-agent platform — Stagehand, Browser Use, Skyvern, Anchor Browser, Hyperbrowser — has the same #1 customer complaint:
"My agent gets logged out every 4 hours."
That's a solved problem. Steadfast solves it like this:
| Feature | Steadfast | Vanilla Playwright | Stagehand / Browser Use |
|---|---|---|---|
| Per-account fingerprint isolation | ✅ | ❌ | partial |
| Anti-detect init scripts built in | ✅ | ❌ | partial |
| Cookie import from browser extension | ✅ | manual | manual |
| Session capture via VNC (manual login) | ✅ | ❌ | ❌ |
| Session persistence across runs | ✅ | manual | partial |
| Sticky viewport + UA + proxy per account | ✅ | manual | ❌ |
| Old-reddit + new-reddit auto-fallback | ✅ | ❌ | ❌ |
Quickstart
pip install steadfast-browser # dist name on PyPI
playwright install chromium
Note on the name: the package is installed as
steadfast-browseron PyPI (the baresteadfastname was taken by an unrelated 2023 package), but it imports assteadfast— sopip install steadfast-browser, thenfrom steadfast import ...in your code.
import asyncio
from pathlib import Path
from steadfast import AntiDetect, BrowserManager, BrowserManagerConfig
from steadfast.platforms import Twitter
async def main():
bm = BrowserManager(
BrowserManagerConfig(profiles_dir=Path("./profiles")),
AntiDetect(),
)
await bm.start()
twitter = Twitter(bm, account_key="my_twitter")
await twitter.import_cookies(open("twitter_cookies.json").read())
assert await twitter.ensure_logged_in()
result = await twitter.post("Hello from Steadfast!")
print(result.url)
await bm.shutdown()
asyncio.run(main())
That's it. No login flow, no captcha solver, no session-expiry handling in your code. The cookies you imported keep working for weeks.
What's in v0.1.0
Platforms
| Platform | Auth | Post | Reply / Comment | Like / Upvote | Health check |
|---|---|---|---|---|---|
| Twitter / X | cookies / login | ✅ | ✅ | ✅ | ✅ |
| cookies / login | ✅ | ✅ (comment) | ✅ | ✅ | |
| cookies / login | ✅ | ✅ (comment) | ✅ (upvote) | ✅ |
Core library
BrowserManager— Playwright pool with per-account contexts, concurrency limits, lifecycle helpers.AntiDetect— sticky proxies, sticky user agents, sticky viewports, human-like delays + clicks + typing, plus anti-automation init scripts injected into every context.RemoteDisplay— optional virtual-display + VNC server for manual-login flows on headless servers.PostResult— slotted dataclass returned by every post/reply/comment.
Exception hierarchy
SteadfastError
├── BrowserError # Playwright launch / context creation
├── ProxyError # proxy pool issues
└── PlatformError # base for platform-specific errors
├── LoginFailed
├── RateLimited
└── AccountSuspended
Examples
See examples/ for runnable scripts:
| # | File | Demonstrates |
|---|---|---|
| 1 | 01_twitter_post.py | Simplest possible post |
| 2 | 02_linkedin_with_cookies.py | Cookie import + post (recommended auth pattern) |
| 3 | 03_reddit_comment.py | old.reddit / new.reddit auto-fallback |
| 4 | 04_session_save_restore.py | Sessions survive BrowserManager restart |
| 5 | 05_multi_account.py | Two accounts running concurrently on one BM |
Documentation
- Getting started — install, first run, troubleshooting
- Auth & sessions — the wedge, explained
- Anti-detection — what's in the init script and why
Why an open-core SaaS exists
The library above runs anywhere. But running it at scale — many tenants, each with many accounts, with observability, retries, scheduling, and session-rescue automation — is operational work most engineers don't want to write.
The hosted version of Steadfast does that part, billed monthly. More info at (coming soon).
Project layout
steadfast/
__init__.py # public exports
browser_manager.py # Playwright pool
anti_detect.py # proxies, UAs, viewports, human-like helpers
exceptions.py # error hierarchy
remote_display.py # Xvfb + x11vnc for manual-login flows
_log.py # KV-rendering logging adapter
utils.py # small helpers (utcnow, async_retry, ...)
platforms/
twitter.py
linkedin.py
reddit.py
_models.py # PostResult dataclass
tests/ # 85 tests, < 1s to run
examples/ # 5 runnable scripts
docs/ # mkdocs site
Contributing
Bug reports + PRs welcome on GitHub. Before submitting:
pip install -e ".[dev]"
ruff check steadfast/ tests/
pytest -q
The full test suite runs in under one second and doesn't require launching a real browser — most of the real-browser code paths are tested via the examples on real platforms.
License
Apache 2.0 with Commons Clause — see LICENSE.
You can use Steadfast for any commercial or non-commercial purpose, including paid client work. You can't host it as a competing SaaS product. If that's what you want, contact us at hello@steadfast.dev about a commercial license.
Metadata
Release files for steadfast-browser 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| steadfast_browser-0.1.1.tar.gz | 72.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| steadfast_browser-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 141.3 kB
Release files / steadfast_browser-0.1.1.tar.gz
| Download URL | steadfast_browser-0.1.1.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f471bb3d5f94a999b2cadc2a725e9cbbd5910de8d7164d39b1d5718c9ea1bc6e
|
|
BLAKE2b-256 checksum How to use checksums |
79cb4ed14ff74b35368845850874c62b24015edab0a8e91820d08d72c1a1b3ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / steadfast_browser-0.1.1-py3-none-any.whl
| Download URL | steadfast_browser-0.1.1-py3-none-any.whl |
|---|---|
| Size | 68.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55931dfa4d899037264af8d5419f92aaa0d3c2ea975cced58bb054976be1499c
|
|
BLAKE2b-256 checksum How to use checksums |
f9f910e0fdaa9a9561ba613eb457432bad0cc35c68875df6e52ff880a5ba5a34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for steadfast-browser 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.