Skip to content

Python: Proposal: official HOL Guard FunctionMiddleware example for protected tool calls #7833

Description

Proposal

Add an official Python example/docs integration showing HOL Guard as a concrete FunctionMiddleware enforcement layer for Agent Framework tool calls.

Agent Framework already has the right runtime boundary for this without a new generic API: FunctionMiddleware receives the FunctionInvocationContext before the wrapped function runs, and MiddlewareFailure provides an explicit fail-closed abort path.

The proposed official example would:

  • install and configure HOL Guard as the named security runtime;
  • evaluate the current function name and validated arguments in FunctionMiddleware.process(...) before call_next();
  • call call_next() only for an allow decision;
  • on deny, review-required, or Guard-unavailable/error paths, terminate before the wrapped tool executes, using Agent Framework's existing fail-closed middleware semantics;
  • include a focused test/example demonstrating allow => tool executes once and deny/failure => tool executes zero times.

This is intentionally a direct HOL Guard integration example, not a request for a new provider-neutral middleware abstraction or framework API. It would live in Agent Framework's official sample/docs surface so users can adopt the integration from the project itself.

If this placement sounds useful, I'm happy to send the smallest fork-first PR against main and keep it limited to the example/docs plus the minimal verification requested by maintainers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: Python

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions