.NET: Harden LocalCodeAct OS validation - #8239
Merged
westey (westey-m) merged 2 commits intoSep 10, 2026
Merged
Conversation
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
September 10, 2026 12:32 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
September 10, 2026 12:32 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
September 10, 2026 12:32 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
integration
September 10, 2026 12:32 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
integration
September 10, 2026 12:32 — with
GitHub Actions
Inactive
Copilot started reviewing on behalf of
Eduard van Valkenburg (eavanvalkenburg)
September 10, 2026 12:33
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two validation bypasses permit environment mutation and loss of OS provenance through shadowed builtin names.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Hardens LocalCodeAct’s Python validator by tracking OS-derived values and enforcing explicit read-only policies before execution.
Changes:
- Adds OS provenance tracking across imports, aliases, containers, and assignments.
- Restricts OS path/environment operations and blocks reflective capability access.
- Adds regression tests confirming rejected code never starts the runner.
File summaries
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI.LocalCodeAct/Resources/validator.py |
Implements OS provenance and access policies. |
dotnet/tests/Microsoft.Agents.AI.LocalCodeAct.UnitTests/LocalExecuteCodeFunctionIntegrationTests.cs |
Expands allowed/rejected access coverage. |
dotnet/src/Microsoft.Agents.AI.LocalCodeAct/README.md |
Documents the hardened policy. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg (eavanvalkenburg)
force-pushed
the
fix-workflow-input-validation
branch
from
September 10, 2026 12:53
71c9ba4 to
b71dfcc
Compare
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
September 10, 2026 12:53 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
integration
September 10, 2026 12:53 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
integration
September 10, 2026 12:53 — with
GitHub Actions
Inactive
westey (westey-m)
approved these changes
Sep 10, 2026
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
LocalCodeAct validation did not consistently apply its OS access policy across aliases, nested attributes, and derived values. This change makes the existing allow-list behavior consistent before generated code reaches execution.
Description & Review Guide
Related Issue
N/A — no high-confidence overlapping open issue identified.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.