W3C AI KR Community Group · trust work · pull request #25

Key and evidence states

A cartoon guide to ten test cases that check how software should decide whether to believe a signed statement when keys get old, replaced, revoked or hard to look up.

Proposed for merge · open for comments on public-aikr

Why these tests exist

When software receives a signed statement, the honest answer to “is this genuine?” is sometimes yes, sometimes no, and sometimes “I can’t tell right now”. The key may be an old one that was valid when it signed. The list of keys the software holds may be out of date. The place that publishes the keys may be offline.

These tests pin down, case by case, what a careful checker should conclude. Each case has fixed inputs and an expected answer written by hand, so two pieces of software built by different people can be run on the same inputs and compared. The rule the whole set defends: a check that could not be completed is never quietly counted as a yes, and never quietly counted as a no.

The idea came from Nicholas Templeman, replying on the public-aikr list to the group’s note on the DNS root KSK rollover of 11 October. A rollover is a real case of an old key handing over to a new one. Nicholas asked for a “fixture table”. In software testing a fixture is a fixed, prepared input that a test always runs against, so everyone gets the same result. A fixture table lists those inputs row by row, with the answer each should produce. Kenne Ives wrote the table and turned it into runnable tests. The keys here are invented for practice. Nothing in the set touches real DNS.

Story version

Imagine a town where people send letters, and every letter is sealed with wax pressed by a key. Each family has its own key. Keys wear out, so every year a family gets a new key, and the old key writes a little signed note saying “this is my successor, trust the new one”.

At the castle gate a guard reads every letter before letting it in. She asks four things. Is this seal really from this family’s key? Was the key allowed to be used on the day the letter was sealed? Has anyone reported the key stolen? Is my list of keys fresh enough to know?

If everything checks out, the letter goes through the green door. If something is definitely wrong, it goes through the red door. And sometimes she simply can’t tell, so the letter waits on the bench. She never pretends that “I couldn’t check” means yes, and never pretends it means no.

Who is who

KeyA signing key belonging to some identifier: an organisation, a service or an AI agent. The set keeps the owner abstract.
EnvelopeA signed statement. Any claim that someone stamped with that key.
GatekeeperThe checking software of whoever receives the statement and must decide whether to rely on it.
DoorsThe decision. In the group’s trust ontology these map to krt:Yes, krt:No and krt:Unknown.
pass · admitfail · refusecould not determine · hold

Green means “this was signed by a valid key for that identifier”. What happens after the green door is left open on purpose. A pass grants no authority to act, so an agent admitted here still needs separate permission for whatever it wants to do.

Ten cases

Every case is judged at the same instant, 11 October 2026 at midnight UTC. The checker’s key list counts as fresh for 24 hours.

Testing the gatekeeper

Getting the right answers on ten cases could be luck. So the set also tampers with cases that passed, one change at a time, and the verdict has to move to refuse or hold. If a checker still says yes after a forged byte, it is broken.

Running the tests

You need Python 3.12 or later and two packages. Until the pull request is merged, the files live on Kenne Ives’s branch.

  1. Fetch the branch and move into the test folder.
  2. Make a private Python environment and install the two packages.
  3. Run the checker.
git clone -b trust/key-evidence-states-v0 https://github.com/kenneives/aikr.git
cd aikr/trust/key-evidence-states-v0
python3 -m venv .venv && . .venv/bin/activate
pip install cryptography rfc8785
python check.py

The checker first confirms that no fixture file has been altered, then runs the ten cases and eleven tamper tests and compares every answer with expected.json. Add -v to see all eight checks for every case.

21 / 21match expected.json when run on 30 October 2026 with Python 3.13. Fixtures matched their recorded fingerprints.
ok   C04  could-not-determine  hold    STALE_LOOKUP
       freshness       could-not-determine  STALE_LOOKUP
ok   C05  fail                 refuse  NO_LINEAGE
ok   M01  fail                 refuse  BAD_SIGNATURE

Someone who has written their own checker in another language can skip check.py and compare their results with expected.json directly. That comparison is the main use of the set.

What the tests leave open

  • No real DNSSEC, DANE or DID method is implemented. Mapping these rows onto a real DNSSEC chain is separate work.
  • A pass says a key signed some bytes. It says nothing about who now holds the name, or about authority to act.
  • A key office that quietly deletes a revocation from its list is not caught.
  • The timestamp service is trusted as given, and only one handover link is tested.
  • The rules are one profile’s choices, written down so the group can dispute them. Case C05 is the main candidate.

Terms

Plain meanings of the words used in the pull request and its README.

Fixture
A fixed, prepared input that a test always runs against. Here the fixtures are invented keys, key lists and signed statements, kept in the fixtures folder.
Fixture table
A table listing each fixture with the result it should produce. “Templeman’s fixture table” means Nicholas’s proposal for such a table. It is not a named standard.
Relying party
Whoever receives a signed statement and has to decide whether to rely on it. The gatekeeper in the cartoon.
Signing key
A private key makes signatures and its public partner lets anyone check them. The test keys use the Ed25519 method and protect nothing.
Validity interval
The period during which a key may be used to sign. Last year’s key here served from January 2025 to April 2026.
Anchor
The one key the checker trusts from the start. Every other key must link back to it. At the DNS root the KSK plays this role.
Lineage
A handover note, signed by an old key, naming its successor. Without it a new key has no proven link to the anchor.
Revocation
A signed notice that a key must not be trusted from a stated moment onward (its effectiveFrom time).
Key history
The document the key office publishes: the keys, the handover notes and the revocations.
Lookup and as-of time
Fetching the key history from its source. The as-of time records when that fetch happened.
Staleness bound
How old a fetched key history may be before the checker stops relying on it. Here, 24 hours.
Evaluation instant
The fixed moment every case is judged at, so results never depend on the day you run them.
Timestamp token
A signed record from an independent service saying a statement existed at a given time. A date the sender writes in does not count.
Digest (SHA-256)
A short fingerprint computed from a file. Changing a single byte changes it, so it reveals tampering.
JCS (RFC 8785)
A fixed byte layout for JSON data, so the bytes that get signed are the same on every computer. The rfc8785 package does this.
Three-valued result
Pass, fail, or could-not-determine. The third value is never folded into either of the others.
Positive control
A case built to pass (C01). It shows the checker can say yes when it should.
Mutation control
Take a passing case, change one thing, and the verdict must flip. The M cases.
KRT
The group’s KR for Trust ontology (krt.ttl in the trust folder). The README maps each row to its terms.
DNSSEC, KSK, rollover
DNSSEC signs DNS records in a chain of trust. The root key-signing key (KSK) anchors that chain. On 11 October the root switched from KSK-2017 to KSK-2024.

Sources

Pull request #25 and its README · Nicholas Templeman’s proposal on public-aikr · Root KSK rollover note · Issue #16, trust evidence next steps