Scan your whole stack
From OX Research Newsroom
Are you using agent-sanitizer?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v2.71.6
agent-sanitizer was last scanned on 29 Nov 2026 at version 2.71.6. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 2.71.6 LATEST | 29 Nov 2026 | No rules fired |
| 2.71.5 | 22 Nov 2026 | No rules fired |
| 2.71.4 | 22 Nov 2026 | No rules fired |
| 2.71.3 | 22 Nov 2026 | Not shown |
| 2.71.1 | 21 Nov 2026 | Not shown |
Findings for v2.71.6. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 2.71.6; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A thin Python bridge to the agent-sanitizer
Node.js CLI. The sanitization logic has a single source of truth — the
JavaScript in src/ — so this package shells out to the CLI rather than
re-implementing it, giving a Python pipeline byte-identical verdicts with no
second implementation to keep in sync.
PATH. The sanitizer is JavaScript; something has to
run it. There is deliberately no pure-Python fallback.That's it — pip install agent-sanitizer and, with Node available, you're
ready to go. The wheel ships a self-contained, single-file build of the CLI
(the src/ logic and its npm dependencies bundled into one .mjs at release
time), so there is no separate JavaScript checkout to clone and no environment
variable to set. The bundle is a versioned build artifact from src/, not a
hand-maintained port, so it can't drift from the JS.
Set AGENT_SANITIZER_CLI to a checkout's bin/sanitize-cli.mjs to override the
bundled CLI (e.g. to run against unreleased src/ changes). When the module is
imported directly from a repo checkout, the source CLI is found automatically.
from agent_sanitizer import sanitize
result = sanitize("untrusted text", html=True)
print(result.cleaned, result.found, result.warnings)
See the package docstring for the full set of entry points (sanitize_text,
classify_prompt, scan_instruction_files, clean_file, and the long-lived
Sanitizer worker).
[secrets] extra)The base install is dependency-free. The optional secrets extra adds a
pure-Python secret-redaction engine under agent_sanitizer.secrets —
detect-secrets plus custom detectors, benign-value skipping, cross-line
reassembly, PEM collapse, and exact-match redaction of caller-supplied env-var
values. Unlike the sanitizer above it needs no Node.js; its only dependency
is detect-secrets, pulled in by the extra:
pip install "agent-sanitizer[secrets]"
Every detect-secrets import lives inside this subpackage, so a plain
import agent_sanitizer never touches it. The engine shares the parent
package's invisible-character SSOT (agent_sanitizer.invisible) rather
than forking it — a fork would be a silent security regression.
from agent_sanitizer.secrets import RedactorConfig, redact, redact_map
redacted, found = redact("aws_key = AKIAIOSFODNN7EXAMPLE")
# -> ("aws_key = [REDACTED: AWS Access Key]", ["AWS Access Key"])
# Pass provider/host secret values in — config is supplied, never discovered.
cfg = RedactorConfig(host_cred_vars={"GH_TOKEN": "ghp_realtokenvalue123"})
redact("tok=ghp_realtokenvalue123", cfg) # -> ("tok=[REDACTED: GH_TOKEN]", ["GH_TOKEN"])
redact_map(text, config) returns a lossless, two-way view:
{"text": "<redacted>",
"pairs": [{"placeholder": "[REDACTED: …]", "original": "<secret>", "start": <int>}],
"found": ["<type>", ...]}
Substituting each pair["original"] at its start reconstructs the input
byte-for-byte. start is a Unicode code-point offset into text (the field
is start, not start_offset). U+E000 / U+E001 are reserved placeholder
sentinels: input already containing either is refused with
{"unmappable": "input contains reserved sentinel characters"} (fail closed)
rather than producing an ambiguous map.
detect-secrets caches a process-global secret_type → plugin mapping, so a fresh
one-shot call must re-register the plugin set every time — slow under load. Two
console scripts (installed with the extra) cover both modes:
agent-secret-redactor — one-shot: reads text on stdin, writes the
redaction result as JSON on stdout. Re-registers plugins per call.agent-secret-redactor-daemon <socket-path> — long-lived Unix-socket
server that configures the plugin set once at startup (a warm-up scan
primes the cache before it binds, so a bound socket means ready). Wire protocol
both directions: a 4-byte big-endian length prefix then that many bytes of
UTF-8 JSON, specified field by field in
agent_sanitizer/secrets/data/redactor-protocol.json. Every request field
(text, map, web_ingress, env_secrets) is required; the response is the
one-shot result, JSON null when nothing is redacted, or {"error": …} for a
malformed request or a scan failure. The daemon logs failures to daemon.log
beside the socket.Both console scripts import the engine on startup, so they fail loud if the
[secrets] extra (hence detect-secrets) is not installed — fail closed, never
a silent no-op.
This package is versioned in lockstep with the npm
agent-sanitizer:
each release publishes both at the same version from the same commit, and the
wheel bundles src/ at exactly that version. So pip install agent-sanitizer==X.Y.Z and npm i agent-sanitizer@X.Y.Z are the
same underlying logic.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.