Confirmation strategy · PyPI 0.1.1 · Alpha · Apache-2.0
acgs-haystack for Haystack.
Integrates with Haystack Agent's before_tool ConfirmationHook via a fail-closed ACGSConfirmationStrategy.
Package Specification · Inspected HEAD 9e81482
- Framework maintainer
- deepset · haystack.deepset.ai
- 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.
Shell · PyPI installation
pip install "acgs-haystack==0.1.1"Python · Haystack integration
src/haystack_integrations/hooks/acgs/strategy.py#L37from 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.
Approves the tool call inside Haystack's ConfirmationHook at the before_tool hook point.
Rejects the tool call through ConfirmationHook and supplies the violation message.
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.
__all__ exports · acgs-haystack
src/haystack_integrations/hooks/acgs/strategy.py#L37 ↗ACGSConfirmationStrategyGovernanceDecisionToolCallFormatterVerdictformat_tool_callPrimary 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.
- 01
Import path is haystack_integrations.hooks.acgs following Haystack integration conventions.
- 02
Requires haystack-ai>=3.0.0 and Python >=3.11.
- 03
In the current
0.1.xadapter series, rule evaluation runs throughacgs-lite'sToolCallGovernorpath. If your workflow requiresSignedReceipt,ExecutionGrant, or SQLiteEffectStorereservations, 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.