Skip to main content
AgentAuth

AgentAuth

Persistent auth for AI agents. Works on any site, today.

No website integration required. No OAuth adoption needed. Just secure session management that works.

License: MIT PyPI version Python 3.8+ Dev.to

Quick StartLangChainn8nHow It WorksRoadmap


The Problem

# What every agent developer does today
cookies = {"session_id": "abc123..."}  # Hardcoded. Breaks constantly. Security nightmare.

Sessions expire. Cookies leak into git history. No audit trail. No access control.

The Solution

from agent_auth import Vault

vault = Vault()
cookies = vault.get_session("linkedin.com")  # Encrypted. Scoped. Audited.
pip install agentauth-py

Works on sites as they exist today. No website changes. No OAuth adoption. No waiting for the ecosystem.


See It In Action

One command to grab cookies from Chrome

Agent automatically authenticates using stored session—no manual login, no hardcoded cookies.


How It Works

  1. Log into any site in Chrome (you probably already are)
  2. Run agent-auth grab <domain> — cookies are encrypted and stored locally
  3. Your agent retrieves them securely on-demand

No extension required. No copy-paste. One command.


Quick Start

pip install agentauth-py
agent-auth grab linkedin.com

That's it. Your LinkedIn session is now stored in an encrypted vault.

The grab command reads cookies directly from Chrome—no extension needed, no manual export.

from agent_auth import Vault

vault = Vault()
cookies = vault.get_session("linkedin.com")

# Use with requests, Playwright, or any HTTP library
import requests
response = requests.get("https://linkedin.com/feed", cookies=cookies)

Works with any site you're logged into:

agent-auth grab github.com
agent-auth grab notion.so
agent-auth grab twitter.com

Multiple Chrome Profiles

If you use multiple Chrome profiles, specify which one to grab from:

agent-auth grab linkedin.com --profile "Profile 1"
agent-auth grab github.com --profile "Work"

To find your profile names:

# Mac
ls ~/Library/Application\ Support/Google/Chrome/

# Linux
ls ~/.config/google-chrome/

# Windows
dir %LOCALAPPDATA%\Google\Chrome\User Data\

Default profile is used if no --profile flag is specified.


☁️ Remote Servers (VPS / Headless / Docker)

Running n8n or scripts on a server without Chrome? Sync your local session:

On your local machine:

agent-auth grab linkedin.com
agent-auth export

Copy to server:

scp ~/.agent-auth/vault-export.enc user@your-server:~/

On your server:

pip install agentauth-py
agent-auth import ~/vault-export.enc

Your server can now access your authenticated sessions.


Why AgentAuth?

Without AgentAuth With AgentAuth
Hardcoded cookies in code Encrypted vault storage
Sessions in git history Secrets separate from code
Any code can access anything Scoped access per agent
No idea what accessed what Full audit logging
Sessions break silently Expiration notifications

LangChain Integration

from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent, AgentType
from agent_auth.langchain import get_agentauth_tools

tools = get_agentauth_tools(
    agent_name="sales-bot",
    vault_password="your-vault-password"  # Password auto-retrieved from system keyring if not provided
)

llm = ChatOpenAI(model="gpt-4", temperature=0)
agent = initialize_agent(
    tools=tools,
    llm=llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)

# Agent automatically uses stored sessions
response = agent.run("Get my LinkedIn notifications")

Available tools:

  • authenticated_request — Make HTTP requests with stored session cookies
  • get_session_cookies — Retrieve cookies for custom requests

n8n Integration

Use AgentAuth in your n8n workflows with our community node.

npm install n8n-nodes-agentauth

The node lets you:

  • Store and retrieve session cookies in n8n workflows
  • Use authenticated sessions with HTTP Request nodes
  • Build automation flows that require login

📦 View on npm | GitHub


Playwright Integration

from playwright.sync_api import sync_playwright
from agent_auth import Vault

vault = Vault()
cookies = vault.get_session("github.com")

with sync_playwright() as p:
    browser = p.chromium.launch()
    context = browser.new_context()
    context.add_cookies(cookies)
    
    page = context.new_page()
    page.goto("https://github.com/notifications")
    # Already authenticated!

CLI Reference

Command Description
agent-auth grab <domain> Grab cookies from Chrome
agent-auth grab <domain> --profile "Name" Grab from specific Chrome profile
agent-auth list List all stored sessions
agent-auth delete <domain> Delete a stored session
agent-auth refresh <domain> Re-grab cookies for a domain
agent-auth export Export vault for remote server
agent-auth import <file> Import vault on remote server
agent-auth version Show current version
agent-auth status Check vault health and stats

Security

  • AES-256 encryption with PBKDF2 key derivation (100k iterations)
  • Ed25519 keypairs for agent identity
  • Scoped access — agents only access approved domains
  • Audit logging — every access logged with timestamp
  • SQLite storage — encrypted database at ~/.agent-auth/vault.db

Roadmap

  • Chrome extension for cookie export
  • Encrypted local vault
  • Direct Chrome cookie extraction (agent-auth grab)
  • Playwright integration
  • LangChain integration
  • n8n integrationn8n-nodes-agentauth
  • Firefox extension
  • Selenium examples
  • Cloud vault sync

Examples

Working demos available in the examples/ folder.

GitHub Agent Demo

Setup:

# 1. Create the agent
agent-auth create-agent github-agent --scopes github.com

# 2. Export cookies from github.com using Chrome extension

# 3. Add the session
agent-auth add github.com

Run:

PYTHONPATH=. python examples/github_agent.py

Contributing

PRs welcome. Check out the issues for feature requests.


License

MIT

Star us if AgentAuth helps your agents authenticate!

Release files for agentauth-py 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentauth-py 0.3.0
File Size Uploaded
agentauth_py-0.3.0.tar.gz 23.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentauth-py 0.3.0
File Interpreter ABI Platform
agentauth_py-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / agentauth_py-0.3.0.tar.gz

Download URL agentauth_py-0.3.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
322e92132aa8857d67d011eb8aeca7e0697e4f19e5ff1053a1d0c291f29d258a
BLAKE2b-256 checksum
How to use checksums
923fcc80e01a900c15366d3fc451ab9e4ac6ad6908153e0be1bec6119ef7c39a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / agentauth_py-0.3.0-py3-none-any.whl

Download URL agentauth_py-0.3.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f95f6bc26a355e77cafe845219f1421a2b10b44a6b0f194d2ef1ce02be4d8081
BLAKE2b-256 checksum
How to use checksums
2adbf46a688d1f3aaeaa56b0f5a748955519a4d57341b4c743df867ad93cbb08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page