Pre/post tool hook · PyPI 0.1.0 · Alpha · Apache-2.0
crewai-acgs for CrewAI.
Connects ACGS-Lite rule evaluation to CrewAI's native before_tool_call and after_tool_call hook registry.
Package Specification · Inspected HEAD b629f00
- Framework maintainer
- CrewAI · crewai.com
- Upstream repository
- crewAIInc/crewAI
- PyPI release
- crewai-acgs==0.1.0
- Python requirement
- >=3.10,<3.14
- Framework constraint
- crewai>=1.15.3,<2
- Governance engine pin
- acgs-lite>=3.0.1,<4
- Integration mechanic
- Pre-tool veto / intervention hook
- Hook entry point
- ACGSToolCallHook.before_tool_call / after_tool_call / register
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 "crewai-acgs==0.1.0"Python · CrewAI integration
src/crewai_acgs/hooks.py#L51from crewai_acgs import ACGSToolCallHook
with ACGSToolCallHook():
result = crew.kickoff()02 · Verdict & Review Mapping
How ACGS-Lite verdicts map to CrewAI.
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.
Allows InterceptionPoint.PRE_TOOL_CALL to proceed to the CrewAI tool executor.
Raises HookAborted so CrewAI skips the tool and returns the ACGS violation reason to the agent.
Denied by default; supports on_review='human_input' or a custom callable approval handler.
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 · crewai-acgs
src/crewai_acgs/hooks.py#L51 ↗ACGSToolCallHookHOOK_SOURCEReviewHandlerGovernanceDecisionToolCallFormatterVerdictformat_tool_callPrimary hook surface: ACGSToolCallHook.before_tool_call / after_tool_call / register. 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 crewai-acgs into an evaluation workflow.
- 01
ACGSToolCallHook registers process-wide CrewAI tool hooks while active; use the context manager or call unregister() when finished.
- 02
Requires crewai>=1.15.3 for HookAborted support.
- 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.