Skip to main content

baton is a local authentication broker for AI agents and MCP tools. It lets an agent use your GitHub, cloud, or API credentials without putting the secret value into its chat or tool output.

Save a credential once, group it into a context such as work, then give an agent a lease: a temporary pass that can expire or be revoked. baton uses the credential for a command or HTTP request and hides known secrets in the result.

Try it

Requires Python 3.10+ and uv. Install baton-auth from PyPI:

uv tool install baton-auth

baton cred add gh-work --provider github --field token --context work

baton run work -- gh api /user
baton http work https://api.github.com/user
baton lease new work --ttl 600 --uses 20
baton setup  # prints MCP config for an agent client

The bare --field token prompts privately. Commands run with a temporary HOME containing that context's CLI settings.

baton setup --client CLIENT connects Codex, Claude Code, Cursor, VS Code, Muse Code, or Hermes Agent. baton setup prints portable MCP config for other clients. Agents with command access can use baton run or baton http.

Cryptography at a glance

Name How baton uses it
AES-256-GCM-SIV; ChaCha20-Poly1305 fallback Encrypts credentials in the local vault.
BLAKE3 Derives separate keys, authenticates leases and vault records, and links audit entries.
Argon2id Turns a passphrase into the vault key when passphrase mode is used.
HMAC-SHA-256 Signs AWS requests using Signature Version 4.

Learn more

  • User guide — contexts, leases, providers, refresh, and MCP tools.
  • Security and limits — what baton protects, how it stores secrets, and where its boundary ends.

The distribution is named baton-auth and also provides the baton-auth command. The Python import is baton_auth.

baton runs locally for one user on one machine. A temporary HOME keeps CLI configuration separate; it is not a full operating-system sandbox.

Metadata

Release files for baton-auth 0.1.4

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.4
File Size Uploaded Provenance Actions
baton_auth-0.1.4.tar.gz 153.7 kB Without provenance Details for baton_auth-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 197.1 kB

Release files / baton_auth-0.1.4.tar.gz

Download URL baton_auth-0.1.4.tar.gz
Size 153.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f713c1adaba4f544d29c68ba59d89fe5376c33ea78c973f49033527dfcf31ecb
BLAKE2b-256 checksum
How to use checksums
01d51ca3c522d64ecdecdb6459c31d529754c78a8ec9f0f4c54610b88a5c560f
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":"24.04","id":"noble","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.4-py3-none-any.whl

Download URL baton_auth-0.1.4-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
856ad67746f4e7abcfb0dfc3a78805e0ce48856ae3695529eb4aeffeac3f6a58
BLAKE2b-256 checksum
How to use checksums
5d05a68af7059842a33e5eb58c6ebdc3fcf98b723e95d7b761857bf6f541e673
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":"24.04","id":"noble","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.4

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