---
name: c2pa-provenance-audit
description: Inspect, audit, and sign C2PA Content Credentials manifests on AI-generated images and MP4 video deliverables using the official contentauth c2patool CLI without accidentally stripping provenance metadata during post-production.
---

# C2PA Content Credentials & Provenance Audit Protocol

Whenever auditing media provenance or preparing client-facing AI deliverables that require verifiable C2PA Content Credentials, follow these exact rules:

## 1. Verify `c2patool` Availability First
Check local installation before running manifest commands:
```bash
which c2patool && c2patool -V
```
If missing, instruct the user to install via `brew install c2patool` (macOS) or `cargo install c2patool` / GitHub Releases (`contentauth/c2patool`).

## 2. Inspect Existing Content Credentials (Read-Only)
- **Summary JSON report:**
  ```bash
  c2patool asset.png
  ```
- **Detailed JUMBF box inspection:**
  ```bash
  c2patool asset.mp4 -d
  ```
- **External sidecar verification:**
  ```bash
  c2patool asset.mp4 --external-manifest asset.c2pa
  ```
Report cleanly: active claim generator (the vendor tool or model that signed the file), `digitalSourceType` (`trainedAlgorithmicMedia`), signing certificate status, and any `validation_status` errors (such as hash mismatches caused by post-hoc re-encoding).

## 3. Re-Encoding Stripping Warning (FFmpeg & Editors)
FFmpeg transcoding, `sharp` WebP conversion, and most social re-encoders **strip or invalidate embedded C2PA JUMBF manifests** because pixel hashes change. Always:
1. Archive the untouched raw vendor outputs (`./raw_vendor/`) with intact original C2PA manifests.
2. After final FFmpeg/Resolve conform, sign the finished delivery master referencing the original raw file as `-p <parent_asset>` (or list ingredients inside `manifest.json`) rather than claiming a broken hash is valid.

## 4. Production Signing vs. Test Certificate Guard
- Signing command:
  ```bash
  c2patool final_master.mp4 -m studio_manifest.json -p raw_source.mp4 -o final_master_signed.mp4
  ```
- **NEVER ship client deliverables signed with `c2patool`'s built-in development test certificates.** Explicitly verify that `private_key` and `sign_cert` point to a real trusted X.509 certificate chain (`alg: "es256"` + valid `ta_url` RFC 3161 timestamp authority) and keep private keys out of Git.
