Declaring how content was made
Three attributes describe a page or any part of it. Each answers one question.
| Attribute | Question | Values | Default look |
data-provenance |
How was this made? |
human, ai-assisted, ai-generated; add translated, synthesized or migrated after a space |
human shows nothing. ai-assisted adds a coloured edge at the start of the line. ai-generated adds the edge and a faint tint. |
data-review |
What review did it get? |
unreviewed, fact-checked, editor-reviewed |
fact-checked and editor-reviewed recolour the edge that data-provenance draws, each with its own colour. On content with no edge they show only with labeled. unreviewed shows nothing. |
data-status |
Is it published? |
draft, published, archived |
draft has a dashed border. archived is dimmed. |
<html lang="en" data-provenance="human">...<article> <h1>Booking a flu vaccination</h1> <p>Riverside Clinic gives flu vaccinations from October to February.</p> <section data-provenance="ai-generated translated" data-review="fact-checked" class="labeled"> <h2>Resumen en español</h2> <p>La clínica ofrece vacunas contra la gripe de octubre a febrero.</p> </section></article>
Add the labeled class to print the value as a small badge above the content. Without it the signal is the edge and tint only.
For a whole page, say the same thing in the <head> with vb:provenance, vb:review, vb:status and vb:ai-tools. Page Metadata lists every tag. <page-info> shows them to the reader, and <trust-filter> lets a reader filter a list of pages by them.
Who made an edit
On <ins> and <del>, data-author names who made the change and data-reason says why. The reason shows as a small label before the change. The author appears after it when the reader points at the change or moves focus into it, and always on touch screens. Showing Changes covers tracked edits.
<p>Appointments take about <del data-author="draft-tool" data-reason="correction">twenty</del> <ins data-author="tokafor" data-reason="review">ten</ins> minutes.</p>
Signing a page
A signed page carries four extra tags. <page-info> looks for them every time it connects and runs the check with the browser's Web Crypto API.
<meta name="vb:hash" content="sha256-..." /><meta name="vb:signature" content="..." /><meta name="vb:signature-algorithm" content="ECDSA-P256-SHA256" /><link rel="author-key" href="/.well-known/content-keys/newsroom.jwk" data-key-id="newsroom" />
What is signed
The signature covers a fixed summary of the page, not its raw HTML, so reformatting the markup does not break it. The summary holds:
- the canonical URL, title, author, author URL, published and modified dates, version, keywords, concepts, provenance, review, status and license, all read from the
<head>
- the text of every element marked
data-signable
Put data-signable on the <article> or <main> that holds the content. Inside it, navigation, headers, footers, asides, forms, buttons, dialogs, figure captions, hidden elements, scripts and the library's own page furniture (<page-info>, <page-toc>, <page-stats>, <page-tools>, <content-lens>) are left out. Deleted text in <del> is left out. Inserted text in <ins> is included. Text inside a <change-set> follows the same rule: the unchanged text and the insertions are signed, and the caption and buttons the component adds are not. Mark a part with data-signable="false" to leave it out.
The browser builds the summary from the page as it stands when the check runs. A script that rewrites text inside the signed region will make the check fail, which is the point, so keep client-side text changes out of that region.
The signing step
The repository has two reference scripts. They are not in the published npm package: copy them, or write your own to the same format.
| Script | What it does |
scripts/generate-key.js |
Makes an ECDSA P-256 key pair. Writes the public half as a JWK file to publish and the private half to a folder kept out of version control. |
scripts/sign-pages.js |
Walks a folder of built HTML, signs each page that has data-signable content, and adds the four tags. Pages that already have a signature are skipped. The private key path comes from the VB_PRIVATE_KEY_JWK environment variable. |
node scripts/generate-key.js --kid newsroom --owner "Riverside Clinic" --domain example.orgVB_PRIVATE_KEY_JWK=.vb-keys/newsroom.private.jwk node scripts/sign-pages.js dist --strict
Run the signer last, after every step that changes page text. Without --strict it logs a page it cannot sign and carries on.
This site signs its pages on every build with a demonstration key whose private half is in the public repository. A Verified
badge here shows the mechanism working. It says nothing about who published the page.
What a passed check proves
| It proves | It does not prove |
| The signed text and metadata have not changed since signing |
That the content is accurate |
| The signature was made with the private half of the key the page links to |
That the key belongs to the named author |
| The key is published on the same origin as the page and has not passed its expiry date |
That the key has not been stolen or copied |
|
That AI was not used. Only the declaration speaks to that, and it is self-reported. |
The check guards against a page being altered after publication by a cache, a proxy or an edit to the stored file. It does not guard against whoever controls the page replacing the content, the signature and the key link together. A reader who wants more than that has to trust the key through some other route.
The key link must point at the page's own origin. A key on any other host is not fetched and the check fails. There is no way to allow another host.
A key file can carry an expiry date in metadata.expires, which generate-key.js sets a year ahead. A date such as 2027-01-01 means the key stops being accepted at the start of that day, UTC. The date is compared with the reader's clock, not with the time of signing, so make a new key and sign the site again before the old one expires. A key file with no expiry date is accepted indefinitely.
The check also reads the vb:hash tag. When the tag is present its value must equal the SHA-256 of the summary, or the check fails. The signature covers the same bytes, so the hash adds no protection of its own. It is there so that other tools can compare a page against a known value without the key.