AI

AgentOps: verify MCP server image provenance before reconnecting production agents

A production runbook for tying a deployed MCP server image to source, build, registry digest, runtime identity and tool behavior before reconnecting production agents.

21 Oct 2026 aiagentopsmcpsupply-chaincontainersprovenancesbomsecuritydevopsobservabilityevaluationguardrailsrunbookrollbackproduction

A patched MCP server is deployed after a security update. The image still carries the tag prod, tools/list exposes the expected names, and the health endpoint is green. Yet none of those signals proves that production is running the reviewed bytes. The tag may have moved, one replica may still use the previous digest, the deployment may have pulled from a different registry, or the image may contain a tool wrapper that was never evaluated.

The running case is an internal operations server used by agents to read incidents and prepare bounded remediation. Before agents reconnect, the platform team must link the running workload to its source, build, immutable registry digest, configuration, execution identity and observed tool behavior. The outcome is explicit: promote the image, quarantine it, or roll back to the last qualified digest.

Freeze reconnection and identify the running candidate

Keep production agents disconnected or limited to read-only tools while evidence is incomplete. Do not redeploy immediately: that erases the mixed state you need to explain. Record one investigation window and identify every replica, revision and region serving the MCP endpoint.

yaml 01-mcp-image-candidate.yml
service: mcp-ops-prod
environment: production
incident_window_utc: <start>/<end>

candidate:
source_repository: <repository>
source_commit: <full-sha>
build_run: <pipeline-and-run-id>
image_reference: <registry>/mcp/ops-server@sha256:<digest>
signature_policy: <policy-version>
sbom_digest: <sha256>
deployment_revision: <revision>
config_digest: <sha256>
runtime_identity: <principal-or-service-account>

rollback:
image_digest: sha256:<last-qualified-digest>
deployment_revision: <last-qualified-revision>
contract_digest: <last-qualified-tools-list-digest>

A tag is a selector, not evidence. Preserve the tag for operator convenience if needed, but make the decision on the resolved digest. The same rule applies to a deployment revision: it identifies control-plane state, not necessarily the image pulled by every running replica.

Reconcile source, build, registry and runtime

Treat provenance as four linked observations.

  1. Source identifies the exact commit and build definition that were reviewed.
  2. Build records the resolved dependencies, builder identity, tests and produced digest.
  3. Registry returns the immutable manifest digest and associated signature or attestations.
  4. Runtime proves which digest each replica actually executes.

Start from the runtime and walk backward. This avoids proving the provenance of an image that is not actually serving traffic.

bash 02-resolve-runtime-image.sh
set -euo pipefail

# Kubernetes example: retain pod, node, declared image and resolved image ID.
kubectl get pods -n <namespace> -l app=mcp-ops -o jsonpath='{range .items[*]}{.metadata.name}{"	"}{.spec.nodeName}{"	"}{.spec.containers[0].image}{"	"}{.status.containerStatuses[0].imageID}{"
"}{end}'

# Resolve the registry manifest without pulling or executing the image.
docker buildx imagetools inspect <registry>/mcp/ops-server@sha256:<digest>

If replicas report different imageID values, stop. A healthy load balancer can hide a mixed deployment where the same agent conversation reaches different implementations. Also verify the registry hostname and repository path, not only the digest string: provenance must bind the digest to the expected distribution boundary.

Compare the runtime digest with the build output and deployment manifest. A match between two layers is insufficient when the chain has four. A successful pipeline cannot prove what a mutable tag resolved to later, and a signed registry object cannot prove that the cluster runs it.

Verify the signer and attestation policy

A signature is useful only when verification checks the expected signer, issuer and immutable digest. “Signature present” is not a promotion gate. Run verification from a controlled CI or release environment and retain the command, trust policy and result with the candidate record.

bash 03-verify-image-evidence.sh
set -euo pipefail

IMAGE='<registry>/mcp/ops-server@sha256:<digest>'

cosign verify --certificate-identity-regexp '<approved-build-identity>' --certificate-oidc-issuer '<approved-issuer>' "$IMAGE"

cosign verify-attestation --type slsaprovenance --certificate-identity-regexp '<approved-build-identity>' --certificate-oidc-issuer '<approved-issuer>' "$IMAGE" > provenance.json

cosign verify-attestation --type spdxjson --certificate-identity-regexp '<approved-build-identity>' --certificate-oidc-issuer '<approved-issuer>' "$IMAGE" > sbom.json

