[AAASM-3536] ✨ (adapters): Add LlamaIndex framework adapter#163
Merged
Conversation
Wrap the concrete FunctionTool.call / acall execution hooks so a denied tool's underlying function never runs, an allowed one runs and is recorded, and deny returns a ToolOutput(is_error=True). Reuses the shared CrewAI decision-normalization (fail-closed under enforce, AAASM-3107). Refs AAASM-3536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the builtin adapter and its priority slot so init_assembly() auto-detects and hooks LlamaIndex whenever it is importable. Refs AAASM-3536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prove a denied tool's body never runs (fake-module + real FunctionTool via importorskip) and an allowed tool runs and is recorded. Includes a negative-control test so the deny assertions fail if the patch is reverted to a no-op pass-through. Refs AAASM-3536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dev/test-only (not a runtime dependency). Installing it lets the importorskip-guarded LlamaIndex governance tests run in CI against a real FunctionTool instead of silently skipping. Refs AAASM-3536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the LlamaIndex row to the README and frameworks.md compatibility tables and a hook-point note explaining the FunctionTool.call / acall patch. Refs AAASM-3536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
2 tasks
Contributor
Author
|
Claude Code — review result ✅ Real CI green (SonarCloud not blocking).
Ready to merge. Merge before examples #152 + a python-sdk release. Full cross-repo review on AAASM-3535. |
Resolve registry + README + frameworks.md overlaps after py #160 (Haystack) merged: keep both frameworks' entries/imports/builtins/rows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eat/llamaindex_support # Conflicts: # README.md # agent_assembly/adapters/registry.py # pyproject.toml
…eat/llamaindex_support # Conflicts: # README.md # agent_assembly/adapters/registry.py # docs/compatibility/frameworks.md # pyproject.toml # uv.lock
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adds full LlamaIndex framework support to the Python SDK. A new
agent_assembly.adapters.llamaindexadapter installs SDK-layer pre-executionallow/deny and audit hooks by patching the concrete LlamaIndex tool-execution
methods:
FunctionTool.call(sync) andFunctionTool.acall(async). Themodern agent stack (
FunctionAgent/ReActAgentviaAgentWorkflow) awaitstool.acall(...); the legacy/sync path callstool.call(...). Both are hookedso a denied tool's underlying function never executes. On a deny verdict the
adapter returns a
ToolOutput(is_error=True)so the agent loop receives awell-formed result instead of crashing. The adapter is registered as a builtin
in the registry and advertises
get_supported_versions() == [">=0.10.0"].Decision normalization (fail-closed under
enforce, AAASM-3107) is reused fromthe shared CrewAI patch rather than re-implemented.
Type of Change
Breaking Changes
Related Issues
Testing
The tests prove genuine governance, not a no-op (the AAASM-3528 lesson):
fake module and a real
FunctionTool(viaimportorskip), sync and async.is reverted to a transparent pass-through.
FAIL (tool body executes); restoring the patch makes them pass.
llama-index-coreadded to thetestdependency group so the real-packagegovernance tests run in CI rather than skipping.
ruff + pre-commit clean on changed files.
Checklist
Refs AAASM-3536
🤖 Generated with Claude Code