agent-redact (Python)
Python bindings for agent-redact. This is a thin, dependency-free wrapper around the Node.js CLI, so Python agents get exactly the same detection engine as the npm package.
pip install agent-redact
Node.js 20+ is still required. This package contains only the Python wrapper; the detection engine is the Node.js CLI (see below for how it is found).
Requirements:
- Python 3.10+
- Node.js 20+
- the CLI, from one of these (checked in order):
AGENT_REDACT_CLIset to the absolute path ofdist/cli/index.js;- a global
npm install -g agent-redact; - npm next to
node: the matching version is installed once into a private user cache (--ignore-scripts) and reused.
The CLI is always started as node <absolute path>. It is never run through .cmd/.bat shims, through npx, or from a binary found in the current directory, so scanning an untrusted repository cannot hijack it.
from agent_redact import redact, scan, Session
# One-way redaction
result = redact("deploy with AKIA...") # result.text, result.matches (no secret values)
redact(text, presets=["vn-pii"]) # opt-in presets
# Reversible masking across a whole conversation
with Session() as s:
safe_prompt = s.redact(user_prompt) # [AWS_ACCESS_KEY_ID_1] …
answer = llm(safe_prompt)
print(s.unmask(answer)) # placeholders restored locally
# Repository / staged-changes audit
findings = scan(["."]) # honours .gitignore in git repos
findings = scan(staged=True) # what is about to be committed
Session keeps its vault in a private temporary directory, encrypted with a random per-session passphrase that is never written to disk, and deletes it on close() or when the with block ends.
Metadata
Release files for agent-redact 0.2.0
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 |
|---|---|---|---|---|
| agent_redact-0.2.0.tar.gz | 7.4 kB | With provenance | Details for agent_redact-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_redact-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agent_redact-0.2.0-py3-none-any.whl |
Total release size: 13.9 kB
Release files / agent_redact-0.2.0.tar.gz
| Download URL | agent_redact-0.2.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac81aac8ddfbc52e8cb452eb0b1dd7c803279c3ab334761c8c29f86f6cf1e165
|
|
BLAKE2b-256 checksum How to use checksums |
ca734f5738058f6158f5d4ccce59c4c698e016a230c886b9e95ff0557644b03d
|
| 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 8, 2026.
Transparency logRelease files / agent_redact-0.2.0-py3-none-any.whl
| Download URL | agent_redact-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f69f4bc271171b96f37939acb388a440bcf95587be5ff29c9981e5caab33155e
|
|
BLAKE2b-256 checksum How to use checksums |
98989d1597935e92e30186f8a2dad7a465acce3efc50927fc9124bfac8fc63ef
|
| 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 8, 2026.
Transparency logSecurity for agent-redact 0.2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_redact-0.2.0.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 8, 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.