Skip to main content

AgentKey for Python

30-second auth for AI agents. Works on Windows, macOS and Linux (Python 3.9+).

pip install "tryagentkey[playwright]"
from tryagentkey import agentkey
ak = agentkey()
ak.login("https://github.com/login", page=page)   # sync or async Playwright
  • Free Local Mode (default): a local Approve page opens the first time; the login is locked on this computer in ~/.agentkey/vault.enc (shared with the JS SDK). No website cookies are saved.
  • Permissions: each approval covers one site, one saved login, this project folder and this agent name ("until revoked" or "only this time"). Valid permissions are reused without asking; tryagentkey permissions / tryagentkey revoke <id|site|--all> manage them.
  • Positive confirmation: signed_in is only true with evidence (your verify, success_selector, or a visible sign-out control on a nonblank page without a login form or challenge). Blank or unsupported pages return failed; an unconfirmed submit returns unverified and is never retried.
  • Cloud mode: set AGENTKEY_API_KEY (from npx tryagentkey link). The same one call does it all: trust this browser once, owner approval link, fill in your page, confirm. Paid plans sync across iPhone, web and Chrome.
  • MCP: uvx --from tryagentkey tryagentkey-mcp (or npx -y @tryagentkey/mcp).
  • CLI: tryagentkey status, tryagentkey doctor, tryagentkey permissions, tryagentkey revoke, tryagentkey secret set NAME VALUE.
  • Starters in examples/: Playwright, LangChain, CrewAI, OpenAI Agents, browser-use.

Your agent and model never receive the password.

Local host trust and login evidence

Free Local Mode trusts the code and OS account that run the SDK. It keeps saved website passwords out of public login results and the normal vault facade, but is not a sandbox against arbitrary code in that process or OS account. Its local key is stored beside encrypted vault data; hostname binding is not a secret. Use a separately trusted runtime/OS principal when the calling program itself must not be able to read credentials. Do not give untrusted model-generated code access to the SDK process, its files, browser connection, or execution account.

A navigation away from a login page never proves sign-in. Supply a site-specific account verifier or authenticated success selector when possible. Without one, the generic fallback requires a visible sign-out control on a nonblank page without a login form or challenge. This generic signal does not identify which account signed in; verify the account identity before account-sensitive work.

Metadata

Release files for tryagentkey 0.5.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 tryagentkey 0.5.0
File Size Uploaded Provenance Actions
tryagentkey-0.5.0.tar.gz 32.1 kB Without provenance Details for tryagentkey-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tryagentkey 0.5.0
File Interpreter ABI Platform Actions
tryagentkey-0.5.0-py3-none-any.whl Python 3 none any Details for tryagentkey-0.5.0-py3-none-any.whl

Total release size: 64.2 kB

Release files / tryagentkey-0.5.0.tar.gz

Download URL tryagentkey-0.5.0.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
76820b3501d464be3aadd2f774719ce969ebb68ff0b5ff9578637c7920075c2e
BLAKE2b-256 checksum
How to use checksums
3af203391b543ca1e2a8eb46d1e4f4fa64e5a25c4cb103ebad730eab9d69d527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / tryagentkey-0.5.0-py3-none-any.whl

Download URL tryagentkey-0.5.0-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
794b367fedbe2a73a15e1cb339c1d467a7dad9f31917788cb9f075a338dfc777
BLAKE2b-256 checksum
How to use checksums
87390be1d282a58a9c289ab202b4609e31acb7734d4af97a57eacfc275c32326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for tryagentkey 0.5.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files No provenance

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