Chapter 2 of 6 · Architecture

CI/CD, policy as code, and controlled promotion

Runtime assurance 4 hours in a non-production POC

Chapter 2 of 6

Architecture at a glance#

The full commit SHA is the release identity. Fixed digests bind the prompt, agent version, model alias, APIM policy, evaluation inputs, and Bicep parameters to it. A changed component creates a new release.

The workflow first proves default-branch lineage and runs the unit, evaluation, adversarial, and observability gates. The same validation job reads the approved framework path and the duplicate-agent review from the control definition, so an unsupported runtime or a rebuilt agent stops the release before Azure. Preview jobs then use environment-scoped OIDC to run Bicep what-if. The apply environments withhold their OIDC values until a reviewer approves the matching preview.

After both deployments pass, API Management moves the approved selector. The release store marks the staged record approved only after routing succeeds. Manual restore reads an approved record, previews the selector change, waits for production approval, and returns traffic to that selected release.

One full commit SHA passes validation, protected previews and applies, routing, release recording, and manual restore.

Design choices and tradeoffs#

DecisionChosen approachBenefitsCosts and limitations
Release identityFull commit SHA plus fixed component digestsEvery stage and restore name one releaseAny correction requires a new release
AccessSeparate preview and apply environments with exact OIDC subjectsWhat-if runs before approval; apply credentials stay withheldFour trusts and environment protections must stay aligned
Agent portfolioFramework path and duplicate review recorded in the control definitionThe release gate stops an unsupported runtime or a rebuilt agent before AzureBoth decisions need a named owner and go stale unless someone updates them
RecoveryManual, production-approved restore from an approved release recordAn owner checks the exact release and route before traffic movesRestore needs an available authority and takes longer than automation

Architecture guidance#

Session 12

CI/CD, policy as code, and controlled promotion slide deck