Configure trust policy
Trust policy is verifier configuration, not information supplied by the peer. A valid DNSid record and signature establish protocol evidence; your application must also decide which accountable entities, keys, logs, and evidence ages it accepts.
The SDKs split these decisions between the identity manager’s verification configuration and an injected lifecycle-log registry. This guide covers the current Go, TypeScript, and Python APIs. The IETF draft defines protocol requirements; SDK settings and defaults are implementation choices, not a portable wire-level trust-policy format.
What to configure
Section titled “What to configure”| Decision | Configuration | Default |
|---|---|---|
How often to recheck su= | Status check interval | Zero: fetch status on every verification call |
| Which accountable entities and entity keys to accept | Trusted entities, with optional entity-key thumbprints | No counterparty acceptance decision |
| Whether DNSSEC is required | DNSSEC mode | auto |
| Which lifecycle log to trust | Explicit managed trust, trusted profile, or independently supplied C2SP policy | No implicit log trust in a basic manager |
| Which signer can attest to a complete stream bundle | Bundle verifier keys, usually in a trust profile | No bundle trust unless explicitly configured |
| How fresh log evidence must be | Checkpoint maximum age | Generic registry: unset; current non-revocation fails closed |
| How long a bundle can remain valid | Maximum bundle lifetime | Generic registry with bundle keys: caller must supply a positive limit |
| Whether raw-log fallback is acceptable | Require stream bundle | Fallback permitted when bundle trust is configured |
| Whether rollback protection survives restart | Trusted checkpoint store | In-memory, registry-lifetime only |
These controls are independent. An entity-key pin does not trust a log. A trusted log does not authorize every entity in it. A valid bundle does not replace fresh ACTIVE status or application authorization.
Small examples
Section titled “Small examples”Each example reads a profile from a trusted deployment file, accepts one gi= and one current entity-key pin, allows status reuse for 30 seconds, sets checkpoint maximum age to 10 minutes, and limits bundle lifetime to 5 minutes. These values illustrate the controls; choose values for your operation’s revocation-delay and availability requirements.
Complete runnable examples:
The setup below assumes profilePath / profile_path, governanceId / governance_id, and thumbprint are trusted application inputs, not values accepted from the peer. Go also needs a request context ctx. Then call VerifyDomain with the peer domain.
import ( "os" "time" dnsid "github.com/dnsid-ai/dnsid-go" "github.com/dnsid-ai/dnsid-go/log/c2sptlog")
data, err := os.ReadFile(profilePath)if err != nil { return err }profile, err := c2sptlog.ParseTrustProfile(data)if err != nil { return err }registry, err := c2sptlog.NewVerificationRegistry(ctx, c2sptlog.VerificationRegistryConfig{ TrustProfile: &profile, CheckpointMaxAge: 10 * time.Minute, MaxBundleLifetime: 5 * time.Minute,})if err != nil { return err }verifier, err := dnsid.NewIdentityManager(dnsid.Config{ Verification: dnsid.VerificationConfig{ StatusCheckInterval: 30 * time.Second, TrustedEntities: []dnsid.TrustedEntity{ {GovernanceID: governanceId, EntityKeyThumbprints: []string{thumbprint}}, }, },}, nil, dnsid.WithLogRegistry(registry))if err != nil { return err }import { readFile } from 'node:fs/promises';import { createC2spTlogVerificationRegistry, parseC2spTlogTrustProfile } from '@dnsid-ai/log-c2sp-tlog';import { createNodeIdentityVerifier } from '@dnsid-ai/sdk/node';
const trustProfile = parseC2spTlogTrustProfile(await readFile(profilePath));const registry = await createC2spTlogVerificationRegistry({ trustProfile, checkpointMaxAge: 10 * 60_000, maxBundleLifetimeMs: 5 * 60_000,});const verifier = await createNodeIdentityVerifier({ verification: { statusCheckInterval: 30, // seconds trustedEntities: [{ governanceId, entityKeyThumbprints: [thumbprint] }], },}, { logRegistry: registry });from datetime import timedeltafrom pathlib import Pathfrom dnsid import ( DnsidConfig, IdentityManager, IdentityManagerDependencies, TrustedEntity, VerificationConfig,)from dnsid.c2sp_tlog import ( C2spTlogVerificationOptions, create_c2sp_tlog_verification_registry, parse_c2sp_tlog_trust_profile,)
profile = parse_c2sp_tlog_trust_profile(Path(profile_path).read_bytes())registry = create_c2sp_tlog_verification_registry(C2spTlogVerificationOptions( trust_profile=profile, checkpoint_freshness_ms=10 * 60_000, max_bundle_lifetime_ms=5 * 60_000,))verifier = IdentityManager( DnsidConfig(verification=VerificationConfig( status_check_interval=timedelta(seconds=30), trusted_entities=[TrustedEntity( governance_id=governance_id, entity_key_thumbprints=(thumbprint,), )], )), deps=IdentityManagerDependencies(log_registry=registry),)Reuse the manager and registry across verification calls. These examples use public-network transport. For DNSid Local, use the environment-based local verification setup.
Status check interval
Section titled “Status check interval”| SDK | Field | In-code unit |
|---|---|---|
| Go | Verification.StatusCheckInterval | time.Duration |
| TypeScript | verification.statusCheckInterval | Seconds |
| Python | verification.status_check_interval | datetime.timedelta |
The interval is the maximum age of a cached status result before verification re-fetches su= on a cache hit. It must be non-negative. Zero, the default, rechecks status on every call. A positive interval permits reuse only while the verified identity’s other cache bounds remain valid; it does not extend DNS TTL, key-age, or certificate validity.
A 30-second interval can reuse an earlier ACTIVE result after the status service has changed. Choose zero when each call must retrieve status. A failed status check is not permission to continue with stale ACTIVE status. A returned verified-domain object does not poll for changes; verify again at the operation boundary. A log non-revocation check does not refresh su=.
The current draft requires status fresh enough under local policy before reliance for a new interactive operation. It does not prescribe a universal cache interval. Offline or historical verification is a separate operation, not a reason to suppress status errors in interactive verification.
Entity-key allowlist
Section titled “Entity-key allowlist”The SDK name for an EK whitelist is trusted entities. An entry pairs an accountable-entity governance domain (gi=) with optional pins on the current entity key that verified the record signature (sg=).
| SDK | List | Entry fields |
|---|---|---|
| Go | Verification.TrustedEntities | GovernanceID, EntityKeyThumbprints |
| TypeScript | verification.trustedEntities | governanceId, entityKeyThumbprints |
| Python | verification.trusted_entities | governance_id, entity_key_thumbprints |
- Unset (
nil, absent, orNone): the SDK makes no counterparty acceptance decision. This does not disable protocol verification. - Empty list: deny every counterparty.
- Entry with no pins: accept that exact normalized governance ID after protocol verification.
- Entry with pins: require that governance ID and one matching current record-signing entity-key thumbprint.
- Multiple entries: accept a match to any entry. Duplicate normalized governance IDs are invalid; put multiple pins in one entry.
Matching has no wildcard, suffix, or transitive behavior. Pins must be distinct RFC 7638 SHA-256 JWK thumbprints: unpadded base64url encoding of 32 bytes. A supplied pin list must be non-empty. Do not use a JWK kid, a hash of the JWKS response, the ek= URL, or a pin on the agent’s ku= operational key. A kid or URL is a label or location, not a fingerprint of the key material. Hashing the JWKS pins the whole document, and pinning ku identifies the operational key rather than the accountable entity’s key.
Obtain the expected entity key through an independent trusted channel and compute its RFC 7638 thumbprint with the SDK’s JWK helper. Accepting a thumbprint fetched from the peer on first contact does not verify that it belongs to the expected entity.
The allowlist does not bypass protocol verification. Acceptance runs on every verification call, including cache hits. A mismatch produces a permanent counterparty-not-accepted error; denials are not cached. Protocol evidence is cached before the acceptance decision.
The allowlist does not restrict acceptance to particular agent domains, configure issuer or root trust, or authorize individual operations. Enforce agent-domain restrictions and operation authorization in application policy.
Rotate entity-key pins
Section titled “Rotate entity-key pins”Before a planned entity-key rotation, provision both old and new pins in the same entry. After the signed record uses the new key and the compatibility window ends, remove the old pin. Logged continuity does not automatically add a new key to your acceptance policy. Rotate pins through trusted configuration, and construct a new manager when changing policy; do not assume mutation of the original config changes a running manager.
Lifecycle-log (lr=) policy
Section titled “Lifecycle-log (lr=) policy”A C2SP reference has the form c2sp-tlog:<scope>:<log-prefix>#<stream-id>. It selects evidence; it does not select trust roots. The generic registries accept exactly one of:
- A trust profile binding an exact scope and canonical log prefix to checkpoint policy and bundle keys.
- Independently trusted C2SP
tlog-policybytes. - An independently configured HTTPS policy URL, fetched with the SDK’s bounded transport.
Use a profile when you need the same exact scope/prefix restriction in all three SDKs. A bare policy trusts checkpoint origins and keys, but does not itself provide the profile’s exact scope/prefix binding. Do not form a policy URL from the untrusted lr= or treat a server’s advertised policy as authoritative.
For DNSid-managed logs, the separately named managed factories explicitly select SDK-embedded trust. They currently accept the public development and production logs, not every log supported by the CLI. See Choose log trust.
Trust-profile file format
Section titled “Trust-profile file format”All three SDKs parse the same version-1 UTF-8 JSON shape. This is a schema illustration, not valid trust material; replace the placeholders with independently approved verifier keys and policy bytes.
{ "version": 1, "scope": "public", "log_prefix": "https://log.example", "tlog_policy": "log <log-note-verifier-key>\nwitness primary <witness-cosignature-verifier-key>\nquorum primary\n", "bundle_verifier_keys": [ "dnsid-stream-bundle+<keyhash>+<base64-key-payload>" ]}The profile requires valid checkpoint policy for the prefix’s origin and at least one valid bundle key. Bundle keys must have the note name dnsid-stream-bundle, use Ed25519, and be distinct by key ID and underlying public key. They must not reuse log or witness checkpoint keys. Do not add runtime freshness fields to this document; those remain registry options.
The tlog_policy string contains the actual C2SP policy text, including line endings. Its basic directives are:
log <log-note-verifier-key>witness primary <witness-cosignature-verifier-key>witness secondary <another-witness-cosignature-verifier-key>group witnesses 1 primary secondaryquorum witnessesThis illustration requires one of two witnesses. Policies can define nested threshold groups. The SDK verifies a trusted log signature and the configured witness quorum; public scope requires a non-empty witness quorum. Reducing a quorum changes the security assumptions and is not a remedy for an unavailable witness. See the C2SP tlog-policy specification and each SDK’s policy parser reference.
Witness operator independence
Section titled “Witness operator independence”Distinct witness keys do not prove independent operators. Several keys controlled by one organization can share the same compromise or administrative failure. The SDK checks keys, signatures, and quorum rules; it cannot establish who operates the witnesses.
Select witness operators through trusted configuration and assess their independence from each other and the log operator. If independent corroboration is required, choose a threshold or nested groups so one operator cannot satisfy the quorum alone. The one-of-two policy above illustrates syntax, not a guarantee of independent corroboration.
Protect the profile file and its distribution channel as trust configuration. Parsing validates the structure and keys, not the file’s source. Rebuild the registry when its policy changes. Policy-byte changes also change the hash against which bundles are verified; coordinate distribution with the log operator.
Stream-bundle signer keys
Section titled “Stream-bundle signer keys”A stream bundle provides bounded, signed per-domain history instead of requiring a full-log scan. Its signer attests to the complete stream view. The SDK still verifies checkpoint signatures and quorum, inclusion proofs, lifecycle signatures, stream continuity, and agreement between replayed history and the bundle’s state summary.
The signature must match an independently accepted bundle key. A bundle’s sig.kid selects a key; it does not establish trust. The log’s /dnsid-bundle-signer endpoint is discovery only. Never download that key and immediately trust it merely because it came from the log server.
A profile supplies the bundle keys. For policy-only setup, the generic factories also accept direct keys:
| SDK | Policy bytes / URL | Direct bundle keys | Key-string parser |
|---|---|---|---|
| Go | PolicyDocument / PolicyURL | BundleVerifiers ([]note.Verifier) | note.NewVerifier from golang.org/x/mod/sumdb/note |
| TypeScript | policyDocument / policyUrl | bundleVerifierKeys | parseSignedNoteVerifierKey |
| Python | policy_document / policy_url | bundle_verifier_keys | parse_signed_note_verifier_key |
Do not combine a profile with direct policy or bundle-key options. Without bundle keys, policy-only setup uses the bounded scanner. With keys, supply a positive maximum bundle lifetime. The SDK checks expiry against local time and limits the distance from the witnessed checkpoint to bundle expiry; this is not a status polling interval or a local TTL starting at download time. The bundle’s policy hash must match the verifier’s exact supplied policy bytes.
Rotate bundle keys
Section titled “Rotate bundle keys”Provision a profile containing both old and new bundle verifier keys before the server starts signing with the new key. After clients have received the update and the compatibility window ends, remove the old key in a later profile release. Rebuild the registry with the updated profile. The server signs bundles on request; historical lifecycle entries do not require retaining the old bundle signing key. A compromised signer requires a prompt trusted-profile update, not automatic in-band key acceptance.
Bundle fallback
Section titled “Bundle fallback”The default bundle-first path can use a bounded complete-log scan for supported availability failures or missing checkpoint consistency evidence. If a received bundle is invalid, expired, untrusted, or conflicting, verification returns an error instead of retrying through the raw-log scanner.
Set RequireStreamBundle (Go), requireStreamBundle (TypeScript), or require_stream_bundle (Python) when verification must fail instead of using raw-scan history fallback. This is an availability and cost policy, not a replacement for bundle validation. It is not a promise that every low-level read avoids scanning: Go’s event lookup can scan to discover the FQDN before requiring its bundle history.
Freshness and rollback protection
Section titled “Freshness and rollback protection”| Purpose | Go | TypeScript | Python |
|---|---|---|---|
| Checkpoint maximum age | CheckpointMaxAge (duration) | checkpointMaxAge (ms) | checkpoint_freshness_ms |
| Maximum bundle lifetime | MaxBundleLifetime (duration) | maxBundleLifetimeMs | max_bundle_lifetime_ms |
| Allowed clock skew | AllowedClockSkew (duration) | allowedClockSkew (ms) | max_clock_skew_ms |
| Persistent checkpoint store | TrustedCheckpointStore | trustedCheckpointStore | trusted_checkpoint_store |
Generic registries require an explicit positive checkpoint age to support current logged-state/non-revocation checks. Historical binding and key-continuity checks can use older authenticated checkpoints. The managed and environment/deployment-file trust constructors use a 10-minute checkpoint policy for operation-time non-revocation. Clock skew defaults to zero; keep clocks synchronized and permit only the skew your deployment needs.
A bundle’s expiry, checkpoint age, status interval, and verified-domain cache expiry are separate bounds. Increasing one does not make the other evidence fresh. An inclusion proof alone does not establish current non-revocation; that needs complete history through a fresh accepted checkpoint.
The default store remembers accepted checkpoints only while the registry exists. Retain the registry across requests. Supply durable storage when rollback protection must survive restarts. An empty store accepts its first checkpoint under the configured trust policy, so restarting with empty storage loses comparison with earlier accepted state. Do not erase checkpoint state to make a consistency failure disappear.
Before a high-value or irreversible operation, perform the operation-time log check. Honor fl=logchk where applicable and require the check for additional operations under local policy. Verify status again when the operation needs a fresh su= response. Fail the operation if required evidence is missing, stale, revoked, or unverifiable.
Authenticate the connection and honor fl=mtls
Section titled “Authenticate the connection and honor fl=mtls”VerifyDomain verifies identity evidence; it does not prove that the caller sending a request controls the agent’s operational key. Authenticate the request with a verified signature or an authenticated connection before relying on that identity. An entity-key allowlist does not replace this step.
When the signed record contains fl=mtls, verification requires certificate information for the current peer connection and checks its DNS subject alternative names against the agent FQDN. Missing or mismatched certificate information fails verification. The check runs on every call, including identity-cache hits; certificate information from another connection is not reusable proof of the current peer.
| SDK | Per-call input | Trust boundary |
|---|---|---|
| Go | VerifyDomainWithOptions with VerifyDomainOpts.VerifiedPeerCertificateChains | Supply chains from the current connection that the TLS stack has already verified. The SDK checks the leaf hostname; it does not perform certificate-chain authentication itself. A leaf supplied through the deprecated PeerCertificate field is insufficient. |
| TypeScript | verifyDomain(domain, peerCert) | Supply TLSCertificate metadata from the current authenticated TLS connection. The SDK checks the hostname, not certificate-chain trust or the TLS handshake. |
| Python | verify_domain(domain, peer_cert=peer_cert) | Supply TLSCertificate metadata from the current authenticated TLS connection. The SDK checks the hostname, not certificate-chain trust or the TLS handshake. |
Configure client-certificate authorities, certificate validity checks, and any deployment-required revocation checks in the TLS stack. Never accept certificate metadata supplied in a request body as evidence of an authenticated connection. The CA bundle used to fetch DNSid endpoints is a separate setting; it does not configure inbound client-certificate trust.
If local policy requires mTLS even without fl=mtls, enforce that requirement in the application or TLS listener. The SDK’s record-flag check does not impose it on records without the flag.
Deployment and resource limits
Section titled “Deployment and resource limits”Environment/deployment constructors accept DNSID_LOG_TRUST_PROFILE_FILE, DNSID_LOG_POLICY_FILE, or DNSID_LOG_POLICY_URL. Deployment files can select logTrust.managed, profile, policyDocument, or policyUrl; choose exactly one. An injected log registry takes precedence over loaded trust. See configuration loading.
Deployment-file duration formats differ: Go’s statusCheckInterval is a duration string such as "30s"; TypeScript and Python use a number of seconds such as 30. Do not copy an in-code millisecond log option into this field. These loaders do not expose every generic-registry runtime option; inject a registry for custom bundle/freshness/storage settings.
For private or local deployments, pass the same DNS server, CA bundle, and explicitly allowed private hosts to both the generic log factory and identity manager. Private-host exceptions are transport settings, not entity or log trust. Do not disable TLS validation or network protections to fix trust failures.
The built-in log transport bounds responses, rejects redirects and unsafe destinations, and uses finite request deadlines. Keep finite scanner and bundle limits. Bundle defaults are 8 MiB and 10,000 lifecycle events; raw-log scans can still be expensive on large logs. Adjust limits for expected workloads rather than making them unbounded. Custom fetchers must satisfy each SDK’s bounded-fetch and explicit security-capability contract.
DNSSEC mode is separate from log trust. auto accepts VALID, UNSIGNED, and UNKNOWN; validated rejects UNKNOWN; required accepts only VALID. FAILED always aborts. Stricter modes need a resolver that reports validation state; do not assume the stock Node or Go resolver provides it.
Failure handling and production checklist
Section titled “Failure handling and production checklist”Configuration errors, malformed profiles, and invalid pins fail during setup. A verified peer that misses the entity allowlist fails with a permanent counterparty-not-accepted error. Missing log trust, scope/prefix mismatch, bad signatures, unmet witness quorum, failed consistency, and stale required evidence fail verification. Retry only errors classified as transient; do not weaken trust automatically. See Verification results.
Before deployment:
- Independently approve governance IDs, current entity-key pins, log policy, and bundle keys.
- Choose status and checkpoint freshness for each operation’s risk.
- Decide whether raw-scan fallback is acceptable; set finite limits and deadlines.
- Use durable checkpoint storage where restart rollback protection is required.
- Test key rotation, pin rejection, status changes, log outages, stale bundles, and checkpoint consistency failures.
- Enforce application authorization after identity acceptance.
API details: Go configuration and C2SP log · TypeScript protocol and C2SP log · Python configuration and transparency log.