Skip to content

Python: .NET: agent-hooks first-class integration (Python parity) #7563

Description

@MohammadHaroonAbuomar

Feature request

The agent-hooks interception contract (AGENT-HOOKS-0.1) merged for Python as a first-class experimental core feature in #7515. The .NET side was deliberately deferred in that PR and is now due: the same interception contract, with the same enforcement semantics, on the .NET framework's native seams.

Scope (mirroring the merged Python design in .NET idiom):

  • A single factory composing an indivisible enforcement unit over a ChatClientAgent: agent seam (agent_startup/input/output/agent_shutdown), chat seam below the function-invocation loop (pre_model_call/post_model_call per service call), and function seam (pre_tool_call/post_tool_call).
  • Three-verdict enforcement, fail-closed at every seam; transforms written back as native content; buffered streaming with zero egress ahead of a verdict.
  • Verdict-before-durability for session history and context-provider writes (including the implicit default history provider); nested runs persist inline at their own boundaries.
  • Opt-in dependency (ResponsibleAI.AgentHooks NuGet) referenced only by a new package — no existing framework source affected.
  • evaluate_only mode, host-owned session variant, approval-seam passthrough, hosted-tool limitation documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: PythontriageUsage: [Issues], Target: All issues that still need to be triaged

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions