feat: AgentCore tool search plugin for Strands Agents#494
feat: AgentCore tool search plugin for Strands Agents#494senthilkumarmohan wants to merge 2 commits into
Conversation
notgitika
left a comment
There was a problem hiding this comment.
thanks for contributing! added some comments
| INTENT_SYSTEM_PROMPT = ( | ||
| "You are an intent classifier. Given the recent conversation messages, " | ||
| "produce a concise one-sentence description of what the user is trying to accomplish. " | ||
| "Focus on the type of task, not the specific details. " | ||
| "Reply with ONLY the intent description, nothing else." | ||
| ) |
There was a problem hiding this comment.
could this be prone to user manipulation? like ignore all previous instructions and... is there a way we can validate that?
There was a problem hiding this comment.
DefaultIntentProvider uses the agent's model (which can be configured with Bedrock Guardrails). Users can also pass a custom BedrockModel with guardrails attached via the constructor. Additionally, the intent classifier has a constrained system prompt, no tools, and only receives user-typed messages — so the worst case of prompt injection is a poor search query, not code execution or data leakage.
Open to recommendations if you think we should add additional hardening here.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
=======================================
Coverage ? 89.47%
=======================================
Files ? 89
Lines ? 7745
Branches ? 1157
=======================================
Hits ? 6930
Misses ? 517
Partials ? 298
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8165cda to
287ed95
Compare
Description of changes:
This pull request introduces the AgentCore Tool Search Plugin for Strands Agents, enabling dynamic semantic tool discovery from AgentCore Gateway based on conversation intent.
AgentCore Tool Search Plugin:
AgentCoreToolSearchPluginthat hooks intobefore_invocationto derive user intent from conversation history, search the gateway viax_amz_bedrock_agentcore_search, and dynamically register matching tools into the agent. (src/bedrock_agentcore/gateway/integrations/strands/plugins/agentcore_tool_search/plugin.py)IntentProviderabstract interface for pluggable intent derivation strategies. (src/bedrock_agentcore/gateway/integrations/strands/plugins/agentcore_tool_search/intent_providers/intent_provider.py)DefaultIntentProviderwhich uses an LLM to classify the last N messages into a concise intent string, with support for explicit model override or automatic reuse of the agent's model. (src/bedrock_agentcore/gateway/integrations/strands/plugins/agentcore_tool_search/intent_providers/default_intent_provider.py)Documentation and Examples:
src/bedrock_agentcore/gateway/integrations/strands/plugins/agentcore_tool_search/README.md)Testing and Validation:
tests/bedrock_agentcore/gateway/integrations/strands/test_agentcore_tool_search_plugin.py,tests/bedrock_agentcore/gateway/integrations/strands/test_intent_providers.py)tests_integ/gateway/integrations/test_agentcore_tool_search_plugin.py,tests_integ/gateway/integrations/lambda_function/lambda_function.py)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.