Open Source & Case StudiesMICROSOFT OPEN SOURCE
MERGED UPSTREAM

Fail-Closed AI Governance in Microsoft’s Agent Governance Toolkit

Two independent open-source contributions merged into Microsoft’s Agent Governance Toolkit: fail-closed handling for zero-required-stage approval chains and policy-fixture validation that prevents empty or invalid test suites from reporting false success.

Role

  • Policy evaluation
  • Security invariants
  • Policy-test validation
  • Regression engineering
  • Cross-implementation parity
  • Open-source engineering

Category

AI Governance & Policy Validation

Engineering discipline

MERGED UPSTREAM

Upstream status:2 Microsoft PRs merged
Human review:Both approved
Approval security:PR #3448 · 26 tests
Fail-Closed AI Governance in Microsoft Agent Governance Toolkit

Patrick Ribbsaeter · Independent open-source contribution

Reliable AI policy validation upstream contribution for merged Microsoft PR #3442 by Patrick Ribbsaeter

Policy-test reliability · Microsoft PR #3442 · Merged upstream

Engineering objective

System challenge

Two governance failure modes could create misleading authorization or test confidence. A zero-required-stage approval chain could satisfy empty-set containment and resolve toward ALLOW, while policy fixtures without meaningful expectations could complete without proving any outcome. Both conditions required explicit validation so incomplete governance state could never authorize execution or report false success.

Constraints

Working within real limits

  • Preserve valid approval behavior for correctly configured chains
  • Treat incomplete or ambiguous policy configuration as denied
  • Require at least one meaningful, non-null policy-test expectation
  • Prevent empty replay reports from being classified as successful
  • Verify persisted resolution, request state, execution authorization, and report semantics
  • Keep both upstream patches focused and reviewable

Architecture

System design

Validate invariants
Valid input
Primary flow
Restricted path
External dependency
Data path

Approach

How it was built

  1. 01

    Reproduced the zero-required-stage boundary with an optional non-advisory ALLOW decision.

  2. 02

    Traced the approval failure to vacuous empty-set containment and introduced an explicit deny guard.

  3. 03

    Verified that stored resolution, request status, and execution authorization remain denied.

  4. 04

    Validated policy fixtures before execution and required at least one non-null expectation.

  5. 05

    Changed empty replay-report behavior so a suite cannot report success without a meaningful assertion.

  6. 06

    Added focused regression coverage and validated both patches through their relevant test suites.

Workflow

Implementation flow

Reproduce approval edge case
Enforce zero-stage deny guard
Verify resolution and execution
Reject empty policy expectations
Reject empty success reports
Validate both regression suites

Technical validation

Implementation evidence

Observable engineering evidence. Discipline: MERGED UPSTREAM

Upstream status

2 Microsoft PRs merged

Human review

Both approved

Approval security

PR #3448 · 26 tests

Policy validation

PR #3442 · 521 passed

Invalid fixtures

Rejected before execution

Security posture

Fail closed · no false pass

Public evidence

Review the upstream contribution

Outcome

What was delivered

  • Two independent contributions received human maintainer approval and merged into Microsoft’s upstream repository

  • PR #3448 resolved the zero-required-stage empty set edge case and passed 26 focused tests

  • PR #3442 rejected empty or null-only policy fixtures and passed 521 tests with 2 skipped

  • Python approval behavior aligned with the Go and TypeScript implementations

  • Governance tests now require meaningful assertions before reporting success

Technologies

Stack and tools

PythonAI governancePolicy evaluationAuthorizationCompliance testingRegression testingCross-language parityOpen-source engineering

Next engineering system

CLIENT PRODUCTION · AI MEDIA INFRASTRUCTURE

Ethereal Casting: Global Synthetic Casting Platform

Have an ambitious AI system to build?

Let’s build something serious.

I work across AI architecture, product engineering, private inference, automation, SaaS infrastructure, and production hardening.