Domain 4: Secure, Govern, and Deploy Multi-Agent Solutions (Part 2 of 2)
This lesson covers 3 exam topics: Custom Guardrails and Guardrail Testing, Release Methodologies and Rollback, Testing Strategy and CI/CD for Agents. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Custom Guardrails and Guardrail Testing
Central question: How do you add domain rules and prove guardrails work?
Facts
- Agent Framework termination and guardrail middleware enforces custom rules deterministically (stop processing, block content, limit length); FIDES adds information-flow labels.
- Custom code-based evaluators check domain constraints (for example amount limits, required disclaimers) in tests.
- Synthetic data generation and the AI Red Teaming Agent produce adversarial and edge-case inputs for guardrail testing; prohibited-actions red teaming uses your policies and tool descriptions.
- Guardrail troubleshooting: false positives from a High blocking level; tool calls not scanned when tool intervention points aren't configured.
Design guidance
- Test guardrails like code: positive cases (must block), negative cases (must allow), measured false positive and false negative rates, rerun on every change.
Exam traps
- Testing only that bad content is blocked, ignoring false positives.
- Prompt-only domain rules without deterministic checks.
- One-off guardrail tests.
2. Release Methodologies and Rollback
Central question: How do you release agent changes safely and roll back?
Facts (design guidance, with verified mechanisms)
| Method | How | Rollback |
|---|---|---|
| DTAP | Development, Test, Acceptance, Production environments with gates | Redeploy previous release |
| Blue/green | Two production environments; switch all traffic | Switch back |
| Canary | Small share of traffic to the new version, then increase | Route traffic back |
- Foundry agents are versioned: azd deploy creates a new hosted agent version; prompt agents have versions; promote optimizer candidates to new versions.
- Model deployments can pin versions; separate projects per environment isolate configuration (AI-300 design guidance).
Design guidance
- Gate each promotion with automated evaluations, safety checks and red teaming; keep the previous agent version available for fast rollback.
- Roll out prompts, tools and models as one versioned release so behavior is reproducible.
Exam traps
- Big-bang release of a new orchestration.
- Deleting the previous version right after release.
- Changing prompts in production outside the release process.
3. Testing Strategy and CI/CD for Agents
Central question: What tests and pipeline gates does an agent system need?
Facts
- azd pipeline config sets up CI/CD in GitHub Actions or Azure DevOps for hosted agents; infrastructure in Bicep or Terraform; commit IaC and provider lockfiles, not Terraform state or .azure environment state.
- Terraform remote state lives in a separate storage account with a different state key per environment.
- Agent evaluators act like unit tests for agentic systems (Pass/Fail per item); the Foundry evaluation GitHub Action (preview) runs evaluations in CI.
Design guidance
- Test pyramid: unit tests for tools and middleware, integration tests for tool and A2A contracts (mocks), regression tests on a fixed evaluation dataset, automated evaluations and red teaming as release gates.
- Pin model versions in tests to separate code regressions from model changes.
Exam traps
- Only manual chat testing.
- Committing Terraform state.
- No regression dataset, so fixes reintroduce old bugs.
References
- AI-500 study guide — checked Oct 22, 2026
- Termination and guardrails middleware — checked Oct 22, 2026
- Guardrails overview — checked Oct 22, 2026
- AI Red Teaming Agent — checked Oct 22, 2026
- CI/CD with azd — checked Oct 22, 2026
- Hosted agents — checked Oct 22, 2026
- Agent evaluators — checked Oct 22, 2026
Check your understanding
Enforce a refund limit deterministically?Show answerHide answer
Answer
Middleware or tool-level check.Few users first, then expand?Show answerHide answer
Answer
Canary.Configure CI/CD for hosted agents quickly?Show answerHide answer
Answer
azd pipeline config.Legitimate content blocked?Show answerHide answer
Answer
Review blocking level.Instant full switch with switch-back?Show answerHide answer
Answer
Blue/green.