Skip to content

feat(bedrock): Add AWS Bedrock system tools support.#4469

Open
sktech730 wants to merge 3 commits intocrewAIInc:mainfrom
sktech730:feature/bedrock-system-tools
Open

feat(bedrock): Add AWS Bedrock system tools support.#4469
sktech730 wants to merge 3 commits intocrewAIInc:mainfrom
sktech730:feature/bedrock-system-tools

Conversation

@sktech730
Copy link

@sktech730 sktech730 commented Feb 12, 2026

Summary

Adds support for AWS Bedrock system tools (like Nova Web Grounding) to the CrewAI SDK with full agent integration.

Key Features

  • ✅ System tools configuration support
  • ✅ Full AWS response preservation
  • ✅ Agent integration (sync and async)
  • ✅ Backward compatible

Motivation

AWS Bedrock recently introduced system tools, including Nova Web Grounding, which allows models to search the web for current information. This feature is essential for:

  • Finding current information (pricing, news, updates)
  • Accessing real-time data
  • Grounding responses in factual sources
  • Reducing hallucinations

However, the existing CrewAI SDK doesn't support system tools, preventing users from leveraging this powerful capability.

Related Issue :

Addresses the need for AWS Bedrock system tools support. Alternative to PR #4365 which has breaking changes.
Issue #4363.

Note on mixed tool scenarios: If a response contains both system tool content (citations) and a regular client tool call, the current behavior is:

  • Client tool calls are handled first (executed inline or returned to executor)
  • On recursion/re-call, Bedrock generates a fresh response that may include new system tool results

This is by design — when the model proposes a tool call, the response is incomplete. The recommended pattern for workflows needing both system tools and client tools is to separate them into sequential CrewAI tasks, where Task 1 (system tools) produces output that flows as context into Task 2 (client tools). This leverages CrewAI'"'"'s built-in task composition and avoids complexity of tracking citations across recursive tool calls.'

Files Modified

  1. lib/crewai/src/crewai/llms/providers/bedrock/completion.py (~200 lines)

    • Added system_tools parameter
    • Implemented system tool detection
    • Conditional response type
  2. lib/crewai/src/crewai/llms/providers/bedrock/system_tools.py (new file)

    • Helper functions for system tools
  3. lib/crewai/src/crewai/agents/crew_agent_executor.py (10 lines)

    • Dict response handling (sync + async)
  4. lib/crewai/src/crewai/experimental/crew_agent_executor_flow.py (5 lines)

    • Dict response handling
  5. lib/crewai/src/crewai/lite_agent.py (5 lines)

    • Dict response handling

Total: ~220 lines added, 0 lines removed, 0 breaking changes


Note

Medium Risk
Changes Bedrock provider response types/flow when system tools are enabled and alters tool-call filtering logic, which could affect downstream integrations relying on prior Bedrock return shapes or tool execution behavior.

Overview
Adds AWS Bedrock system tools support to the Bedrock Converse integration by allowing system_tools configuration and passing systemTool entries through tool formatting alongside regular tools.

Updates Bedrock response parsing to treat server_tool_use as Bedrock-executed system tools (not client tool calls), extract/append citation URLs from citationsContent, and when system tools are involved return the full raw Bedrock response dict with an added processed_text convenience field (while keeping string return behavior for non-system-tool calls).

Updates CrewAgentExecutor (sync/async, ReAct and native-tool paths) and LiteAgent to accept dict responses from Bedrock and continue agent processing using processed_text, and adds a helper module (system_tools.py) plus tests covering citation extraction edge cases.

Written by Cursor Bugbot for commit 555cec2. This will update automatically on new commits. Configure here.

Santosh Kulkarni and others added 2 commits February 17, 2026 12:33
Extract citation URLs from citationsContent blocks in both sync and
async code paths, appending them as a Sources section to text responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sktech730 sktech730 force-pushed the feature/bedrock-system-tools branch from 6358c9f to 0aaaf55 Compare February 17, 2026 18:14
Exclude system tool blocks (type=server_tool_use) from the tool_uses
list so they are never misclassified as client-side tools and returned
to the executor before system-tool response parsing runs
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


if not text_content or text_content.strip() == "":
# Skip empty-text fallback when system tools provided content
if (not text_content or text_content.strip() == "") and not has_system_tool_content:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async path missing stop_reason == "tool_use" handling

Medium Severity

The sync _handle_converse has new logic checking stop_reason == "tool_use" to guide the LLM back to the ReAct pattern when text is empty, but _ahandle_converse lacks this check entirely. Async execution with empty text and a tool_use stop reason returns a generic apology instead of the ReAct guidance, causing different agent behavior between sync and async paths.

Additional Locations (1)

Fix in Cursor Fix in Web

result_type = tool_result_block.get("type", "")
if result_type:
logging.debug(
f"System tool result: {result_type} (ID: {tool_result_block.get('toolUseId')})"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate toolResult check in sync content loop

Low Severity

In the sync _handle_converse content block loop, "toolResult" in content_block is checked at two separate locations within the same iteration — once to set has_system_tool_content and again for debug logging. This redundancy also doesn't exist in the async _ahandle_converse loop, creating an inconsistency between the two methods.

Additional Locations (1)

Fix in Cursor Fix in Web

@sktech730
Copy link
Author

@joaomdmoura

This PR resolves issue #4363 by enabling CrewAI Agents to leverage Amazon Bedrock's Nova grounding capabilities as a server-side tool. This enhancement provides agents with more enriched responses that include proper citations and grounding support, improving the accuracy and traceability of generated content.

Please if you could review and test this branch and provide feedback would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant