agentleFS
fevra-devfevra-dev/Subrosa/skills/metadata-hygiene/SKILL.md

metadata-hygiene

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Audits and cleans metadata embedded in files before sharing — EXIF in images, author/revision history in documents, GPS in videos/audio, git config real names, archive internal paths, and binary file headers. Use when user says "strip metadata", "clean this file before sharing", "remove EXIF", "scrub this doc", "anonymize this file", "what metadata does this have", "git history cleanup", "remove my name from this", or when preparing any file for external distribution. Operationally distinct from redact (text content) and opsec-review (inference audit) — this skill handles embedded binary and structured metadata in files, not document text.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before stripping, inventory what is present.

    line 90
  2. Distinctive:

    Never skip verification. Metadata stripping tools have known limitations per file type.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Metadata Hygiene

Audit and cleaning guidance for embedded metadata in files before external sharing. Covers binary file headers, document properties, version history, geolocation data, device identifiers, and version control artifacts.

Composable with:

  • opsec-review — identifies metadata as a finding; this skill executes the cleaning
  • redact — handles text content PII; this skill handles embedded file metadata

File Type Coverage

File typePrimary metadata risksReference section
Images (JPEG, PNG, TIFF, HEIC, WebP)GPS coordinates, device model, timestamp, authorreferences/image-metadata.md
PDFAuthor, company, software, creation date, revision history, comments, embedded fonts with license inforeferences/document-metadata.md
DOCX / XLSX / PPTX (Office)Author, last modified by, company, revision history, tracked changes, comments, template pathreferences/document-metadata.md
Audio (MP3, FLAC, M4A, WAV)GPS (phone recordings), device ID, recording software, embedded artwork with its own EXIFreferences/av-metadata.md
Video (MP4, MOV, MKV)GPS coordinates, device model, recording software, creation timestamp, chapter markersreferences/av-metadata.md
Archives (ZIP, TAR, 7z)Internal file paths revealing directory structure, creation timestamps, OS identifiersreferences/archive-metadata.md
Git repositoriesReal name in commit history, email in commits, internal branch names, accidentally committed secretsreferences/git-metadata.md
Code filesAuthor in file headers, internal paths in stack traces, debug build artifactsInline guidance below
Compiled binariesCompilation paths revealing developer username and directory structure, debug symbolsInline guidance below

Metadata Risk Taxonomy

Tier 1 — Location & Physical Safety (Always strip)

  • GPS coordinates (latitude, longitude, altitude) in any file type
  • Cell tower / WiFi positioning data
  • Location-tagged audio/video

Risk: Reveals home address, workplace, regular locations, travel patterns. Physical safety risk for high-threat contexts.

Tier 2 — Identity & Attribution (Strip for pseudonymous or sensitive sharing)

  • Real name in document author fields
  • Email address in document properties or git config
  • Username in file paths (e.g. /Users/realname/, /home/realname/)
  • Account identifiers embedded in Office documents

Risk: Breaks pseudonymous separation; links content to real identity; enables OSINT correlation.

Tier 3 — Device & Environment Fingerprinting (Strip before security research publication)

  • Device make and model (camera model, phone model)
  • OS version used to create the file
  • Software version used (Adobe Photoshop CC 2024, Microsoft Word 16.x)
  • Compilation toolchain version in binaries
  • Screen resolution / DPI in document properties

Risk: Fingerprints your setup; enables CVE correlation; assists targeted spearphishing.

Tier 4 — Temporal Signals (Context-dependent)

  • Precise creation timestamp
  • Modification timestamp history (multiple revisions visible)
  • Print timestamps in PDFs
  • Recording start/stop times in audio/video

Risk: Temporal correlation; reveals work patterns and timezone; can undermine alibi in sensitive contexts.

Tier 5 — Organizational Signals (Strip before external sharing)

  • Company name in Office document properties
  • Template path revealing internal file server paths
  • Revision history showing internal codenames, colleagues' names
  • Tracked changes with internal comments

Risk: Organizational intelligence; internal structure leakage; third-party relationship exposure.


Workflow

Step 1 — Identify file type and sharing context

Ask or infer:

  1. What is the file type?
  2. Where is it going? (public post, client email, GitHub, security research publication, etc.)
  3. What sensitivity context? (personal, pseudonymous, operational security critical)
  4. Is this a single file or a batch?

Higher sharing sensitivity → strip all tiers. Lower sensitivity → strip Tier 1-2 minimum.

Step 2 — Metadata inventory

Before stripping, inventory what is present. Different for each file type — load the appropriate reference. Produce a summary:

FILE METADATA INVENTORY
────────────────────────────────
File: photo_2024-01-15.jpg
Type: JPEG with Exif 2.3

[T1 — LOCATION]
  GPS Latitude:      43.6532° N
  GPS Longitude:     79.3832° W   ← Toronto area
  GPS Altitude:      76m

[T2 — IDENTITY]
  Author:            [real name]
  Artist:            [real name]

[T3 — DEVICE]
  Make:              Apple
  Model:             iPhone 14 Pro
  Software:          17.2.1

[T4 — TEMPORAL]
  DateTimeOriginal:  2024:01:15 14:32:11
  CreateDate:        2024:01:15 14:32:11

[T5 — ORGANIZATIONAL]
  (none)

