Countersign lets an authority state, with a signature, that a peer agentic site is a legitimate source for a named scope. It also lets the authority revoke that statement. A caller's browser runtime checks the statement at the consent card, before it contacts the peer.
Every competitor we surveyed in the gallery (2026-12-06) checks integrity: are the peer's files unchanged, conformant, and free of injection? Countersign checks authority: has someone the caller trusts said this peer is an official source for this topic, and has that been revoked? A site cannot sign its own authority: a lookalike portal can sign its own files, but it cannot get an anchored authority's key to sign for it.
Countersign is additive. It never changes agent-manifest.json, links.json or the network file, and a runtime without it behaves exactly as before.
1. Roles
| Role | Who | Publishes |
|---|---|---|
| Authority | Any HTTPS origin, for example a scholarship board | /.well-known/countersign-authority.json |
| Subject | An agentic site with one or more networks | /.well-known/countersign.json (optional but recommended) |
| Caller | A site whose runtime is about to contact a subject | Its anchors: the authorities it trusts, and for which scopes |
There is no central registry. Trust is rooted in each caller's anchors, the way a browser's root store works. An origin is identified by its exact serialization: scheme, host, and port if it isn't the default (https://example.org). Only https origins are accepted, except plain http on loopback hosts for local development.
2. Endorsement token
An endorsement is a compact JWS (RFC 7515) signed with ES256 (ECDSA P-256 with SHA-256, via WebCrypto). The signature is the raw 64-byte r||s form, base64url-encoded.
Protected header:
{ "alg": "ES256", "kid": "<key id from the authority file>", "typ": "countersign-endorsement+jwt" }
Payload:
{
"cs": "0.1",
"jti": "end-2026-0003",
"iss": "https://scholarship-board.sidkhuntia.in",
"sub": "https://sahyadri-education.sidkhuntia.in",
"net": "sahyadri_scholarships",
"scope": ["scholarship.eligibility", "scholarship.state-schemes"],
"iat": 1765000000,
"nbf": 1765000000,
"exp": 1782000000,
"pin": { "network_sha256": "<optional hex SHA-256 of the network JSON bytes>" },
"note": "Official state partner for the national scholarship programme."
}
issmust equal the origin that serves the authority file holdingkid.subis the subject's exact origin.netis a network name, or"*"for every network at that origin.- Times are in seconds (NumericDate). Scope ids are dotted lowercase strings.
pinis optional. When it is present, a caller that can fetch the network file must compare hashes. If they differ, the verdict ispinned-mismatch. Pinning is stronger, but every legitimate edit breaks the endorsement, so the default is not to pin.- Unknown payload fields are ignored. Unknown
csmajor versions are rejected.
3. Status token (revocation)
A status token is a compact JWS with typ: "countersign-status+jwt", signed by a current authority key:
{
"cs": "0.1",
"iss": "https://scholarship-board.sidkhuntia.in",
"iat": 1765000000,
"exp": 1765604800,
"revoked": [
{ "jti": "end-2026-0002", "revoked_at": 1764900000, "reason": "Charged students fees for a free scheme." }
]
}
exp works like a CRL's nextUpdate. Once it passes, the list is stale, and every verdict that relies on it becomes unverifiable, never endorsed. A revocation in a stale list still counts, because a revocation never un-happens. Authorities re-sign the token on a schedule (the demo uses 7 days; --status-days sets it).
4. Authority file: /.well-known/countersign-authority.json
{
"countersign": "0.1",
"issuer": "https://scholarship-board.sidkhuntia.in",
"name": "Demo National Scholarship Board (fictional)",
"description": "…",
"keys": [
{ "kid": "board-2026-12", "alg": "ES256", "jwk": { "kty": "EC", "crv": "P-256", "x": "…", "y": "…" } }
],
"scopes": [ { "id": "scholarship.eligibility", "label": "Scholarship eligibility information" } ],
"status": "<compact JWS status token>",
"endorsements": [
{
"jws": "<compact JWS endorsement>",
"title": "Sahyadri State Education Department (fictional)",
"network_url": "https://sahyadri-education.sidkhuntia.in/sahyadri_scholarships",
"description": "State-level scholarships for Sahyadri residents.",
"sample_queries": ["Which state scholarships can a first-generation learner get?"]
}
],
"cache_ttl": 300,
"updated": 1765000000
}
The endorsements array is a directory: it supports discovery ("which sources does this authority vouch for?") with no crawler. Its unsigned display fields are hints only. A caller trusts only what is inside a verified jws. An authority keeps a revoked endorsement in its directory until the endorsement expires, so that callers still find the revocation when the subject stops publishing the token.
5. Subject file: /.well-known/countersign.json
{
"countersign": "0.1",
"subject": "https://sahyadri-education.sidkhuntia.in",
"endorsements": [ { "issuer": "https://scholarship-board.sidkhuntia.in", "jws": "…" } ]
}
A subject carries its own endorsements, so a caller can find them without already knowing every authority. The caller still fetches the issuer's authority file, for its keys and its status token, and accepts only issuers among its anchors.
Both files must be public GET with Access-Control-Allow-Origin: * and no credentials, the same as the spec's other public files.
6. Caller anchors
[
{ "origin": "https://scholarship-board.sidkhuntia.in",
"name": "Demo National Scholarship Board",
"scopes": ["scholarship.*"],
"kids": ["board-2026-12"] }
]
scopes limits what this caller trusts the anchor for, with a trailing .* matching any sub-scope. If it is omitted, the caller trusts all of the anchor's scopes. kids is optional key pinning. Anchors come from the publisher's configuration, and a visitor may add or remove anchors locally. A visitor can never silently turn an untrusted issuer into a trusted one: a locally added anchor is labelled as such on the card.
7. Verification (deterministic, never the model)
Input: the peer's origin O, the network name N (possibly unknown), the anchors, and now.
- Collect candidate tokens from
O/.well-known/countersign.json, and from each anchor's authority file entries whosesub == O. Remove identical duplicate tokens. Each fetch times out after 4 s. A missing subject file (404) is not an error. Tokens whosesubis notO, or whosenetis neitherNnor"*", are not about this peer: they are listed in the trace and ignored before any signature check, so a lookalike gains nothing by copying another site's token. - For each candidate token, decode it and require
alg == "ES256"and the righttyp. Look up the authority file atiss, requireissuer == iss, findkid, and verify the signature. A bad signature, or akidthe issuer does not publish, on a token whoseissis an anchor makes the verdictinvalid. The same failure on a token from an issuer that is not anchored only counts asuntrusted-issuer(unverified). - Verify the status token the same way. Require
now < exp, or the verdict isunverifiable(stale). - Check
sub == O, thatnetisNor"*"(ifNis unknown, match on origin and flag it), andnbf <= now < exp(if this fails,expired). - If
jtiis in the issuer'srevokedlist, the token isrevoked. - Keep tokens whose
issis an anchor, whosekidis pinned ifkidsis set, and whose scopes intersect the anchor's scopes. Tokens with a valid signature from an issuer that is not anchored count asuntrusted-issuer. - If
pinis present and the network file can be fetched, compare SHA-256. A mismatch givespinned-mismatch.
Verdict, in order of precedence:
revoked (any anchored revocation for O/N) › invalid › endorsed (at least one valid anchored token) › pinned-mismatch › expired › untrusted-issuer › unverifiable (fetch failed or status stale) › unendorsed (nothing found).
Every verdict carries a step-by-step trace, so the outcome can be shown and audited.
8. Policy at the consent card
| Verdict | inform (default) | strict |
|---|---|---|
| endorsed | card shows "Endorsed by X for: …, until …" | allow card |
| revoked / invalid | auto-decline, visible reason in chat | auto-decline |
| pinned-mismatch, expired, untrusted-issuer, unendorsed | card shows a warning; visitor decides | auto-decline |
| unverifiable | card shows "couldn't check"; visitor decides (never shown as endorsed) | auto-decline |
This is fail-closed for trust, not for the visitor's choice. The kit never reports an unchecked peer as endorsed, and anything it blocks is shown as blocked. Anything else is left to the visitor's informed consent, the same as the spec's §5. The spec's own fail-closed rules (an invalid network, a denied origin, limits) are unchanged, and the runtime still enforces them.
"Always allow" stays in effect for the visitor's session, but the verdict is re-checked on every call, so a revocation takes effect within cache_ttl. The kit keeps this memory itself and returns "allow" to the runtime, so the runtime keeps asking it. A remembered host is allowed without a card only while its verdict is endorsed or unchanged; a block always wins, and any other change shows the card again. If the visitor clicks Allow while the check is still running, the kit waits for the verdict before it answers.
9. Honest limits
- Bootstrap. Who tells a visitor that an anchor is legitimate? This is the same problem as a browser's root store. Countersign answers it with anchors the publisher declares and the visitor can see and override. It does not solve the problem.
- A signature proves "this authority said so". It does not prove the peer is honest or correct, or that its instructions are safe.
- Revocation is only as fresh as the status token's
expand the caller's cache. - If the authority's key is compromised, a new
kidand re-issued endorsements are needed. Callers that pinkidsmust update. - The check itself makes credential-free GETs of public files (
countersign.jsonat the peer, authority files) before consent. They carry no visitor data, key or request text, but the peer can see that a browser looked it up. pinis compared against the bytes the kit fetched. The runtime fetches the network file separately, so a peer that serves different bytes to each request is not caught.
10. Relation to other work
- JOSE / VC-JOSE: tokens are standard compact JWS, so any JOSE library can verify them. A v0.2 could wrap the payload as a W3C VC 2.0 credential secured with JOSE, with a Bitstring Status List in place of the status token.
- NANDA: closest in spirit to NANDA's DAT grants (a grantor signs scoped authority for a subject, with a revocation list) and to AgentFacts.
issandsubare origins, which map directly todid:webidentifiers. - Integrity tools (Gatehouse, Pinned, Agent Customs): complementary. They answer "is it unchanged?", while Countersign answers "is it the legitimate source?"
pinlets the two be combined.