murk-secrets
Python bindings for murk — an encrypted secrets manager for developers.
murk stores encrypted secrets in a single .murk file safe to commit to git. This package lets Python apps read those secrets at runtime.
Prerequisites
You need the murk CLI to create and manage vaults. This package only reads them.
# Install the CLI first
brew install interrupted-sh/tap/murk
# Initialize a vault and add secrets
murk init
murk add DATABASE_URL
murk add API_KEY
Then add the Python package to your project:
pip install murk-secrets
Quick start
# Optional on the machine that ran murk init (see "Key lookup").
# POSIX shell syntax.
source .env
import murk
# Load the vault (finds your key; see "Key lookup")
vault = murk.load()
# Get a single secret
db_url = vault.get("DATABASE_URL")
# Get all secrets as a dict
secrets = vault.export()
# Dict-style access
api_key = vault["API_KEY"]
API
murk.load(vault_path=".murk") -> Vault
Load and decrypt a murk vault. Finds your key as described in Key lookup.
murk.get(key, vault_path=".murk") -> str | None
One-liner: load the vault and get a single value.
murk.export_all(vault_path=".murk") -> dict[str, str]
One-liner: load the vault and export all secrets as a dict.
murk.has_identity() -> bool
Returns True if murk can find a key for ./.murk: MURK_KEY, MURK_KEY_FILE or the key file murk init stored. Returns False if no key is found, if both variables are set, or if the key file cannot be read. It does not read the vault, so True does not guarantee that load() succeeds. It does not check whether a secret exists. Use key in vault or vault.keys() for that.
Vault
| Method | Returns | Description |
|---|---|---|
vault.get(key) |
str | None |
Decrypted value, or None if no value is readable for the key |
vault.export() |
dict[str, str] |
Every secret you can read |
vault.keys() |
list[str] |
Key names in the vault schema, including keys you cannot read |
vault[key] |
str |
Like get, but raises RuntimeError (not KeyError) if no value is readable |
key in vault |
bool |
True if the key is in the schema, even if you cannot read its value |
len(vault) |
int |
Number of keys in the schema |
vault.warnings |
list[str] |
Warnings about an accepted vault, the ones the CLI prints as warn … (empty for a clean load) |
Scoped (per-user) overrides are applied automatically — if you have a scoped value for a key, it takes priority over the shared value.
Trust
load(), get() and export_all() apply the same trust check as the CLI. A vault this machine does not trust — unsigned when your key could have signed it, signed by a key this machine hasn't accepted, rolled back, or tampered with — raises murk.TrustError (a subclass of RuntimeError) with the CLI's message. Nothing in the binding skips the check. Run murk trust once from a shell to accept a vault, or set MURK_TRUSTED_SIGNERS in CI. An agent grant key reads only through the trusted signers in its key file or MURK_TRUSTED_SIGNERS.
Memory hygiene
Every decrypted value murk returns is a plain Python string. murk zeroes plaintext from its own memory when a value is dropped, but that guarantee ends at the FFI boundary: once a value crosses into Python the interpreter owns it, and its garbage collector — not murk — controls its lifetime. This is inherent to reading secrets into a process (see the threat model); avoid holding decrypted values longer than you need them.
Agent policy
If the loaded key is an agent grant (from murk agent grant), the bindings enforce the vault's agent policy on every read, as murk agent exec does. get() and export() raise RuntimeError when the policy forbids a key they can read. Once the grant's TTL has passed, export() and get() of a readable key raise too. keys(), len() and in read only the schema and never check the policy. A plain operator key skips the check unless MURK_SELF_SCOPE or MURK_AGENT is set. A grant also cannot decrypt out-of-scope secrets, because its key is not a recipient of them, so the policy check is a second guard.
A loaded Vault keeps the values and policy from its last load. Policy changes and revocations apply only after you call load() again. Grant expiry is checked again on each value read.
Key lookup
load() finds your key the same way the CLI does:
MURK_KEY(your age secret key) orMURK_KEY_FILE(the path to a key file). Set one, not both. murk refuses to load when both are set.- The key file that
murk initstored under~/.config/murk/keys/.
murk init also writes a .env that points MURK_KEY_FILE at that file. On the machine where you ran murk init, you do not need to source it. Set the variable yourself in CI, in containers and whenever MURK_STRICT or MURK_AGENT is set, because both turn off step 2.
Requirements
Python 3.9 or later, the murk CLI, a .murk vault in your project and a key (see Key lookup).
License
MIT OR Apache-2.0
Metadata
Release files for murk-secrets 0.14.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| murk_secrets-0.14.1.tar.gz | 9.9 MB | With provenance | Details for murk_secrets-0.14.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| murk_secrets-0.14.1-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for murk_secrets-0.14.1-cp39-abi3-win_amd64.whl |
| murk_secrets-0.14.1-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details for murk_secrets-0.14.1-cp39-abi3-manylinux_2_28_aarch64.whl |
| murk_secrets-0.14.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for murk_secrets-0.14.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| murk_secrets-0.14.1-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details for murk_secrets-0.14.1-cp39-abi3-macosx_11_0_arm64.whl |
| murk_secrets-0.14.1-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details for murk_secrets-0.14.1-cp39-abi3-macosx_10_12_x86_64.whl |
Total release size: 17.0 MB
Release files / murk_secrets-0.14.1.tar.gz
| Download URL | murk_secrets-0.14.1.tar.gz |
|---|---|
| Size | 9.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2c036d3b77d61458dc0e4f1e8e55f817f1962e46e2b7d9d300b311713b2ca52
|
|
BLAKE2b-256 checksum How to use checksums |
f35ac7722d905b5585aa2963db6a0d3fab7174cd52fae454dc0455a7e1738d66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / murk_secrets-0.14.1-cp39-abi3-win_amd64.whl
| Download URL | murk_secrets-0.14.1-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
dd1ba0e211bcf7300fd1f78885efb73d18c06fae5ff2240c15d1da13c7beead5
|
|
BLAKE2b-256 checksum How to use checksums |
7ae8986844c788ce0deca6e47bfd3c9dac8088951955fe108186b50150dd665e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / murk_secrets-0.14.1-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | murk_secrets-0.14.1-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
abccada83cd6f80b6400e4d6eae85abe2867e28183436ec244cc7d984699683f
|
|
BLAKE2b-256 checksum How to use checksums |
204088d172a5ed3a92d89a65af19c3fdac07f1355b56d1e50a1987da216e91c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / murk_secrets-0.14.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | murk_secrets-0.14.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2167b8dbe93e562b22595b9d8c81e6bf923be88d31de692bf55ab1991a1d4d25
|
|
BLAKE2b-256 checksum How to use checksums |
93ddd3132a83a0d52700940b2d1436f7b5de36f6a7fb0d607713c7254f2444de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / murk_secrets-0.14.1-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | murk_secrets-0.14.1-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f04367ed7b365bcae21e03d7d27bd3c45a4bf1d9b74e781e7ac627dd5d3f0112
|
|
BLAKE2b-256 checksum How to use checksums |
cf3335d4f8d4c4dbe7660585564ab8bf496d1086a73f83eaeadc26d16f98ce39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / murk_secrets-0.14.1-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | murk_secrets-0.14.1-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f96be0c1078ac7573af2527317d0777c7d981a147266510d6e8949084504ebd1
|
|
BLAKE2b-256 checksum How to use checksums |
0dbe55e1ee5f2b96c7d8b42d6dedb7480e583b6b340daa3f5718f84d1c73b2eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for murk-secrets 0.14.1
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.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for murk_secrets-0.14.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA 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.