Skip to main content

maisecrets

Find secrets and personal data in text. This package is the detection core of the maisecrets plugin for Claude Code and Codex, as a library without the plugin.

pip install maisecrets

It needs no other package and runs on Python 3.9 and later.

from maisecrets.detection import Active, Detector, Host, NO_REFERENCES, NO_SOURCES

d = Detector(
    regions=Active(regions=("generic", "de"), languages=("en", "de"), source="mine"),
    sources=NO_SOURCES,
    references=NO_REFERENCES,
    host=Host(user="me", year=2026),
)
text = open("app.log", encoding="utf-8").read()
for m in d.findings(text, channel="tool"):
    print(m.type, m.kind, m.start, m.end)     # e.g. SECRET gitlab-pat 120 146

A detector with these four arguments reads nothing of the computer it runs on: no home folder, no config.

From another language: one JSON request per process

The package also runs as a command line program. It reads one JSON request on stdin and writes one JSON response on stdout. The response holds the offsets, the type and the rule of each finding, never the value.

echo '{"contract": "maisecrets.detect/1", "text": "token: ...", "channel": "tool",
       "regions": ["generic", "de"], "languages": ["en", "de"]}' | python -m maisecrets.detection

The package installs the same program as maisecrets-detect.

The schema ships with the package (maisecrets/detection/detect-1.schema.json). An unknown key, region or label language gives an error response with exit status 2.

What it finds

  • Secrets (type SECRET): API keys and tokens of many vendors, private keys, passwords and keys after a label, credentials in URLs and connection strings.
  • Personal data (89 types): e-mail addresses, phone numbers, cards, bank accounts, national ID and tax numbers of the regions you activate, names and addresses after a label.

It finds by rules, not by a model. It leaves documented test values (a test card, an address at example.com) alone, and it misses what a rule does not describe. maisecrets.detection.TYPES lists every type.

Metadata

Release files for maisecrets 0.9.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maisecrets 0.9.22
File Size Uploaded Provenance Actions
maisecrets-0.9.22.tar.gz 550.2 kB With provenance Details for maisecrets-0.9.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maisecrets 0.9.22
File Interpreter ABI Platform Actions
maisecrets-0.9.22-py3-none-any.whl Python 3 none any Details for maisecrets-0.9.22-py3-none-any.whl

Total release size: 1.1 MB

Release files / maisecrets-0.9.22.tar.gz

Download URL maisecrets-0.9.22.tar.gz
Size 550.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e1f286e663c1f57eeca4bc963fa99219d2216d76db51e9f84ff8f4395a9d39d5
BLAKE2b-256 checksum
How to use checksums
835e49f5b0c0538be28e78fd3d55a81730f84986ed31dcf84ad51401ccb6bb26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.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 22, 2026.

Transparency log

Release files / maisecrets-0.9.22-py3-none-any.whl

Download URL maisecrets-0.9.22-py3-none-any.whl
Size 577.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec0790ff18d77a1905b0709344626a6d732b85e3c615b16655d7c4163847972e
BLAKE2b-256 checksum
How to use checksums
b49a6b6a491e453e43a4b4f10ab2086c7667c9defd6867dad9525b3dde7f4612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.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 22, 2026.

Transparency log

Security for maisecrets 0.9.22

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.

Select from 2 files

Attestation for maisecrets-0.9.22.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 22, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.22 This release

2 release files Full provenance

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