Confirmation strategy · PyPI 0.1.1 · Alpha · Apache-2.0

acgs-haystack for Haystack.

Package Specification · Inspected HEAD 9e81482

Upstream repository
deepset-ai/haystack
PyPI release
acgs-haystack==0.1.1
Python requirement
>=3.11
Framework constraint
haystack-ai>=3.0.0
Governance engine pin
acgs-lite>=3.0.1,<4
Integration mechanic
Pre-tool veto / intervention hook
Hook entry point
ACGSConfirmationStrategy.run / run_async (before_tool)

01 · Local Setup & Quickstart

Attach governance to one tool-calling agent.

Install the pinned release from PyPI alongside acgs-lite>=3.0.1,<4. Rule evaluation uses deterministic keyword and regex matching locally in Python—no external model or network call is made by the governance check.

Caveat: Requires Python >=3.11 and haystack-ai>=3.0.0.

Shell · PyPI installation

pip install "acgs-haystack==0.1.1"

Python · Haystack integration

src/haystack_integrations/hooks/acgs/strategy.py#L37
from haystack.components.agents import Agent
from haystack.hooks.human_in_the_loop import ConfirmationHook
from haystack_integrations.hooks.acgs import ACGSConfirmationStrategy

hook = ConfirmationHook(strategy=ACGSConfirmationStrategy())
agent = Agent(
    chat_generator=chat_generator,
    tools=[send_email],
    hooks=[hook],
)

02 · Verdict & Review Mapping

How ACGS-Lite verdicts map to Haystack.

When a tool call is proposed, the adapter formats the tool name and arguments via format_tool_call and evaluates them against the configured Constitution. Blocking rules always take precedence over review rules.

Verdict.ALLOW

Approves the tool call inside Haystack's ConfirmationHook at the before_tool hook point.

Verdict.DENY

Rejects the tool call through ConfirmationHook and supplies the violation message.

Verdict.REVIEW

Delegates to a configured downstream human-in-the-loop confirmation strategy when a review rule matches.

03 · Public API Surface

Exported symbols and source entry points.

Each adapter keeps its public surface minimal and re-exports the shared GovernanceDecision, Verdict, and ToolCallFormatter types alongside the framework-specific hook or middleware class.

ACGSConfirmationStrategyGovernanceDecisionToolCallFormatterVerdictformat_tool_call

Primary hook surface: ACGSConfirmationStrategy.run / run_async (before_tool). Custom ToolCallFormatter functions may be supplied if your tool arguments require custom canonical serialization before rule matching.

04 · Scope & Bypass Boundaries

What this adapter does and does not cover.

Verify these framework-specific boundaries when integrating acgs-haystack into an evaluation workflow.

  1. 01

    Import path is haystack_integrations.hooks.acgs following Haystack integration conventions.

  2. 02

    Requires haystack-ai>=3.0.0 and Python >=3.11.

  3. 03

    In the current 0.1.x adapter series, rule evaluation runs through acgs-lite's ToolCallGovernor path. If your workflow requires SignedReceipt, ExecutionGrant, or SQLite EffectStore reservations, wire those contracts explicitly at the tool executor boundary.

Put one real workflow under your control.

Choose one tool. Define what it may do. Inspect what happens when a request crosses the boundary.