Skip to content

.Net: Update file handling for FileIOPlugin - #14525

Merged
SergeyMenshykh merged 4 commits into
microsoft:mainfrom
SergeyMenshykh:file-handling-update
Oct 5, 2026
Merged

SergeyMenshykh merged 4 commits into
microsoft:mainfrom
SergeyMenshykh:file-handling-update

Conversation

@SergeyMenshykh

Copy link
Copy Markdown
Contributor

Motivation and Context

Ensure FileIOPlugin applies its configured access rules consistently and provides predictable error responses. This improves reliability for applications exposing file operations through kernel functions.

Description

Refines FileIOPlugin path validation and error handling while preserving its public API and configured folder restrictions. Adds regression coverage for both default and explicitly configured settings, including consistent error responses and continued enforcement of file-access rules.

@SergeyMenshykh SergeyMenshykh self-assigned this Oct 2, 2026
Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:16
@SergeyMenshykh
SergeyMenshykh requested a review from a team as a code owner October 2, 2026 13:16
@semantic-kernel-automation semantic-kernel-automation Bot added the .NET Issue or Pull requests regarding .NET code label Oct 2, 2026

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.

Copilot review overview

🟡 Changes recommended

Non-empty allowlists can still expose disallowed-path details during canonicalization.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Improves FileIOPlugin authorization ordering and error privacy.

Changes:

  • Defers read-only checks until after authorization.
  • Removes file paths from read-only errors.
  • Adds regression tests for disallowed and read-only files.
File Description
FileIOPlugin.cs Reorders validation and sanitizes errors.
FileIOPluginTests.cs Adds privacy and authorization regression tests.

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

@github-actions github-actions Bot changed the title .NET: Update file handling for FileIOPlugin .Net: Update file handling for FileIOPlugin Oct 2, 2026

@semantic-kernel-automation semantic-kernel-automation Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (2 commit(s)): 974f69900a4f, a2ad86c8b222
Model: gpt-5.6-sol

Overview

The change moves read-only probing behind allowlist authorization, short-circuits the default-deny configuration before filesystem access, and translates the main caller-path resolution failures into fixed denial responses. The added tests cover default and explicit configuration, inaccessible and cyclic paths, read-only files, and preservation of configuration errors. One target-specific exception remains outside the new translation boundary, so the documented denial behavior is incomplete for netstandard2.0 consumers on .NET Framework.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs

@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Oct 5, 2026
Merged via the queue into microsoft:main with commit a205c42 Oct 5, 2026
18 of 19 checks passed
@SergeyMenshykh
SergeyMenshykh deleted the file-handling-update branch October 5, 2026 09:54

This branch was previously deployed

2 inactive deployments
github-app-auth — a8563e9e Deployed Oct 2, 2026 by SergeyMenshykh via add_label #29225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants