What is BedrockInvokeAgentTool?
BedrockInvokeAgentTool bridges CrewAI's tool loop to Amazon Bedrock Agents, letting a CrewAI worker call into a managed Bedrock workflow (knowledge bases, action groups, guardrails) as if it were just another tool. Authentication and regional endpoints flow through the standard AWS SDK credential chain — instance roles, environment variables, SSO profiles, or explicit keys in development — so the same IAM policies you use for other Bedrock APIs apply here.
Latency and cost differ from native LLM calls: each invocation may fan out to multiple Bedrock subsystems, and streaming responses need to be consumed promptly to avoid socket stalls. Align model and agent IDs with the ARNs in your AWS account; mismatched aliases are a frequent source of AccessDeniedException that surfaces to the planner as a generic tool failure.
Hybrid stacks often pair this tool with native CrewAI tasks: use Bedrock Agents for regulated retrieval over enterprise knowledge and CrewAI for orchestration, human approvals, or Flow-level branching that Bedrock alone does not express cleanly.
When to Use
Hybrid AWS plus CrewAI stacks, reuse of existing Bedrock Agents, or when Bedrock knowledge bases are the system of record.
Use Cases
- • Hybrid stacks
- • Reusing existing Bedrock agents
- • Enterprise RAG locked to Bedrock
Key Features
- ✓ AWS-native auth via boto3 chain
- ✓ Streams responses when configured
- ✓ Treats Bedrock as a tool
When NOT to Use
Pure CrewAI deployments with no AWS dependency — carry the extra SDK surface only when you need it.
Notes
IAM least privilege
Grant bedrock:InvokeAgent only on the specific agent ARN plus kms decrypt if your agent encrypts transcripts. Overly broad star permissions are a common audit finding.
Region alignment
Agent IDs are regional. Instantiate clients in the same region you used when creating the agent or calls fail with confusing endpoint errors.
Timeouts and streaming
Bedrock Agents can stream for a long time. Set aggressive client timeouts at the HTTP layer and teach the CrewAI agent to summarize partial output if users disconnect.
Import
from crewai_tools import BedrockInvokeAgentTool
Key Parameters
| Parameter | Type | Default | Purpose |
|---|---|---|---|
| agent_id / alias | str | — | Bedrock agent identifiers. |
Code Examples
Minimal tool wiring
import os
from crewai import Agent
from crewai_tools import BedrockInvokeAgentTool
agent = Agent(
role='Support assistant',
goal='Answer using the Bedrock agent',
backstory='You prefer the Bedrock agent for policy questions.',
tools=[BedrockInvokeAgentTool(agent_id=os.environ['BEDROCK_AGENT_ID'], alias='prod')],
)
Nonprod alias for staging
from crewai_tools import BedrockInvokeAgentTool
tool = BedrockInvokeAgentTool(agent_id='ABCD1234', alias='staging')
Combine with Serper for web + Bedrock for policy
from crewai import Agent
from crewai_tools import BedrockInvokeAgentTool, SerperDevTool
agent = Agent(
role='Researcher',
goal='Blend web facts with internal policy',
backstory='Call Serper for public info and Bedrock for employee handbook answers.',
tools=[SerperDevTool(), BedrockInvokeAgentTool(agent_id='ABCD1234', alias='prod')],
)
Common Mistakes
❌ Hard-coding access keys in source when IAM roles exist
✅ Use instance/task roles and AWS_PROFILE in dev.
❌ Pointing alias='prod' at an agent that only exists in another account
✅ Verify account + region + alias in the Bedrock console before wiring the tool.
BedrockInvokeAgentTool FAQ
What is BedrockInvokeAgentTool in CrewAI?
Invoke an AWS Bedrock Agent from inside a CrewAI agent — cross-platform delegation. BedrockInvokeAgentTool bridges CrewAI's tool loop to Amazon Bedrock Agents, letting a CrewAI worker call into a managed Bedrock workflow (knowledge bases, action groups, guardrails) as if it were just another tool. Authentication and regional endpoints flow through the standard AWS SDK credential chain — instance roles, environment variables, SSO profiles, or explicit keys in development — so the same IAM policies you use for other Bedrock APIs apply here. Latency and cost d…
Which package defines the CrewAI class BedrockInvokeAgentTool?
DevShelfHub maps BedrockInvokeAgentTool to Python module crewai_tools (package path crewai_tools in this reference). Pin your installed crewai version and match imports to the snippet on this page.
When should I use BedrockInvokeAgentTool?
Hybrid AWS plus CrewAI stacks, reuse of existing Bedrock Agents, or when Bedrock knowledge bases are the system of record.
When should I avoid using BedrockInvokeAgentTool?
Pure CrewAI deployments with no AWS dependency — carry the extra SDK surface only when you need it.
How do I import BedrockInvokeAgentTool in Python?
from crewai_tools import BedrockInvokeAgentTool
Where can I explore more CrewAI API reference pages?
Open the CrewAI API reference index on DevShelfHub to search 58 classes, 30 methods, and 16 decorators, each with runnable examples, parameters, common mistakes, and cross-links.