Skip to main content

AuthSec Python SDK vNext

Preview Python SDK for AuthSec bearer-first MCP authentication, RBAC, service access, CIBA, delegation, and SPIFFE integrations.

Install

From PyPI:

pip install authsec-sdk-vnext

For local SDK development:

cd packages/python-sdk
pip install -e ".[dev]"

Recommended Setup Flow

The default user flow is:

pip install authsec-sdk-vnext
authsec init

authsec init writes .authsec.json in the current working directory. If you choose the default setup path, it writes these prod endpoints:

  • https://prod.api.authsec.ai/sdkmgr/mcp-auth
  • https://prod.api.authsec.ai/sdkmgr/services
  • https://prod.api.authsec.ai

Use authsec config show to verify the saved configuration.

If you need localhost, staging, or self-hosted AuthSec, choose the custom path in authsec init or set explicit environment overrides.

Team Knowledge Base Flow

The intended acceptance flow matches the protected Team Knowledge Base example:

  1. pip install authsec-sdk-vnext
  2. authsec init
  3. Run your protected MCP server
  4. Confirm startup logs show the prod AuthSec endpoints by default

When the app name is Team Knowledge Base (Protected), the expected startup output is:

Auth configured: Team Knowledge Base (Protected) with client_id: 921c2209...
Auth service URL: https://prod.api.authsec.ai/sdkmgr/mcp-auth
Services URL: https://prod.api.authsec.ai/sdkmgr/services
Starting Team Knowledge Base (Protected) MCP Server on 0.0.0.0:3005
Authentication via: https://prod.api.authsec.ai/sdkmgr/mcp-auth
Services via: https://prod.api.authsec.ai/sdkmgr/services
SPIRE Workload Identity: DISABLED

Example Server

This package includes a Python MCP demo at examples/local_authsec_demo_server.py.

Run it like this:

cd packages/python-sdk-vnext
authsec init
set -a
source examples/local_authsec_demo.env.example
set +a
python examples/local_authsec_demo_server.py

By default, the example relies on .authsec.json created by authsec init. Only set AUTHSEC_AUTH_SERVICE_URL or AUTHSEC_SERVICES_URL if you intentionally want to override the prod defaults.

Testing

Install the dev extras and run tests:

cd packages/python-sdk-vnext
pip install -e ".[dev]"
pytest tests/test_config_flow.py

The existing integration tests that point at localhost remain explicit local-service tests; they are not the default user path.

Maintainer Release Flow

Build and verify locally:

cd packages/python-sdk-vnext
python -m build
python -m twine check dist/*

Smoke test the built artifact in a fresh virtualenv:

python -m venv /tmp/authsec-sdk-smoke
source /tmp/authsec-sdk-smoke/bin/activate
pip install /absolute/path/to/packages/python-sdk-vnext/dist/authsec_sdk_vnext-<version>-py3-none-any.whl
authsec init

Publish with token-based Twine auth supplied via environment variables or .pypirc, then verify in a fresh virtualenv with:

pip install authsec-sdk-vnext
authsec init

Metadata

Release files for authsec-sdk-vnext 4.2.2

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

Source distribution (sdist)

Source distribution for authsec-sdk-vnext 4.2.2
File Size Uploaded Provenance
authsec_sdk_vnext-4.2.2.tar.gz 52.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for authsec-sdk-vnext 4.2.2
File Interpreter ABI Platform
authsec_sdk_vnext-4.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 95.3 kB

Release files / authsec_sdk_vnext-4.2.2.tar.gz

Download URL authsec_sdk_vnext-4.2.2.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
35939e484097dcc2f53df8327cea32a58bc897831619c339de7eed78fe2e9727
BLAKE2b-256 checksum
How to use checksums
7ff3fe7594cb30461a15476a0000badbc422168e8122fce1a071858da3e8eaa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Release files / authsec_sdk_vnext-4.2.2-py3-none-any.whl

Download URL authsec_sdk_vnext-4.2.2-py3-none-any.whl
Size 42.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a9cb947d944277ae86e7d9ca92e0964b8c52272a5e5c704c39732aab05f98f4
BLAKE2b-256 checksum
How to use checksums
387655c34256b9876d19564825cc7778600866e09355d8ade8bfb7bdd4efdfb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Security for authsec-sdk-vnext 4.2.2

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