Skip to content
Benchmarks

redact-secret · Report

API token

pypi- prefixed base64-encoded macaroon.

  • Python Package Index (PyPI)
  • Detectors: pypi-token
  • Run 2026-10-07
  • Mode published · redact-secret 0.1.0-beta.14
  • Dossier verdictReady
  • Dossier evidence levelT1 · Provider-documented
  • Dossier researched2026-09-22

Research record

From credential-evidence snapshot-2026.10.06.4 · records at 77ce761 · schema 1.8.0. It describes the research on the format, not what any scanner or the product does, and not a support status.
  • Review stateDraft, not reviewed
  • Format revision1 · current
  • ResearchResearched
  • Researched2026-09-22

2 events in the review history: 1 observed, 1 reviewed. Latest: observed on 2026-09-22 by automation, project maintainer. Project-maintained review is not independent validation. The family record at this release.

Format

Provider format research from credential-evidence snapshot-2026.10.06.4 · records at 77ce761 · schema 1.8.0.

What it looks like

Descriptive pattern
^pypi-[A-Za-z0-9_-]{85,}$

Parts are shown as recorded. Evidence classes belong to the facts below; no class is assigned to a part.

Format facts

  • Provider documented · provider-source · current · observed 2026-09-21

    pypi- prefix, base64-serialized PyMacaroon, {85,} length floor: docs.pypi.org's own detection-format page publishes this contract's exact regex, pypi-[A-Za-z0-9-_]{85,}: the pypi- prefix, a "-" separator, a base64 PyMacaroon serialization, an 85-character floor and no ceiling

    • docs.pypi.org/api/secrets/provider-documentation · last read 2026-09-22 · latest outcome read · supports docs.pypi.org's own detection-format page publishes this contract's exact regex, pypi-[A-Za-z0-9-_]{85,}: the pypi- prefix, a "-" separator, a base64 PyMacaroon serialization, an 85-character floor and no ceiling
  • Tool corroborated · tool-corroboration · current · observed 2026-09-21

    Pinned scanner rules are consistent with the contract grammar (2 artifacts: gitleaks 8.30.1; trufflehog 3.97.4).

  • Unresolved · listed-references · current · observed 2026-09-21

    The legacy contract lists 1 reference without stating which property each supports.

    • pypi.org/help/provider-documentation · last read 2026-09-22 · latest outcome read · supports Listed as a reference by the legacy contract · #apitoken
  • Provider documented · dossier-research · current · observed 2026-09-22

    Legacy dossier research (verdict ready, tier T1) cited 2 sources; the dossier does not attribute sources to individual properties.

    • docs.pypi.org/api/secrets/provider-documentation · last read 2026-09-22 · latest outcome read · supports Cited by the legacy dossier research for this family
    • pypi.org/help/provider-documentation · last read 2026-09-22 · latest outcome read · supports Cited by the legacy dossier research for this family · #apitoken

Open questions

No open question is recorded for this revision.

Benchmark dossier notes

From the provider dossier, as written. The evidence level above says how well the format is backed; a fact the dossier does not record is not shown.
Shape
prefix pypi-, then a URL-safe base64 string (letters, digits, -, _) of at least 85 characters, with no upper bound because caveats can be added to the macaroon. Real tokens begin with the encoded macaroon header for the location pypi.org, which both pinned scanners key on. The extra character in trufflehog's pattern implies an identifier of 36 to 39 bytes, consistent with a UUID.
Basis
T1. docs.pypi.org/api/secrets (fetched 2026-09-21) publishes the regex pypi-[A-Za-z0-9-_]{85,} and says the body is a PyMacaroon base64 serialization. The PyPI help page confirms the pypi- prefix is part of the password value and that the identifier is meant to be inspectable. Scanner rules are narrower: trufflehog 3.97.4 requires the macaroon header plus 150 to 157 further characters, and gitleaks 8.30.1 requires the header plus 50 to 1000. Neither verifies the signature by default.
Issuance
not attempted. Benchmarks#104 decided a structurally faithful synthetic token can be built without any PyPI signing key (nil-UUID identifier, a caveat that says it is a fixture, and a hash-filler signature), so no real token is needed for the positives.
Contract in core
detector-families.md.

In this benchmark

Fixture rows on the current run. Counts are for redact-secret in published · redact-secret 0.1.0-beta.14 mode.
Fixtures
26
Left readable
0
Redacted too much
0
False alarms
0

26 fixtures: 9 expect a redaction, 17 must stay quiet. See every row

redact-secret fixture counts by evidence level
Evidence levelFixturesLeft readableToo muchFalse alarms
T1Provider-documented9000
T2Tool-corroborated13000
T3Project policy4000

Every scanner on the same fixtures

In run order. Counts are what each scanner recorded on this family's fixtures, whichever rules it has; a scanner with no rule for the family has nothing to report on it.

Counts per scanner on this family's fixtures
ScannerFixturesLeft readableToo muchFalse alarms
flare-redactRuntime library · 1.6.1 · Published npm package · secrets-only (pii, generic_assignment disabled) · JavaScript engineNo rule maps to it26900
gitleaksRepository scanner · 8.30.1 · Directory scan · default rules1 rule targets it26004
redact-secretProduct measured here · 0.1.0-beta.14 · Published npm package · default detectors1 detector mapped26000
trufflehogRepository scanner · 3.97.4 · Filesystem scan · verification disabled1 rule targets it26000

Looks like it, but isn't

Values the dossier records as resembling this credential without being one.
Collisions
the identifier inside the macaroon is meant to be readable and is not itself the secret. Twine and pip use the same pypi- value as a password, so it appears under TWINE_PASSWORD-style names.

Scanner rules for this family

Mapped by hand (reviewed 2026-09-30) from each scanner's pinned rule file, never from what a scanner found on the fixtures.
Peer scanner rules that target this family
ScannerRuleWhat the rule matches
gitleaks · rules 8.30.1pypi-upload-tokenpypi-AgEIcHlwaS5vcmc + 50-1000 characters
openredaction · rules 1.1.5PYPI_TOKENpypi- + 100 or more characters
trufflehog · rules 3.97.4pypipypi-AgEIcHlwaS5vcmcCJ + 150-157 characters

No rule maps to this family in flare-redact.

26 of 26 rows

Fixtures in this family

26 rows, redact-secret's outcome on each. Rows that need a look come first (0), then the rest in corpus order. Choose "Every scanner" to see each scanner's outcome for the same rows.
Fixtures in API token
FixtureKind and evidenceredact-secret
pypi-token-gitlab-ci-variablespypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-noxfile-publishpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-public-idpypi · benign-lookalikeMust not flagT2 · Tool-corroboratedQuiet
pypi-token-pypircpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-shape-1-barepypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-shape-1-length-bare-twinpypi · wrong-lengthMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-length-quoted-twinpypi · wrong-lengthMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-length-unicode-crlf-twinpypi · wrong-lengthMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-quotedpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-shape-1-unicode-crlfpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-twine-envpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-twine-upload-flagpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-uv-publish-tokenpypi · documented-format-literalMust redactT1 · Provider-documentedRedacted
pypi-token-encoded-valuepypi · benign-lookalikeMust not flagT2 · Tool-corroboratedQuiet
pypi-token-label-prosepypi · benign-lookalikeMust not flagT3 · Project policyQuiet
pypi-token-maskpypi · benign-lookalikeMust not flagT3 · Project policyQuiet
pypi-token-ordinary-prosepypi · benign-lookalikeMust not flagT3 · Project policyQuiet
pypi-token-prefix-onlypypi · benign-lookalikeMust not flagT2 · Tool-corroboratedQuiet
pypi-token-referencepypi · benign-lookalikeMust not flagT3 · Project policyQuiet
pypi-token-shape-1-alphabet-bare-twinpypi · wrong-alphabetMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-alphabet-quoted-twinpypi · wrong-alphabetMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-alphabet-unicode-crlf-twinpypi · wrong-alphabetMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-bare-twinpypi · prefix-near-missMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-quoted-twinpypi · prefix-near-missMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-shape-1-unicode-crlf-twinpypi · prefix-near-missMust not flagT2 · Tool-corroborated · twinQuiet
pypi-token-short-bodypypi · benign-lookalikeMust not flagT2 · Tool-corroboratedQuiet

Sources

Researched 2026-09-22.

Documentation and code