authloop
Python SDK for AuthLoop — human-in-the-loop authentication for AI agents.
When your browser agent (Playwright, Stagehand, Browser Use, OpenClaw, any CDP runtime) hits an auth wall it cannot solve — an SMS OTP, a behavioral CAPTCHA, a password prompt, a security question, an ID upload — the agent stops. AuthLoop replaces that stop with a 30-second handoff: the agent calls to_human(), the live tab streams to the user's phone, the user resolves the wall directly, and the agent continues. Credentials never touch our servers.
Install
pip install authloop
Usage
from authloop import AuthLoop
authloop = AuthLoop(api_key="al_live_...")
# When your agent hits an auth wall:
session = await authloop.to_human(
service="HDFC NetBanking",
cdp_url="ws://localhost:9222",
context={"wall_type": "sms_otp", "hint": "OTP sent to ****1234"},
)
# Send session.session_url to the human (Telegram, Slack, etc.)
# Wait for the human to resolve it:
result = await authloop.wait_for_resolution(session.session_id)
# result.status == "RESOLVED" → agent continues
API
AuthLoop(api_key, base_url=None, runtime="other")
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
str |
yes | API key from authloop.ai/dashboard |
base_url |
str |
no | Override API base URL (default: https://api.authloop.ai) |
runtime |
Runtime |
no | Runtime hint reported on every audit event. One of: "playwright", "stagehand", "browser-use", "mcp", "openclaw", "other". Default "other". |
await authloop.to_human(...)
Creates a session and loops the auth to a human. Returns a ToHumanResult with session_id, session_url, stream_token, stream_url, expires_at.
| Parameter | Type | Required | Description |
|---|---|---|---|
service |
str |
yes | Human-readable service name shown on the session page (e.g. "HDFC NetBanking") |
cdp_url |
str |
yes | CDP endpoint — HTTP or WebSocket URL |
ttl |
int |
no | Session timeout in seconds (default 600) |
context |
dict |
no | {"url": ..., "wall_type": ..., "hint": ...} |
wall_type is one of: "sms_otp", "email_otp", "totp", "password", "image_captcha", "behavioral_captcha", "security_question", "document_upload", "other".
await authloop.get_session(session_id)
Returns current session status: PENDING, ACTIVE, RESOLVED, TIMEOUT, ERROR, or CANCELLED.
await authloop.resolve_session(session_id)
Marks a session as resolved.
await authloop.cancel_session(session_id)
Cancels a session.
await authloop.wait_for_resolution(session_id, poll_interval=3.0, timeout=600.0)
Polls until the session reaches a terminal state. Returns the final SessionStatus.
Webhooks
AuthLoop fires a session.created webhook the moment you call to_human() so you can wake up 2am jobs, page on-call, or post to chat. Configure endpoints, view delivery logs, and grab the verify snippet from your dashboard → Webhooks.
Get an API Key
Sign up at authloop.ai — 50 free auth assists, no credit card required.
License
MIT
Metadata
Release files for authloop 0.1.0
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 | |
|---|---|---|---|---|
| authloop-0.1.0.tar.gz | 8.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| authloop-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.2 kB
Release files / authloop-0.1.0.tar.gz
| Download URL | authloop-0.1.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4a6c16e1ecef14c2940a04d9c7d31d1958bb74afc8b39e95fab356d81705421
|
|
BLAKE2b-256 checksum How to use checksums |
37a9fc8dd175b73e7a379518c679082faa9638392be7962c94a7da19ec988c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / authloop-0.1.0-py3-none-any.whl
| Download URL | authloop-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8ae1525a35ba71927498a234ab365f33b3ceeb342d1654c96b44ac35c44dde2
|
|
BLAKE2b-256 checksum How to use checksums |
115b02f5bf6dd8285c542f944dc7066166fc4a310709f1fdf2daf3d1a5625721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for authloop 0.1.0
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.