Skip to content

Add captureDenials to the .NET SDK - #938

Merged
Richie Gomez (richiemsft) merged 3 commits into
mainfrom
dotnet-capture-denials
Aug 19, 2026
Merged

Richie Gomez (richiemsft) merged 3 commits into
mainfrom
dotnet-capture-denials

Conversation

@richiemsft

@richiemsft Richie Gomez (richiemsft) commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Adds captureDenials policy configuration to the .NET SDK, including block/allow modes, optional output paths, and retained ETL configuration. The sample now demonstrates opt-in denial capture and reports capture metadata for run-to-completion and streaming execution.

The documentation covers sensitive ETL cleanup and notes that streaming processes do not currently expose security warnings; callers that use allow mode and need warning inspection should use Run or RunAsync.

🔗 References

  • Native and FFI denial-capture support already present on main.

🔍 Validation

  • dotnet test sdk\dotnet\Microsoft.Mxc.Sdk.slnx — 39 passed
  • node scripts\check-dotnet-bindings-codegen.js
  • node scripts\check-dotnet-errorcode-parity.js
  • git diff --check
  • Eight-axis adversarial review completed; all High and Medium findings resolved

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f9ac49b1-fdfe-4cca-9412-9faa99cef2ab
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f9ac49b1-fdfe-4cca-9412-9faa99cef2ab
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f9ac49b1-fdfe-4cca-9412-9faa99cef2ab
Copilot AI balanced review requested due to automatic review settings August 18, 2026 22:41
@richiemsft
Richie Gomez (richiemsft) requested a review from a team as a code owner August 18, 2026 22:41
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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 .NET SDK configuration, documentation, tests, and sample usage for Windows denial capture.

Changes:

  • Adds block/allow capture policy serialization.
  • Documents capture outputs, warnings, and ETL cleanup.
  • Demonstrates and tests run and streaming metadata.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/dotnet/README.md Documents denial capture usage and cleanup.
Microsoft.Mxc.Sdk/SandboxPolicy.cs Adds denial-capture policy types.
Microsoft.Mxc.Sdk/SandboxOutputMetadata.cs Clarifies retained ETL cleanup.
Microsoft.Mxc.Sdk/MxcSandbox.cs Centralizes policy serialization.
Microsoft.Mxc.Sdk.Tests/MxcSandboxTests.cs Tests capture policy serialization.
Microsoft.Mxc.Sdk.Sample/Program.cs Demonstrates capture and metadata reporting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@richiemsft

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Assert.True(capture.GetProperty("retainEtl").GetBoolean());
}

[Fact]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

note: didn't realize we hadn't done this yet but we probably want to hook these tests up to the PR pipelines in the future.

@richiemsft
Richie Gomez (richiemsft) merged commit 04456f3 into main Aug 19, 2026
42 of 43 checks passed
@richiemsft
Richie Gomez (richiemsft) deleted the dotnet-capture-denials branch August 19, 2026 17:36
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.

3 participants