gitwtfhub

wtf is alcatraz?

hoophq/alcatraz — explained in plain English

Analysis updated 2026-05-18

30GoAudience · developerComplexity · 2/5Setup · easy

TL;DR

A dependency-free Go library and CLI that detects and masks 45 types of personal data like emails, card numbers, and national IDs, running entirely in-process.

Mindmap

mindmap
  root((Alcatraz))
    What it does
      Detects PII
      Verifies with checksums
      Masks sensitive text
    Tech stack
      Go
      RE2 regexp
      ONNX NER
    Use cases
      Scan logs for secrets
      Mask PII in CI diffs
      Redact chat outputs
    Audience
      Backend developers
      Security engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Detect and mask emails, credit cards, and national ID numbers inside application text without an external service.

REASON 2

Scan log files or git diffs from the command line to catch accidentally committed secrets or PII.

REASON 3

Anonymize sensitive text before storing or displaying it, using masking, redaction, or placeholder replacement.

What's in the stack?

GoONNX

How it stacks up

hoophq/alcatrazdevelopersdigest/aws-ec2-cuda-ollamaivngineer/sword
Stars303030
LanguageGoGoGo
Last pushed2024-08-03
MaintenanceStale
Setup difficultyeasyhardmoderate
Complexity2/54/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires Go 1.24+, the optional NER module adds a local ONNX model for names, locations, and free-text dates.

No license information is provided in the README excerpt.

Wtf does this do

Alcatraz is a Go library that detects personally identifiable information, or PII, inside text: things like email addresses, credit card numbers, national ID numbers, and similar sensitive data. It covers 45 different types of these identifiers across 12 countries. Unlike many PII detection tools, which run as a separate service you call over a network, Alcatraz runs directly inside your own program as a simple function call, with no server to deploy and no machine learning models to download for its core functionality. A key strength is that many of its detectors do not just look for text that resembles a certain pattern, they actually verify it. For example, a credit card number is checked against the Luhn algorithm, a standard math formula used to catch invalid card numbers, so a string of digits that merely looks like a credit card but fails that check gets dropped rather than flagged as a false positive. Similar real validation exists for bank account numbers, national ID schemes in several countries, and more. The core of the library has no dependencies outside Go's own standard library, and its pattern matching is built to run in linear time, avoiding the kind of slow, backtracking-heavy regular expressions that can be exploited to freeze a program. An optional add-on module can detect harder cases like names, locations, and free-text dates using a small machine learning model that still runs locally, without calling out to the internet. Beyond the library, Alcatraz ships as a command-line tool that can scan log files, piped text, or the changed lines in a git diff, always masking any sensitive values it finds in its output. It also includes a companion package for turning detected spans into cleaned text, offering choices like masking characters, keeping the last few digits visible, or replacing a value entirely with a placeholder like an EMAIL_ADDRESS tag. The project is explicitly marked experimental and under active development, and its authors warn that the public interface may still change, including breaking changes, before it reaches a stable 1.0 release.

Yoink these prompts

Prompt 1
Show me how to install alcatraz and run its CLI to scan a log file for PII.
Prompt 2
Help me write Go code that uses alcatraz.NewEngine() to analyze a string for credit card numbers.
Prompt 3
Explain how the anonymizer package's Mask and Replace operators differ.
Prompt 4
Walk me through wiring alcatraz's git diff scanning mode into a CI pipeline.

Frequently asked questions

wtf is alcatraz?

A dependency-free Go library and CLI that detects and masks 45 types of personal data like emails, card numbers, and national IDs, running entirely in-process.

What language is alcatraz written in?

Mainly Go. The stack also includes Go, ONNX.

What license does alcatraz use?

No license information is provided in the README excerpt.

How hard is alcatraz to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is alcatraz for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.