Inspect the attestation payload rather than keeping only an exit code. Confirm the source repository, commit, workflow identity, build parameters that affect output and the subject digest. Review the SBOM for unexpected packages, missing inventory and material changes from the last qualified image. An SBOM describes contents; it does not prove that vulnerabilities are absent or that the runtime selected those bytes.

A failing or unverifiable signature is a quarantine condition. Do not compensate with a broader runtime identity or an emergency rebuild under the same tag. Produce a new candidate with a new digest and a complete chain.

Bind configuration and identity to the image

The same image can expose a different risk surface when configuration changes. Capture the MCP server configuration, enabled tool catalog, backend destinations, feature flags, secret references and runtime identity without exporting secret values.

Normalize those non-secret inputs and compute a digest. Keep image and configuration digests together in the release record. Then verify the effective identity from the workload, not from the deployment template.

text 04-effective-runtime-contract.txt
Image
Runtime digest equals the reviewed registry digest
Every serving replica reports the same digest

Configuration
Enabled tools match the approved allowlist
Backend destinations match the production inventory
Secret references and feature flags match the reviewed release
Normalized configuration digest is recorded

Identity
Workload obtains the intended runtime principal
Read and write scopes remain separated
Out-of-scope target is denied
Audit events carry the same release and correlation identifiers

A valid image with the wrong identity is not the qualified service. Likewise, the correct identity attached to an unproven image is not a reason to reconnect agents.

Compare the visible contract and real behavior

Now query the deployed candidate directly, outside the production agent path. Normalize tools/list by sorting tools and retaining names, descriptions, input schemas and risk annotations. Compare its digest with the qualified contract.

An unchanged catalog is necessary but not sufficient. The wrapper behind a stable schema may call another backend, apply new defaults or change error handling. Replay a small evaluation pack against canary resources:

  • one approved read with a known result;
  • one out-of-scope read that must be denied;
  • one write prepared but not executed;
  • one malformed argument rejected at the schema boundary;
  • one backend timeout with no automatic duplicate effect;
  • one tool result containing untrusted instructions that must remain data.
yaml 05-mcp-image-evaluation-gate.yml
candidate:
image_digest: sha256:<digest>
config_digest: <sha256>
tools_list_digest: <sha256>
runtime_identity: <principal>

blocking_results:
- runtime_digest_mismatch
- mixed_replica_digests
- untrusted_or_unknown_signer
- provenance_subject_mismatch
- unexpected_tool_or_backend
- out_of_scope_call_succeeds
- write_executes_without_approval
- trace_cannot_link_release_to_tool_call

required_evidence:
- source_and_build_linked
- signature_policy_passed
- sbom_reviewed
- contract_diff_reviewed
- negative_tests_passed
- rollback_digest_still_deployable

Keep the image digest, configuration digest and tool contract digest on every canary trace. Without those three values, a later incident cannot distinguish model behavior from a changed server release.

Reconnect one canary agent

Reconnect one agent group to one pinned revision. Keep writes disabled or behind mandatory approval. Do not use a production tag as the rollout control; route to the revision whose runtime digest was just verified.

Observe tool selection, arguments, authorization denials, latency, backend effects and trace completeness. Compare the candidate with the last qualified revision under the same evaluation cases. The purpose is not to show that the agent can call every tool. It is to prove that a narrow, expected journey behaves the same way from request to audit event.

Promote only after the canary window includes successful reads, expected denials and at least one prepared write stopped at the approval boundary. If traffic cannot be isolated by revision, keep agents disconnected until the platform can provide that boundary.

Decide, quarantine or roll back

The final decision should fit one of three states.

  • Promote when all serving replicas use the reviewed digest, signer and provenance match policy, configuration and identity are expected, the tool contract is understood, negative tests pass and traces bind calls to the release.
  • Quarantine when the bytes are identifiable but provenance, signature, SBOM or behavior is incomplete. Remove the digest from deployable channels without deleting the evidence.
  • Roll back when the runtime digest differs, replicas are mixed, behavior regresses or the candidate crosses an authorization or approval boundary.

Rollback means deploying the retained immutable digest and its paired configuration, then proving the runtime state again. Moving the prod tag back is not enough. Re-run the contract digest and canary pack before reconnecting the remaining agents, and reconcile any action whose status is unknown during the rollout window.

Conclusion

An MCP server image is part of the agent’s production contract. Tool names and a green health endpoint cannot establish what code runs, who built it, which identity it uses or how it behaves behind the schema.

Reconnect agents only when source, build, registry, runtime, configuration, identity and canary evidence point to the same release. Quarantine incomplete candidates, and roll back by immutable digest to a version already qualified end to end.