Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Detector-specific extension notes live in
[docs/pii-detector-playbook.md](docs/pii-detector-playbook.md), and editable backlog
seed data is available at [examples/challenge_backlog.json](examples/challenge_backlog.json).

Developer notes:

- [src/makeaivisible_anonymizer/README.md](src/makeaivisible_anonymizer/README.md)
explains the service package and request flow.
- [examples/README.md](examples/README.md) explains the synthetic examples.

### Run locally

```bash
Expand Down
16 changes: 16 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Anonymization Examples

This folder contains synthetic examples only.

- `request.json`: a sample `/anonymize` request for local testing.
- `challenge_backlog.json`: editable notes for the 12 MVP challenge areas.

Run the service locally, then submit the example:

```bash
curl -s http://127.0.0.1:8000/anonymize \
-H 'content-type: application/json' \
--data @examples/request.json
```

Do not place real contributor exports in this folder.
27 changes: 27 additions & 0 deletions src/makeaivisible_anonymizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Anonymization Service Package

This package is the first privacy boundary after an upload. It accepts conversation
messages, redacts supported identifiers, and returns anonymized messages plus a redaction
report.

## File Map

- `main.py`: FastAPI app, `/health`, and `/anonymize`.
- `models.py`: request and response schemas, validation limits, and output shapes.
- `limits.py`: request body size guard before JSON parsing.
- `detectors.py`: active regex detectors and documented detector gaps.
- `redaction.py`: matching, overlap handling, replacement labels, and redaction counts.

## Request Flow

1. `limits.py` rejects oversized HTTP bodies.
2. `models.py` validates message roles, content lengths, and unknown fields.
3. `main.py` loops through messages and calls `redaction.py`.
4. `redaction.py` uses `detectors.py` to replace matched identifiers.
5. The response includes generated `conversation_id`, redacted messages, and a report.

## Where To Add New PII Work

Start with tests in `tests/test_redaction.py`, then update `detectors.py`. Do not add
real names, real schools, real addresses, or real conversations as fixtures. Use synthetic
examples only.
Loading