Recommendation: Strip ALL tiers before sharing. GPS alone is physical safety risk.

Step 3 — Cleaning instructions

Provide exact tool commands for the user's environment. Always provide:

  1. The primary recommended tool
  2. A verification command to confirm stripping worked
  3. A warning if the file type has metadata that cannot be fully stripped

Step 4 — Verification

Never skip verification. Metadata stripping tools have known limitations per file type. Confirm clean:

# Verify EXIF removed from JPEG
exiftool output.jpg | grep -E "GPS|Author|Artist|Make|Model"
# Should return nothing

# Verify PDF metadata cleared
exiftool output.pdf | grep -E "Author|Creator|Producer|Company"
# Should return nothing or only desired values

Step 5 — Residual risk statement

Some metadata cannot be removed without degrading the file:

  • JPEG quality settings reveal approximate compression level (minor)
  • PDF font embedding reveals which fonts were used (minor)
  • Certain proprietary formats re-embed metadata on save (flag explicitly)

State what residual metadata remains after cleaning and whether it poses material risk.


Tool Reference (Quick)

ExifTool (images, audio, video, PDF, documents — universal)

# Inventory all metadata
exiftool filename.jpg

# Strip ALL metadata (creates filename_original backup)
exiftool -all= filename.jpg

# Strip ALL, overwrite in place (no backup)
exiftool -all= -overwrite_original filename.jpg

# Strip ALL from entire directory (add -r to recurse into subdirectories)
exiftool -all= -overwrite_original -r /path/to/dir/

# Strip only GPS
exiftool -GPS:all= filename.jpg

# Strip specific fields
exiftool -Author= -Artist= -Copyright= filename.jpg

# Strip everything, then set a copyright string (order matters: -all= runs first)
exiftool -all= -copyright="Your Name" filename.jpg

# Strip everything but keep the ICC color profile (bare -all= removes it,
# which can visibly shift colors)
exiftool -all= --icc_profile:all filename.jpg

mat2 (privacy-focused, Linux/macOS)

# Audit metadata
mat2 --show filename.pdf

# Strip metadata
mat2 filename.pdf
# Outputs: filename.cleaned.pdf

# Verify the cleaned output (mat2 has no --check flag; verify by showing)
mat2 --show filename.cleaned.pdf

# Lighter-touch cleaning that preserves more file integrity
mat2 --lightweight filename.pdf

ImageMagick (images — strip and convert)

# Strip metadata on convert
convert input.jpg -strip output.jpg

# For PNG specifically (also strips tEXt chunks)
convert input.png -strip output.png

LibreOffice (documents — via command line)

# Open and re-save strips most dynamic metadata
libreoffice --headless --convert-to docx filename.docx
# Note: author name comes from LibreOffice user settings — set to pseudonym first

Git (version control metadata)

# Check current git config identity
git config user.name
git config user.email

# Set per-repo (override global for pseudonymous repos)
git config user.name "pseudonym"
git config user.email "pseudonym@example.com"

# Rewrite history to change author — use git-filter-repo (git's own docs
# deprecate filter-branch; it is slow and footgun-prone)
pip install git-filter-repo
# mailmap.txt:  New Name <new@email.com> <old@email.com>
git filter-repo --mailmap mailmap.txt
# Full identity/history playbook: references/git-metadata.md

Special Cases

Screenshots

Screenshots typically carry no EXIF GPS but may contain:

  • OS metadata (creation timestamp)
  • Filename revealing internal naming conventions
  • Visible content in the screenshot itself (separate from metadata — invoke opsec-review)

Strip with ExifTool. Low metadata risk but high content risk — review visible content separately.

Screen recordings / iOS video

iOS encodes GPS into video files recorded on device. Always strip before sharing location-sensitive recordings.

exiftool -GPS:all= -overwrite_original recording.mp4

PDFs from Word / Office

Office → PDF export embeds author name, company, template path, and software version by default. The Word document's tracked changes and comments are NOT visible in PDF but the document properties author field IS.

# Full strip
exiftool -all= -overwrite_original document.pdf
# Or use mat2 which handles PDF structure more carefully
mat2 document.pdf

Compiled Binaries

Binaries compiled with debug symbols embed full source file paths, which reveal developer username and directory structure:

/Users/realname/projects/company-name/src/auth.c

Strip debug symbols before distributing:

# macOS
strip -S binary

# Linux
strip --strip-debug binary
# or full strip
strip binary

# Go binaries (build without debug info)
go build -ldflags="-s -w" -o output ./...

# Rust (release build strips by default in Cargo.toml)
[profile.release]
strip = true

Archives (ZIP/TAR)

Archive internal paths reveal directory structure. Re-create archives from a neutral staging directory:

# Bad — reveals full path
zip archive.zip /Users/realname/projects/sensitive/file.txt

# Good — cd first, use relative paths
cd /tmp/staging && zip archive.zip file.txt

Reference Files

  • references/image-metadata.md — Full EXIF/IPTC/XMP field inventory and per-field risk ratings
  • references/document-metadata.md — Office and PDF metadata schemas with Office XML property paths
  • references/av-metadata.md — Audio/video metadata schemas including mobile-specific fields
  • references/archive-metadata.md — Archive format metadata and path sanitization
  • references/git-metadata.md — Git identity hygiene, history rewriting, and secret removal

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.