Skip to content

Python: Sample idea: function-invocation filter for physics-validating agent actions #14785

Open

Description

@PHM-Audit

Hi SK team - our PhysicsConsistencyScorer was recently merged into microsoft/PyRIT (PR #3507) as a rule-table-based physics-consistency module for red-teaming workflows (deterministic in execution: fixed rules, no model in the loop). The SK filter pipeline (FilterTypes.FunctionInvocation) looks like a candidate scenario for the same capability in agent workflows, and we would like to check whether an official sample would fit - to be judged by maintainers.

The gap: in the filtering samples we reviewed on main (python/samples/concepts/filtering/, as of 2026-11-12), the samples cover logging, redaction and telemetry patterns; we did not find a physics-consistency filter sample in that review. Such a filter would intercept function calls whose arguments are physically impossible - e.g. set_temperature(-300), rotate_motor(rpm=1e5) beyond rated limits, move(distance=-5) - before they reach the actual tool. By design it uses a pure rule table: no extra model calls, no new dependencies (design goals, to be verified in the implementation), with a three-state exit (pass / degrade / veto). Overhead not yet measured.

Proposal: a sample python/samples/concepts/filtering/physics_guard_filter.py following the existing sample structure (same signature: context, next; same style as function_invocation_filters.py).

Question: would this class of sample fit the official samples? If the direction fits, we can prepare a PR after your confirmation.

  • PHM-Audit

Activity

  1. changed the title [-]Sample idea: function-invocation filter for physics-validating agent actions[/-] [+]Python: Sample idea: function-invocation filter for physics-validating agent actions[/+] on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonPull requests for the Python Semantic Kerneltriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions