Skip to main content
baton — Pass the baton, never the secret. Authentication for agents through CLI, MCP, and remote HTTPS.

Package CI PyPI version Python 3.10 and newer

Try it  ·  How it works  ·  Remote agents  ·  User guide  ·  Security

One place for the credentials your agents need. Baton is a local auth broker for AI agents and MCP tools. It runs commands and API requests with the right credentials, then redacts known secrets from what comes back.

How it works

Store credentials in an encrypted vault. Grant scoped, expiring access. Use it for commands or HTTPS requests, with known secrets redacted from results.

A credential is a saved token, password, or key. A context bundles the credentials for a job. A lease gives an agent temporary access, limited by service, expiry, and use count.

Try it

Requires Python 3.10+ and uv.

uv tool install baton-auth

baton add github                    # prompts privately for your token
baton run github -- gh api /user     # use it through your existing CLI
baton http https://api.github.com/user

baton setup --auto                  # connect detected MCP clients

Already signed in? baton import imports supported local logins, including GitHub, AWS, and npm. Commands run in your working directory with a temporary HOME containing the permitted CLI settings.

Give an agent a short-lived pass

lease=$(baton lease new github --ttl 600 --uses 20)
baton run "$lease" -- gh api /user

Revoke access with baton lease revoke LEASE_ID. See the user guide for contexts, service limits, and credential refresh.

Connect your client

baton setup --auto detects Cursor, Claude Desktop, Windsurf, Zed, VS Code, Muse Code, and Hermes Agent. You can also choose a client:

baton setup --client codex
baton setup --client claude-code
baton setup --client cursor

For another MCP client, baton setup prints portable config JSON. Agents with command access can use baton run and baton http directly. Setup details →

Hand work to another agent

Pair agents on different machines with one broker. Each keeps its own private key; credentials stay at the broker. An agent accepts a grant, uses the permitted HTTPS APIs, and can pass narrower access plus a task summary to another paired agent.

Set up remote pairing and handoffs →

Remote access is for HTTPS APIs. Shell commands and credential administration stay local.

Under the hood
Purpose Construction
Encrypted credentials AES-256-GCM-SIV, with a ChaCha20-Poly1305 fallback
Key derivation, authentication, and audit chain BLAKE3
Passphrase-derived vault keys Argon2id
AWS request signing HMAC-SHA-256 / Signature Version 4

The vault stays on the broker machine. A temporary HOME separates CLI settings; it is not a full operating-system sandbox. Redaction covers known values and token patterns, not every possible encoding. Security and limits →


User guide · Security and limits · Remote guide · Releases

Package: baton-auth · Command: baton (or baton-auth) · Python: baton_auth

Metadata

Release files for baton-auth 0.1.9

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

Source distribution (sdist)

Source distribution for baton-auth 0.1.9
File Size Uploaded Provenance Actions
baton_auth-0.1.9.tar.gz 211.3 kB Without provenance Details for baton_auth-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for baton-auth 0.1.9
File Interpreter ABI Platform Actions
baton_auth-0.1.9-py3-none-any.whl Python 3 none any Details for baton_auth-0.1.9-py3-none-any.whl

Total release size: 287.1 kB

Release files / baton_auth-0.1.9.tar.gz

Download URL baton_auth-0.1.9.tar.gz
Size 211.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dfa0760557fe43a27bed7bf993d0b991e61338e031353501974eb56642d78bbc
BLAKE2b-256 checksum
How to use checksums
3a65d8d200b538ae2e953954302b76eae5b618b38c216de74444afe0e9ecd2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / baton_auth-0.1.9-py3-none-any.whl

Download URL baton_auth-0.1.9-py3-none-any.whl
Size 75.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6966be40cb5d21eb49a44ee43f68c3c610122ab03bbc3b8907e2b9d0fad7598
BLAKE2b-256 checksum
How to use checksums
042f56315a6f41459707adaa0f74fdf75b8018d688ba87908e1e8712960854a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for baton-auth 0.1.9

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.

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