Skip to content

Cookbook proposal: application-owned tool approval with ConfirmationHook (offline) #321

Open

Description

@jw-ond

Proposed notebook title

Application-Owned Tool Approval with Haystack ConfirmationHook (Offline)

What Haystack feature or integration does this demonstrate?

A Haystack Agent using MockChatGenerator, the native ConfirmationHook,
BlockingConfirmationStrategy, and AlwaysAskPolicy to consult an
application-owned decision before a fixture tool runs. A small ConfirmationUI
adapter would map an explicit, action-bound allow response to confirmation and
reject execution for denied, pending, unavailable, or malformed responses.

Why is this a good addition to the cookbook?

The existing HITL notebook demonstrates model-requested clarification. This would
be a focused example of mandatory pre-tool confirmation, with no API key or
external service required after package installation. The only effect would be
appending a note to an in-memory list.

Inline tests would inspect actual tool-body entry counts and arguments for allow,
deny, pending, timeout, malformed responses, changed arguments, and mixed calls.
The decision fixture would be supplied by the application, not inferred from
assistant text. A digest would correlate the requested action and response, not
be presented as an authorization credential or an exactly-once mechanism.

Pending would mean this attempt does not execute, not durable suspension or
automatic resumption. A trusted approval could be demonstrated in a separate,
application-initiated run. The notebook would explicitly exclude production
authorization, state-injected tool arguments, and later argument-mutating hooks.

This follows the tentative cookbook suggestion in
deepset-ai/haystack#12215 (comment);
I understand that was not approval of this proposal. Would a separate notebook
fit, or would you prefer an addition to an existing example? If this scope is
useful, could a maintainer assign it to me before implementation?

Does this notebook feature a third-party integration (model provider, vector database, tool, etc.)?

No.

If yes, name the third-party product and explain how it is used with Haystack

Not applicable. The checkpoint is a clearly labeled local fixture, not a vendor
SDK, hosted service, or product demo.

Acknowledgement

  • I understand a maintainer must assign this issue to me before I open a PR.

Prepared with AI assistance; no notebook has been implemented or runtime results
claimed at this proposal stage.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions