Need to comply with the EU AI Act by 2 December 2026? New users can start with Trufo's AI Labeling Service or C2PA Certificates with your first month free.

New users: AI Labeling Service or C2PA Certificates, first month free.

Guides

8. Watermarking with Pawprint

Embed Trufo Pawprint invisible watermarks so provenance survives manifest stripping, and recover manifests from stripped or re-encoded files. Covers both Managed Signing (where Trufo signs and watermarks in one call) and Standalone / In-House Signer watermarking (where you sign with your own C2PA signer and call /bind/*).


1. Choose a Route and an Allocation Mode

Route

Managed Signing Standalone / In-House Signer
Who signs the C2PA manifest Trufo Your signer (c2pa-rs, c2patool, etc.)
How the watermark is requested ["watermark", {...}] action on /c2pa/sign /bind/* routes
Cloud embedding sign_c2pa_cloud() (inline for small images, or as an asynchronous task for large files) bind_watermark() (POST /bind/watermark)
Local embedding sign_c2pa_local() with trufo[local-full], or Docker ghcr.io/trufo-ai/trufo-local:2.4-full bind_reserve() (POST /bind/reserve) + watermark_media() with trufo[local-full]
Completion Automatic bind_commit() (POST /bind/commit) with your signed manifest store

The trufo-local Docker images serve only /health and /c2pa/sign; they do not serve /bind/* or /content/*.

Allocation mode (wid_allocation_mode)

per_embed (default) per_ai_system
Watermark ID Unique wid per asset Shared ID of a registered AI system, one per AI involvement mode (AI-generated or AI-modified)
Recovery returns The stored C2PA manifest Organization and AI system details
Manifest storage Required; opting out of manifest storage returns 400 ManifestStorageRequired Compatible with opting out of manifest storage

Watermark IDs, data processing, and video compute are billed as described in Watermark Billing. To set up an AI system for per_ai_system, see 4. AI Labeling and Compliance.


2. Complete the Prerequisites

  1. A Trufo account with MFA (2. Trufo Account Setup). *-test keys need no plan or Organization Validation (OV).
  2. On production, OV is required for embedding (both Managed Signing and standalone /bind/*). Recovery-only callers (/content/recover) need only an active plan.
  3. A plan: C2PA Signing for Managed Signing; C2PA Signing or Watermark API for standalone /bind/* and for recovery.
  4. API keys (see 5. Create API Keys in 2. Trufo Account Setup):
    • Managed Signing: c2pa-sign-test or c2pa-sign-prod.
    • Standalone / in-house signer: watermark-test or watermark-prod.
    • Recovery: content-recover-test or content-recover-prod.
    • Local embedding (Python SDK or Docker): sdk-download, on both hosts.

Creating an sdk-download key requires accepting the Trufo Library License and having either an active C2PA Signing / Watermark API plan or test SDK access enabled by support@trufo.ai (without an eligible plan or test SDK access it returns 403 NoEligiblePlan). Local embedding with trufo[local-full] requires Linux and Python 3.12+; see Local Signing (Python SDK).

Check that your formats can be watermarked in Media Format Support.


3. Set Up Managed Signing Watermarking

Test

On test.api.trufo.ai, Cloud mode handles images up to 10 MB inline (the REQUEST execution mode). The asynchronous TASK execution mode runs on production hosts only, so test audio, video, and larger images with Local mode (sign_c2pa_local_test() with trufo[local-full], or the Docker image ghcr.io/trufo-ai/trufo-local:2.4-full).

from pathlib import Path

from trufo import sign_c2pa_cloud_test
from trufo.util.credentials import TrufoAPIKey, load_api_key

api_key = load_api_key(TrufoAPIKey.C2PA_SIGN_TEST)

signed_bytes = sign_c2pa_cloud_test(
    api_key,
    Path("photo.jpg").read_bytes(),
    actions=[["watermark", {"effort_policy": "require_if_supported"}]],
)
Path("watermarked.jpg").write_bytes(signed_bytes)

Checkpoint: inspect with c2patool watermarked.jpg — you should see c2pa.watermarked.bound in c2pa.actions and a c2pa.soft-binding assertion (alg: "ai.trufo.pawprint.watermark"). You can immediately test recovery on watermarked.jpg in Section 5.

Place the watermark action last, after any resize, crop, trim, or transcode actions. For per_ai_system, add an ai_system assertion and {"wid_allocation_mode": "per_ai_system"}. A full script is in watermarking.py.

Choose an effort policy

effort_policy sets what happens when a file cannot be watermarked:

  • "require" (default): fails the sign.
  • "require_if_supported": signs without a watermark only when the MIME type is unsupported; supported types that hit a per-file restriction (such as CMYK JPEG, HDR content, 1-bit TIFF, or fragmented MP4) still fail.
  • "best_effort": signs without a watermark on any watermarking failure.

Each fallback emits a TrufoServerWarning (Non-Fatal Server Warnings); see effort_policy.

Move to production

  • Cloud: switch to sign_c2pa_cloud() with a c2pa-sign-prod key. For images over 10 MB and any watermarking of audio or video, pass execution_mode=ExecutionMode.TASK (imported from trufo) and mime_type="video/mp4" (matching your input); see Cloud Signing.
  • Local: install trufo[local-full] after configuring the private package index (packages.trufo.ai) and call sign_c2pa_local(), or run the Docker image ghcr.io/trufo-ai/trufo-local:2.4-full (the 2.4 image returns 400 WatermarkNotAvailable). WatermarkSettings(profile="default" | "fast") trades video durability for speed, with "fast" roughly 5× faster on CPU; see Local Watermark Settings and Local Signing (Docker).

4. Set Up Standalone Watermarking (/bind/*)

Embed on the test host

Use Cloud embedding (bind_watermark_test()) to prototype from any platform without trufo[local-full], then sign the marked media with your own C2PA signer and commit the manifest store:

from pathlib import Path

from trufo import bind_commit_test, bind_watermark_test
from trufo.util.credentials import TrufoAPIKey, load_api_key

api_key = load_api_key(TrufoAPIKey.WATERMARK_TEST)


def sign_with_your_c2pa_signer(media: bytes, wid: str) -> bytes:
    """Sign `media` with your own signer and return the raw C2PA manifest store (JUMBF) bytes."""
    raise NotImplementedError


media_bytes = Path("photo.jpg").read_bytes()

# Cloud embedding; for local embedding (trufo[local-full]), use:
#   reservation = bind_reserve_test(api_key, "image/jpeg")
#   marked_bytes = watermark_media(media_bytes, reservation.wid_package)
result = bind_watermark_test(api_key, media_bytes)

store_bytes = sign_with_your_c2pa_signer(result.media, wid=result.wid)
bind_commit_test(api_key, result.cid, result.wid, manifest_bytes=store_bytes)
  • Production: swap to bind_watermark(), bind_reserve(), and bind_commit() with TrufoAPIKey.WATERMARK_PROD.
  • Large files, audio, and video: on production bind_watermark(), pass execution_mode=ExecutionMode.TASK and mime_type=.... On the test host, use bind_reserve_test() + watermark_media() (with trufo[local-full]) for audio and video.
  • Billing timing: /bind/watermark bills the embed when it runs, whether or not you commit. /bind/reserve bills per_ai_system embeds at reserve and per_embed IDs at /bind/commit (see Watermark Billing).

Declare the watermark in your manifest

  • per_embed: add a c2pa.watermarked.bound action and a c2pa.soft-binding assertion (alg "ai.trufo.pawprint.watermark", with one block whose value holds the UTF-8 bytes of wid as a CBOR byte string (bstr), not a text string) to the claim’s created assertions.
  • per_ai_system: pass wid_allocation_mode="per_ai_system", ai_system_id, and ai_involvement to the bind call, and record a c2pa.watermarked.unbound action with no c2pa.soft-binding assertion.

See What your own signer should declare in the manifest.

Commit

bind_commit() takes the raw manifest store bytes; POST /bind/commit takes them base64-encoded in manifest. Commit is required for per_embed (within 24 hours of embedding or reserving, or 1 hour on the test host) and optional for per_ai_system. Retry and error behavior is in POST /bind/commit.


5. Recover, Verify, and Manage Records

Recover

Test recovery against the test host first (using the watermarked.jpg you embedded in Section 3):

from pathlib import Path

from trufo import recover_content
from trufo.api.endpoints import TRUFO_API_URL_TEST
from trufo.util.credentials import TrufoAPIKey, load_api_key

recover_key = load_api_key(TrufoAPIKey.CONTENT_RECOVER_TEST)

result = recover_content(
    recover_key,
    Path("watermarked.jpg").read_bytes(),
    trufo_api_url=TRUFO_API_URL_TEST,
)
if result.detected and result.manifest_bytes:
    Path("recovered.c2pa").write_bytes(result.manifest_bytes)

For production, swap to TrufoAPIKey.CONTENT_RECOVER_PROD and omit trufo_api_url (recover_content() defaults to https://api.trufo.ai).

  • Media is sent inline as base64; there is no TASK mode or S3 upload for recovery. For long videos, recover from a shorter representative clip.
  • Production calls bill the input bytes even when the call fails with 400 UndecodableMedia, plus any returned manifest bytes.
  • detected=True with no manifest_bytes is expected for per_ai_system marks (read result.ai_system and result.ai_involvement), and for another organization’s inactive or uncommitted per_embed records.

Verify a recovered manifest

Validate manifest_bytes together with the recovered media in c2pa-rs: the signature, certificate chain, timestamp, and OCSP checks must pass, while hard-binding hash mismatches (such as assertion.dataHash.mismatch) are expected on re-encoded files. Then confirm that result.wid matches the value in the manifest’s c2pa.soft-binding assertion (pass parse_manifest_json=True to recover_content() if you use the helper in Validating a Manifest Recovered via Watermark).

Manage visibility

Every production sign or bind creates a content record. Use get_content(), list_content(), and set_content_status() with a c2pa-sign-prod or watermark-prod key (production hosts only, no plan required).

from trufo import set_content_status
from trufo.util.credentials import TrufoAPIKey, load_api_key

api_key = load_api_key(TrufoAPIKey.WATERMARK_PROD)

set_content_status(api_key, "inactive", wid="v1....")

Setting a per_embed record to "inactive" stops other organizations’ recovery calls from returning its manifest and removes the ID from active-ID billing at the next UTC daily count; your own organization can still recover it. per_ai_system records cannot be deactivated per file. See Content Records.


Next Steps

Reference