The Evidence Server¶
The Evidence Server lets places the operator cannot watch, such as CI runners or edge sites, send signed reports about a service into your cluster. Pacto checks each report against the contract and stores it in your registry. Evidence here means a record of what a tool saw in a running system.
It is off by default (evidence.enabled: false). Turning it on needs three
things the chart cannot guess. Settle the first before you publish anything: it
decides which registry the contract itself has to live in.
Check the registry serves the native Referrers API¶
Each report is stored next to the contract version it is about, in the same
registry repository, as an OCI 1.1 referrer (an artifact that points at
another artifact). Pacto has no fallback to the older tag-based scheme, so the registry holding
the contract must support Referrers lookup. GHCR does not qualify, and
neither does CNCF distribution (registry:2, registry:3); see
Evidence in OCI. This matters because
every other page on this site publishes to ghcr.io. Choose a conformant
registry for the contract before you run pacto push.
Create the trust store¶
pacto evidence keygen mints an Ed25519 pair and
names the public key after the trust binding the server reads:
<producerId>__<keyId>.pub, or a bare <keyId>.pub when there is a single
producer:
The Secret is mounted whole and read-only at /etc/pacto/trust, so each
Secret key has to be the public-key filename, which is what
--from-file gives you. One --from-file per trusted producer:
kubectl create secret generic pacto-evidence-trust \
--namespace pacto-operator-system \
--from-file=keys/acme-ci__release-2026.pub
The private .key stays with the producer that signs; the cluster needs only
the public key. Evidence security covers rotation and
multi-producer trust.
Get the subject digest¶
A subject is one immutable contract revision, and
pacto push prints the digest of the revision it just published:
Pushed payments-api@2.1.0 -> registry.example.com/your-org/your-service-pacto:2.1.0
Digest: sha256:<64 hex characters>
Then install:
helm install pacto-operator \
oci://ghcr.io/trianalab/pacto/charts/pacto-operator \
--namespace pacto-operator-system --create-namespace \
--set evidence.enabled=true \
--set 'evidence.registry.subjects[0]=oci://registry.example.com/your-org/your-service-pacto@sha256:<digest>' \
--set evidence.trust.existingSecret=pacto-evidence-trust
- At least one subject.
evidence.registry.subjectslists the exact, immutable contract revisions evidence may be reported against, each anoci://<repo>@sha256:<digest>reference. The chart's schema rejects an empty list, sohelm installfails before anything reaches the cluster:at '/evidence/registry/subjects': minItems: got 0, want 1. It rejects a short or tag-shaped reference the same way: the digest has to be all 64 hex characters. - A trust store.
evidence.trust.existingSecretnames the Secret you created above. The chart does not check this one, so an install without it succeeds and the operator then exits at startup withevidence enabled but no trust secret set: signature verification is mandatory. Verification is mandatory. - A registry that serves the native Referrers API, as above. Nothing checks it at install time: the chart installs, the operator starts and the failure surfaces later as an Evidence Server that never becomes ready.
If that registry is private, there is a fourth thing you create yourself: a
kubernetes.io/dockerconfigjson Secret named by
evidence.registry.credentialsSecret, mounted read-only as a DOCKER_CONFIG
directory so the server authenticates the way pacto pull does. Leave the value
empty for an anonymous or in-cluster registry.
See the Helm reference for the full value list and Operator configuration for the controller flags each value maps to.
Verifying the install¶
evidence.enabled=true adds a third Deployment, pacto-evidence, created by
the controller the same way the dashboard is:
NAME READY UP-TO-DATE AVAILABLE AGE
pacto-dashboard 1/1 1 1 16s
pacto-evidence 1/1 1 1 14s
pacto-operator 1/1 1 1 21s
1/1 means more than "the process started". Readiness is
GET /api/evidence/v1/ready, which answers 503 until every subject
resolves in the registry and answers native Referrers discovery. A
pacto-evidence stuck at 0/1 is nearly always a subject the cluster cannot
pull or a registry without the Referrers API. Read the server's own log:
The Service is pacto-evidence on port 8686. Producers inside the cluster
POST signed envelopes to it:
A pacto fleet outside the cluster consumes the same server's read-only
contribution by base URL. --evidence-url appends
/api/evidence/v1/targets itself, so leave it out:
kubectl port-forward -n pacto-operator-system svc/pacto-evidence 8686:8686 &
pacto fleet search --evidence-url http://127.0.0.1:8686
The targets endpoint takes no authentication and knows no caller, so no viewer restriction applies to it. It lists contract references, producers, the external references of provisioned resources and the usage and cost of every consumer's resources, so keep the Service behind the same network and auth boundary as the dashboard.
A pacto fleet or dashboard reads every provisioning and usage record that
endpoint lists as signed, because the server checked each signature before it
stored the record; the reader re-checks none. Point --evidence-url only at
your own Evidence Server over a path you trust, such as TLS to its host or the
port-forward above. Anyone who can answer on that URL can make a forged phase
or cost read as signed.
Provisioning reports¶
A provider adapter reports the state of a resource a consumer's contract asked
for as a ResourceProvisioned
EvidenceSet, written with pacto evidence provisioned. The report is stored on
the consumer's contract revision, so that revision must be one of the
evidence.registry.subjects. Use one EvidenceSet subject per resource: the
default, <repository>/<environment or default>/<kind>/<name>, keeps each resource's
latest report apart.
Grant the adapter's key¶
Only a key whose trust entry lists ResourceProvisioned in
allowedObservationKinds may report it, so give the adapter its own key. By
default the server trusts every .pub key in the trust Secret, which grants
every runtime kind and withholds ResourceProvisioned. To accept provisioning
reports, add a
structured trust config to
the same Secret and name its key in evidence.trust.configKey:
apiVersion: pacto.dev/evidence-trust/v1
keys:
- keyId: release-2026
producerId: acme-ci
publicKeyFile: acme-ci__release-2026.pub
- keyId: adapter-2026
producerId: platform-adapter
publicKeyFile: platform-adapter__adapter-2026.pub
allowedObservationKinds: [ResourceProvisioned]
allowedProviderRepos: [ghcr.io/acme/platform/postgresql]
A usage adapter's key lists
ResourceUsage instead.
Give each adapter its own key, scoped with allowedProviderRepos to the
provider repositories it serves. A report is in scope when the consumer's
declared configuration or dependency ref names a repository under one of the
prefixes, so the PostgreSQL adapter above can never mark a Redis cache Ready.
The server refuses a report outside the scope with HTTP 403 and the code
provider_not_allowed, and logs a startup warning for every provisioning or
usage key with no scope. Reports accepted before a key is narrowed stay until a newer
report replaces them or they pass the provisioning window. The field needs Pacto core 4.5.0 or later; older servers
refuse the config. The unsigned target-state file has no keys, so the scope
cannot protect it.
kubectl create secret generic pacto-evidence-trust \
--namespace pacto-operator-system \
--from-file=trust.yaml \
--from-file=keys/acme-ci__release-2026.pub \
--from-file=keys/platform-adapter__adapter-2026.pub
Add --set evidence.trust.configKey=trust.yaml to the install command above.
The server then starts with --trust /etc/pacto/trust/trust.yaml, and each
publicKeyFile names another key of the Secret. The config replaces the
directory scan, so list every key you trust: a .pub key it omits is no
longer trusted. The chart accepts only a .yaml or .yml key.
Read provisioning reports¶
The targets endpoint answers with schema pacto.dev/evidence-source/v5 when it
carries a cluster, which the operator passes, so upgrade older readers that
accept only v2 to v4. Without a cluster it answers with
pacto.dev/evidence-source/v4 and a usage list when it holds usage reports, with
pacto.dev/evidence-source/v3 and a provisioning list when it holds only
provisioning reports, and with pacto.dev/evidence-source/v2 otherwise, so an
older reader keeps working against a server that holds none. A provider report
is never a target.
Nothing durable lives in the cluster: no PersistentVolumeClaim, no data volume, because the registry is the store. Delete and recreate the Deployment and the accepted evidence is still there. Evidence in OCI covers what is written and where; the ingestion API lists all five endpoints.