Skip to content

Add external governance checkpoint sample - #14247

Open
jw-ond wants to merge 3 commits into
microsoft:mainfrom
jw-ond:osuite/external-governance-checkpoint
Open

Add external governance checkpoint sample#14247
jw-ond wants to merge 3 commits into
microsoft:mainfrom
jw-ond:osuite/external-governance-checkpoint

Conversation

@jw-ond

@jw-ond jw-ond commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • Adds a minimal .NET Filtering concept sample for placing an external governance checkpoint before automatic function invocation.
  • Demonstrates constructing a function-call action envelope, computing a stable SHA-256 checkpoint reference, and mapping checkpoint verdicts to execute, pause, or block behavior.
  • Keeps the checkpoint vendor-neutral with an in-memory example client and no external dependencies.

Test Plan

  • git diff --cached --check
  • gh api repos/microsoft/semantic-kernel/compare/main...jw-ond:osuite/external-governance-checkpoint
  • Not run: dotnet test dotnet/samples/Concepts/Concepts.csproj --no-restore --filter "FullyQualifiedName=Filtering.ExternalGovernanceCheckpoint" (dotnet is not installed in this environment: zsh: command not found: dotnet)

Copilot AI review requested due to automatic review settings July 31, 2026 16:07
@jw-ond
jw-ond requested a review from a team as a code owner July 31, 2026 16:07

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 53% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by jw-ond's agents

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new .NET Concepts/Filtering sample demonstrating how an external governance checkpoint can be evaluated before proceeding with automatic function invocation, and links it from the Concepts samples README.

Changes:

  • Add ExternalGovernanceCheckpoint sample showing an IAutoFunctionInvocationFilter that maps checkpoint verdicts to execute/pause/deny outcomes and annotates results with governance metadata.
  • Add SHA-256-based checkpoint reference computation for the action envelope.
  • Update Concepts samples README to include the new Filtering sample link.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
dotnet/samples/Concepts/README.md Adds the new filtering sample to the Concepts index.
dotnet/samples/Concepts/Filtering/ExternalGovernanceCheckpoint.cs New sample demonstrating an external checkpoint gate for auto function invocation and result metadata.
Suppressed comments (1)

dotnet/samples/Concepts/Filtering/ExternalGovernanceCheckpoint.cs:70

  • Same issue as above: ImportPluginFromFunctions clones the function, so the function variable here isn’t the one stored in the kernel’s plugins (and will typically have a null PluginName). Use the imported function instance when creating the context so the envelope reflects real auto-invocation behavior.
        kernel.ImportPluginFromFunctions("CustomerAdmin", [function]);

        var context = CreateAutoFunctionInvocationContext(kernel, function, new KernelArguments());

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


public static string ComputeReference(ActionEnvelope envelope)
{
byte[] envelopeBytes = JsonSerializer.SerializeToUtf8Bytes(envelope, s_serializerOptions);
Comment on lines +30 to +35
kernel.ImportPluginFromFunctions("Payments", [function]);

var context = CreateAutoFunctionInvocationContext(
kernel,
function,
new KernelArguments
Comment on lines +159 to +162
private sealed record ActionEnvelope(
string PluginName,
string FunctionName,
IReadOnlyDictionary<string, object?> Arguments,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants