Skip to content

feat(code_interpreter): support custom boto3 session for cross-account access#496

Open
funkiben wants to merge 1 commit into
strands-agents:mainfrom
funkiben:feat/code-interpreter-custom-boto-session
Open

feat(code_interpreter): support custom boto3 session for cross-account access#496
funkiben wants to merge 1 commit into
strands-agents:mainfrom
funkiben:feat/code-interpreter-custom-boto-session

Conversation

@funkiben
Copy link
Copy Markdown

@funkiben funkiben commented Jun 4, 2026

Description

Closes #495
Adds a boto_session parameter to AgentCoreCodeInterpreter that gets passed through to the underlying BedrockAgentCoreCodeInterpreterClient, enabling cross-account access.

Related Issues

#495

Type of Change

Other (please describe): New feature — adds an optional parameter to an existing tool

Testing

Ran unit tests for the code interpreter module. All 54 tests pass including 3 new tests covering:

  • Initialization with a custom boto3 session

  • init_session passes the boto3 session to the underlying client

  • _ensure_session passes the boto3 session when reconnecting via module cache

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@gautamsirdeshmukh
Copy link
Copy Markdown

/strands review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Assessment: Approve

Clean, well-scoped change that adds cross-account access support via an optional boto_session parameter. The implementation is consistent with the existing pattern in agent_core_memory.py, both client creation points are correctly updated, and the tests cover initialization, session creation, and reconnection paths.

No issues identified.

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.

[FEATURE] AgentCoreCodeInterpreter should support cross account access

2 participants