Skip to main content

04 - AI Watermarking: Techniques and Regulatory Mandates

From 2 August 2026 Article 50 requires AI-generated content to be marked: what it provides, the code of practice, and a text watermark you can test yourself.

What do you think about this article?

04 - AI Watermarking: Techniques and Regulatory Mandates
AI Policy EUPhoto:Tara WinsteadPexels

At a Glance

From 2 August 2026 Article 50 requires AI-generated content to be marked: what it provides, the code of practice, and a text watermark you can test yourself.

Marking AI-generated content: what the rule asks and what the technique can do

If your system generates text, images, audio or video, from 2 August 2026 Article 50(2) of the AI Act requires you to mark the outputs in a machine-readable format and make them detectable as artificially generated or manipulated. The same rule asks for solutions that are "effective, interoperable, robust and reliable as far as this is technically feasible". For whoever writes code, the important phrase is the last one: the rule does not indicate a technique, and no technique alone is tamper-proof.

For generative systems already on the market before 2 August 2026 there is a grace period: Article 111(4) gives until 2 December 2026 to comply with paragraph 2. In this article you see what Article 50 establishes, what the Code of Practice on the transparency of AI-generated content proposes, how a statistical watermark for text works (with a program you can rerun) and why the code asks for at least two layers of marking. In the first article you find the full calendar; the previous article, on general-purpose models, explains who produces the model from which the content to be marked often originates.

What Article 50 says, and who it addresses

Article 50 splits the obligations between providers and deployers. The provider marks; the deployer discloses. It is worth keeping them apart, because a company can be both.

  • Paragraph 1, providers of systems that interact with people: design them so that the people concerned are informed that they are interacting with an AI, unless this is obvious to a reasonably well-informed person.
  • Paragraph 2, providers of systems that generate synthetic audio, image, video or text content: mark the outputs in a machine-readable format and detectable as artificial. The obligation does not apply to systems that perform an assistive function for standard editing or do not substantially alter the input data or its semantics.
  • Paragraph 4, deployers: disclose that a deep fake has been generated or manipulated; disclose that a text published with the purpose of informing the public on matters of public interest has been generated, unless it has undergone human review or editorial control and a person holds editorial responsibility for it.
  • Paragraph 5: the information must be provided in a clear and distinguishable manner at the latest at the time of the first interaction or exposure, and must conform to the applicable accessibility requirements.

It follows that marking and disclosing are two different operations: the watermark is information for machines, the notice to people is information for whoever reads or watches. An editorial platform that uses a third-party generative system may have to do the second even if the provider has done the first. Infringing the transparency obligations of Article 50 is among the violations punished with a maximum of EUR 15 000 000 or 3% of total worldwide annual turnover, whichever is higher (Article 99(4), point (g)).

The code of practice: two layers, at least

Article 50(7) provides that the Commission encourages and facilitates codes of practice on marking and labelling. The published code has two sections: rules for marking and detection for providers, rules for labelling for deployers. Adhering is voluntary, but whoever adheres can use its measures to demonstrate compliance, while whoever chooses other routes must demonstrate that they are adequate, case by case, before different market surveillance authorities. The Commission page reports that about 190 organisations had signed it by the end of July 2026.

The technical part is in Measure 1.1. As long as no single technique can ensure by itself the four requirements (effectiveness, interoperability, robustness and reliability) for audio, images, video and containerised text, signatories apply at least two layers of machine-readable marking: digitally signed metadata and an imperceptible watermark. A third layer, fingerprinting or logging, is optional and not sufficient on its own. Free-form text is the exception: it cannot carry metadata, so the watermark layer alone is enough, applied also to text longer than 200 tokens, with the warning that reliability is lower than for very long text. Whoever offers it must make a detection tool available free of charge, with a reasonable allowance for providers with fewer than 1,000,000 monthly users whose detection has substantial operating costs.

The logic of the two layers is defence in depth: metadata are precise and verifiable but sit next to the content, not inside it, and a format conversion or a screenshot may not carry them along; the watermark is in the content itself and survives more transformations, but it is not infallible. For metadata an open specification exists, C2PA (Content Credentials), which defines a digitally signed, tamper-evident manifest bound to the content. The code speaks of open standards for metadata without naming one: C2PA is an example of an open specification, not a prescription.

How a statistical watermark for text works

The most cited watermark for language models is the one by Kirchenbauer and co-authors (2023). At every generation step, a pseudorandom generator, seeded by a key and the previous token, splits the vocabulary into a "green" list (a fraction γ) and a "red" one. Before sampling, a boost δ is added to the logits of the green tokens. The resulting text contains more green tokens than would be expected by chance. Whoever knows the key does not need the model: for every token they recompute whether it is green and run a statistical test. With T tokens and G green ones the statistic is z = (G − γT) / √(Tγ(1−γ)); the paper proposes a threshold of z = 4 to declare the presence of the watermark.

The following program implements it on a toy "model": the logits are drawn from a normal distribution with a fixed seed, there is no language model at all. It serves to show the mechanics and its limits, not to estimate real performance. The verde ("green") function uses SHA-256 and not Python's hash(), which for strings changes at every start and would make the test unrepeatable.

"""Statistical 'green list' watermark (Kirchenbauer et al., 2023) on a toy model.
No language model: the 'model' is a pseudorandom distribution over a synthetic vocabulary."""
import hashlib, math, random

VOCAB = 1000          # synthetic tokens 0..999
GAMMA = 0.5           # share of the vocabulary that is 'green' at every step
DELTA = 2.0           # boost on the logit of green tokens
CHIAVE = b"chiave-del-fornitore"   # arbitrary key, kept as is: changing it changes every z below

def verde(prev, tok):
    """Is token tok green given the previous token? Depends on key and context."""
    h = hashlib.sha256(CHIAVE + prev.to_bytes(4, "big") + tok.to_bytes(4, "big")).digest()
    return h[0] < 256 * GAMMA

def genera(n, filigrana, seme):
    rng = random.Random(seme)
    testo, prev = [], 0
    for _ in range(n):
        logit = [rng.gauss(0, 1) for _ in range(VOCAB)]
        if filigrana:
            logit = [x + DELTA if verde(prev, t) else x for t, x in enumerate(logit)]
        m = max(logit)
        pesi = [math.exp(x - m) for x in logit]
        tok = rng.choices(range(VOCAB), weights=pesi)[0]
        testo.append(tok)
        prev = tok
    return testo

def z_score(testo):
    verdi = sum(verde(p, t) for p, t in zip([0] + testo[:-1], testo))
    T = len(testo)
    return (verdi - GAMMA * T) / math.sqrt(T * GAMMA * (1 - GAMMA))

def attacco(testo, quota, seme):
    """Replaces a share of the tokens with random tokens (crude paraphrase)."""
    rng = random.Random(seme)
    return [rng.randrange(VOCAB) if rng.random() < quota else t for t in testo]

N = 200
con = genera(N, True, seme=1)
senza = genera(N, False, seme=2)
print(f"without watermark, {N} tokens: z = {z_score(senza):5.2f}")
print(f"with watermark,    {N} tokens: z = {z_score(con):5.2f}")
for quota in (0.1, 0.3, 0.5, 0.7):
    print(f"with watermark, {int(quota*100):>2}% of tokens replaced: z = {z_score(attacco(con, quota, 3)):5.2f}")
print(f"with watermark, first 20 tokens only: z = {z_score(con[:20]):5.2f}")

# Output (python3 -I, Python 3.14.4):
# without watermark, 200 tokens: z =  0.42
# with watermark,    200 tokens: z = 11.03
# with watermark, 10% of tokens replaced: z =  8.77
# with watermark, 30% of tokens replaced: z =  6.22
# with watermark, 50% of tokens replaced: z =  2.69
# with watermark, 70% of tokens replaced: z =  1.27
# with watermark, first 20 tokens only: z =  2.68

The text without a watermark has z close to zero, as expected for a random choice with γ = 0.5. The text with a watermark, over 200 tokens, has z ≈ 11, well beyond the threshold of 4. Then the attack, which in this case is a random replacement of tokens (the "lexical substitution" category in the code's list of typical alterations): at 10% and 30% the watermark is still detectable; at 50% z falls to about 2.7, below the threshold; at 70% it is indistinguishable from noise. Each replacement damages two (token, previous) pairs, because each token depends on the previous one: this is why the drop is faster than the percentage suggests. The last line shows the other limit: on only 20 tokens z is about 2.7, so a short text cannot be certified. It is consistent with the code's choice not to require the watermark on very short texts and to warn that reliability on free-form text is lower.

Two caveats on the value of these numbers. The first: they are measurements on a toy model with Gaussian logits, hence high entropy, which is the case most favourable to the watermark; on real text, and in particular on source code, where many tokens are almost forced, the signal is weaker (the paper discusses low-entropy cases in which the watermark is not detected). The second: a paraphrase by another model is a stronger attack than random replacement. The code of practice lists among the alterations to consider lexical substitution, homoglyphs, paraphrasing and translation cycles.

What to implement, and what not

If you are the provider of a generative system, the concrete route is to ask the model provider whether it offers a watermark at model or inference level (the code encourages model providers to do so, also to help those downstream), and in any case to add signed metadata. The code admits that the techniques may be supplied by third parties or by the upstream model provider, without this relieving the system provider of its own responsibility to ensure that the outputs are marked compliantly. For images and video the two families are signed metadata (C2PA is an open specification) and watermarks embedded in the content, which I have not measured; for text the statistical watermark is the one documented by the cited paper, with the limits above.

Two things are not needed, or not enough. A "generated by AI" text field in the HTML is a notice for people, not a robust machine-readable marking. A register of generated content (logging) can accompany the marking, but the code expressly says that relying on fingerprinting or logging alone is not enough. And there is no shortcut in the contract: no clause transfers to the customer an obligation that the regulation places on the provider.

Frequently asked questions

Is a watermark for text really invisible?

It does not alter the form of the words, but it alters the distribution of the tokens chosen: Kirchenbauer's idea is precisely to push the choice towards green tokens without a reader noticing. The impact on quality depends on the boost δ and on the entropy of the text. It is a characteristic of the method, not a guarantee of the regulation.

Can I generate content without marking if the user asks me to?

The obligation of Article 50(2) belongs to the provider and does not provide for a waiver by the user. The only exceptions in the text are systems that perform an assistive function for standard editing, those that do not substantially alter the input data or its semantics, and cases authorised by law to detect, prevent, investigate or prosecute criminal offences.

If I use an API that already marks content, am I covered?

It can be one part of the solution, but the code of practice says that using third-party techniques does not relieve the system provider of its own responsibility. Check with your provider which formats and which detection tools it offers.

Does a text written with AI and reviewed by an editor have to be disclosed?

The disclosure obligation for texts published with the purpose of informing the public on matters of public interest does not apply if the content has undergone human review or editorial control and a natural or legal person holds editorial responsibility (Article 50(4)). It is a deployer obligation, and it concerns that type of text, not every text.

Does the watermark survive compression or resizing?

It depends on the technique and on the type of content. I have not measured watermarks on images or audio for this article. The code of practice asks signatories to test robustness against typical alterations such as recompression, screenshots, cropping, resizing and paraphrasing (Measure 3.3).

What you can do now

You can tell the obligation to mark, which belongs to the provider under Article 50(2), from the obligation to disclose, which belongs to the deployer; you know what the providers' section of the code of practice provides (two layers, free detection, text as the exception); you can measure with a z test whether a text carries a statistical watermark and how much an attack reduces its signal; and you know when a text is too short to be certified. In the next article you move from content to data: the intersection of the GDPR and the AI Act. For the risks of model misuse, a complementary read is Guardrail landscape 2026.

Sources

The listing was run with Python 3.14.4, with identical output in two runs; the "model" is a pseudorandom generator, not a language model, and the z values do not describe real performance. The full content of the code and the C2PA specification were not read in full: the passages cited were read.

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects