SynthDetect / issynthetic
Open-source Python library to detect whether images and videos were generated by AI, starting with metadata inspection (C2PA, EXIF/XMP, PNG chunks).
Installation
# With uv (recommended for development)
uv sync
# With pip
pip install issynthetic
# Optional: C2PA support
pip install issynthetic[c2pa]
Quick start
Python API
import issynthetic as is_ai
result = is_ai.inspect("image.png")
print(result.is_generated) # True, False, or None (uncertain)
print(result.confidence) # 0.0 – 1.0
print(result.generator_name) # e.g. "Automatic1111", "DALL-E 3"
print(result.details) # raw metadata dict
CLI
issynthetic inspect image.png
issynthetic inspect image.png --json
issynthetic export-unknown --format json
issynthetic sync-rules
issynthetic config --show
Hybrid metadata learning
The library uses a four-layer system to expand detection rules over time:
| Layer | Default | Description |
|---|---|---|
| Local observations | On | Records unknown tag names in ~/.local/share/issynthetic/ |
| Rules pull | On | Downloads updated rules.json every 7 days |
| Telemetry | Off | Opt-in anonymized contribution (issynthetic config --enable-telemetry) |
| Manual export | Always | issynthetic export-unknown for PR contributions |
See PRIVACY.md for details on what data is stored and sent.
Architecture
- Inspector orchestrates extractors in priority order: C2PA → PNG → EXIF → Video
- RulesStore merges bundled, remote, and user rules; evaluates matchers
- Extractors implement a plugin interface (
BaseExtractor) for extensibility
Development
uv sync
uv run pytest
uv run ruff check .
uv run mypy src
uv build
Test corpus
Synthetic cases run in CI via tests/corpus/manifest.json. Optional real images go in tests/fixtures/corpus/ (see README there).
uv run pytest tests/test_corpus.py -v
uv run pytest tests/test_metadata_contract.py -v
Release
Semi-manual flow with automatic GitHub Release on tag push:
# 1. Bump version in pyproject.toml (PR → merge)
# 2. Tag and push:
git tag v0.1.1
git push origin v0.1.1
GitHub Actions will:
- Verify tag matches
pyproject.toml(scripts/check_version_tag.py) - Run lint, typecheck, and full test suite (including metadata contract + corpus)
- Build wheel/sdist and attach
rules.jsonto the GitHub Release
Verify locally before tagging:
uv run python scripts/check_version_tag.py --tag v0.1.1
PyPI publishing is prepared but disabled in .github/workflows/release.yml until PYPI_TOKEN is configured.
Zero-cost architecture
| Component | Default | Network |
|---|---|---|
| Local observations | On | No |
| Rules sync | On | Pull only (GitHub Releases) |
| Telemetry | Off | Opt-in only |
| Export manual | Always | No |
Rules are fetched from releases/latest/download/rules.json — no custom server required.
Roadmap
- Phase 1 (current): Metadata inspection (C2PA, EXIF/XMP, PNG text chunks, video stubs)
- Phase 2: Visual forensics (frequency analysis, artifact detection, ML classifiers)
License
Apache License 2.0 — see LICENSE.
Metadata
Release files for issynthetic 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| issynthetic-0.1.0.tar.gz | 28.1 kB | Without provenance | Details for issynthetic-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| issynthetic-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for issynthetic-0.1.0-py3-none-any.whl |
Total release size: 57.0 kB
Release files / issynthetic-0.1.0.tar.gz
| Download URL | issynthetic-0.1.0.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38d59004b89f0db8204499cc3d4fc4721874cbe01d6fb9ef0651cc70e1bbd676
|
|
BLAKE2b-256 checksum How to use checksums |
f3d65e970a14ba7000061f890a923bba23329cd9fed843966bb3c8b9213a5e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / issynthetic-0.1.0-py3-none-any.whl
| Download URL | issynthetic-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c31e82a15724597541b3c781be26363a30c344be13af1286d3b985bd62f74e86
|
|
BLAKE2b-256 checksum How to use checksums |
ed1818ef92d39c21ba240a50d74d8a22348d4944aae3e76845e149ece1a96ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Security for issynthetic 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.