agent-opaque-env
Self-describing encrypted environment files for AI-assisted development.
The package keeps environment keys and values out of plain-text repository context. Its Rust
extension also raises the cost of casual static analysis. It is not a secret manager: an agent or
process allowed to call load_env() can read the returned values.
Install
uv add agent-opaque-env
The wheel contains the Rust implementation. Users do not need to install cryptography or a Rust
toolchain when a wheel is available for their platform.
Use
from agent_opaque_env import dump_env, load_env
dump_env({"APP_MODE": "development"}, ".env")
values = load_env(".env")
dump_env() defaults to the zero-configuration obfuscation profile. It creates an owner-only
file and stores shuffled key material with the ciphertext. This prevents direct text collection but
does not create a separate secret boundary.
For protection when the repository is copied without its key, use the protected profile:
from agent_opaque_env import dump_env, load_env
# Public example key only. Never use this key for real secrets.
key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
dump_env(values, ".env", profile="protected", key=key, key_id="example-local")
values = load_env(".env", key=key)
Generate a unique key for real use and keep it outside the repository. Instead of passing key=,
applications may set the AGENT_OPAQUE_ENV_KEY environment variable. Missing or incorrect keys fail
explicitly and never downgrade to obfuscation.
from agent_opaque_env import generate_key
key = generate_key() # Store this outside the repository before encrypting files.
Self-describing AOE1 format
An AOE1 file is ASCII with exactly three lines:
AGENT-OPAQUE-ENV/1
{"algorithm":"AES-256-GCM","format":"AOE1","import":"agent_opaque_env","loader":"load_env","package":"https://pypi.org/project/agent-opaque-env/","profile":"obfuscation"}
{"ciphertext":"...","key_fragments":["...","...","..."],"nonce":"..."}
The fixed package URL tells a developer or agent that the agent-opaque-env PyPI distribution and
its load_env API understand the file.
It never contains a shell command, package-manager arguments, any other URL, environment values, or
other executable instructions. Verify the dependency against the project configuration before
installing anything named by an untrusted file.
Metadata bytes are authenticated as AES-GCM associated data. Unknown fields, non-canonical JSON, modified metadata, altered ciphertext, and unsupported formats are rejected.
API
dump_env(values, path=".env", *, profile="obfuscation", key=None, key_id=None)
load_env(path=".env", *, key=None) -> dict[str, str]
loads_env(data, *, key=None) -> dict[str, str]
generate_key() -> str
Only CPython 3.11 and newer are supported. New files use AOE1 exclusively; Pickle and older formats are intentionally unsupported.
Metadata
Release files for agent-opaque-env 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| agent_opaque_env-0.5.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| agent_opaque_env-0.5.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 3.3 MB
Release files / agent_opaque_env-0.5.0-cp311-abi3-win_amd64.whl
| Download URL | agent_opaque_env-0.5.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 806.7 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
27f10ae1882f7299b60bb0fb63935abed19fdfbfd3bb5297ed469c2fcf5432b2
|
|
BLAKE2b-256 checksum How to use checksums |
b0392a0e4555d05d05fa496caa9a3b28c787512d632f2c5ba70b0dbaf847a113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 886.9 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
08d1b14458aa68ee801f552c7dee91d0c25e79233e4abb732645e619e43600ab
|
|
BLAKE2b-256 checksum How to use checksums |
f06dcf6a31ea8daf209618c1cd335b5e5a0b265c9f1b7fbccf7e5a7e56308c4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | agent_opaque_env-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 824.0 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
36a81851c5be38d197beb08ecda231bfea6e5c9757ad300520d5813fbc9e82b3
|
|
BLAKE2b-256 checksum How to use checksums |
ef4318379acfccfadc2bc3a3dc9cb37561e96fcfb9c772d084963d3c1a9377e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / agent_opaque_env-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | agent_opaque_env-0.5.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 768.4 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e5eac768723adf11e6316ba7510228d05fa477d58d55ce02695b4f4f66376b9
|
|
BLAKE2b-256 checksum How to use checksums |
d41ccecbf8f6d1b26f3c7671956234f386c388eab55202bfc6363c9c32ae217f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for agent-opaque-env 0.5.0
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.