Skip to content

Python: add vendor-neutral command guard filter sample - #14636

Draft
varunc12502-oss wants to merge 1 commit into
microsoft:mainfrom
varunc12502-oss:varunc12502-oss-issue-14573
Draft

varunc12502-oss wants to merge 1 commit into
microsoft:mainfrom
varunc12502-oss:varunc12502-oss-issue-14573

Conversation

@varunc12502-oss

Copy link
Copy Markdown

Addresses the discussion in #14573.

Python SK already supports function invocation filters, but there is no example of using one as a guard that blocks a tool call before it runs.

What this adds:

  • samples/concepts/filtering/command_guard_filter.py: a filter factory that takes any scanner with scan(command) (sync or async) and skips the call if it is not allowed. No third-party dependency.
  • 5 unit tests in tests/unit/kernel/test_command_guard_filter_sample.py.
  • An entry in the concepts README.

Opening as a draft to get maintainer feedback on whether this belongs in the samples.

@semantic-kernel-automation semantic-kernel-automation Bot added python Pull requests for the Python Semantic Kernel documentation labels Oct 21, 2026
@varunc12502-oss

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch was previously deployed

1 inactive deployment
github-app-auth — 807fec60 Deployed Oct 21, 2026 by varunc12502-oss via team_check #655
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant