Skip to main content

MLflow Secrets Auth

A secure MLflow plugin that automatically injects authentication headers from secret management systems into tracking requests.

CI/CD Pipeline Coverage PyPI version Python versions License

Features

  • Zero Code Changes: Works transparently with existing MLflow applications
  • Multiple Providers: HashiCorp Vault, AWS Secrets Manager, Azure Key Vault
  • Security First: Host allowlisting, credential redaction, in-memory caching only
  • Production Ready: Automatic retries, TTL-based caching, comprehensive logging

Quick Start

# Install with your preferred provider
pip install mlflow-secrets-auth[vault]

# Configure for HashiCorp Vault
export VAULT_ADDR="https://vault.company.com"
export VAULT_TOKEN="your-vault-token"
export MLFLOW_VAULT_SECRET_PATH="secret/mlflow/auth"
export MLFLOW_SECRETS_AUTH_ENABLE="vault"

# Activate the plugin in MLflow (required)
export MLFLOW_TRACKING_AUTH="mlflow_secrets_auth"

# Your MLflow code works unchanged
import mlflow
mlflow.set_tracking_uri("https://mlflow.company.com")
mlflow.start_run()  # Authentication happens automatically

Demo

Try the complete working example with Vault + MLflow + Nginx:

git clone https://github.com/hugodscarvalho/mlflow-secrets-auth
cd mlflow-secrets-auth/examples/vault-nginx-mlflow
make demo

This demo shows the plugin working end-to-end with a real MLflow server protected by authentication.

Supported Providers

Provider Install Command Authentication Status
HashiCorp Vault pip install mlflow-secrets-auth[vault] Token, AppRole ✅ Available
AWS Secrets Manager pip install mlflow-secrets-auth[aws] IAM, Access Keys ✅ Available
Azure Key Vault pip install mlflow-secrets-auth[azure] Service Principal, Managed Identity ✅ Available
Google Secret Manager pip install mlflow-secrets-auth[gcp] Service Account, Workload Identity 🚧 Planned

Documentation

Requirements

  • Python 3.9+
  • MLflow 2.20.4+
  • Provider-specific SDKs (installed with extras)

License

Apache License 2.0 - see LICENSE file for details.

Release files for mlflow-secrets-auth 0.2.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 mlflow-secrets-auth 0.2.0
File Size Uploaded
mlflow_secrets_auth-0.2.0.tar.gz 30.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlflow-secrets-auth 0.2.0
File Interpreter ABI Platform
mlflow_secrets_auth-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.4 kB

Release files / mlflow_secrets_auth-0.2.0.tar.gz

Download URL mlflow_secrets_auth-0.2.0.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bb3f1b6f292c1ac4a385b2cc8c23d699b8a8ed3427aef7809580a9dfc7f09690
BLAKE2b-256 checksum
How to use checksums
1f242a13d8ab3339fd5567619af1bc6d54eed56035589800991e56fc61c05b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.11 Linux/6.11.0-1018-azure

Release files / mlflow_secrets_auth-0.2.0-py3-none-any.whl

Download URL mlflow_secrets_auth-0.2.0-py3-none-any.whl
Size 37.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
163b9dc4a5674b53deee2e35b09660fd420cae446a5ec8e1e489b719c8644591
BLAKE2b-256 checksum
How to use checksums
3f39240a212e5d7c2d79b1fadf80aa9053488208b5664d73a4d44d5e98d657a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.11 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

0.2.0 This release

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