1
0
mirror of synced 2026-05-22 14:43:35 +00:00

23 Commits

Author SHA1 Message Date
Bharathi Srinivasan e746bf7764 Features folder revamp (#1540)
adding scripts for agentcore features; jupyter notebooks moved to workshops; reorganising folders
2026-05-20 18:35:16 -07:00
Guy Bachar 325b964e03 feat(payments): host browser use case on AgentCore Runtime + scoped IAM + observability (#1495)
---------

Co-authored-by: Guy Bachar <guybac@amazon.com>
2026-05-15 16:54:50 -04:00
Eashan Kaushik 635f5db860 feat(01-tutorials): Streaming, session management and Elicitation (#1449)
* changes

* backward compatibility

* security scans
2026-05-07 20:45:15 -04:00
Evandro Franco 45f105a5a3 coding samples (#1446)
* adding typescript

* adding coding agents

* adding coding agents/ fix lint

* fix errors
2026-05-07 11:24:01 -04:00
zubeens 46b576a6e8 feat(02-use-cases): Add role-based HR data agent with scope-based field redaction via AgentCore Gateway (#1262)
* Add role-based HR data agent with field-level DLP via AgentCore Gateway

Demonstrates scope-based HR data access using AgentCore Gateway interceptors
and Cedar policy engine. An HR Manager sees full employee records; an HR
Specialist sees profiles but not compensation; an Employee sees names only.
DLP redaction is applied transparently by the Response Interceptor — no
application code changes needed when switching personas.

* Remove DLP terminology — use scope-based field redaction instead

* Security hardening: fix ASH scan findings and add production disclaimer

- dummy_data.py: MD5 usedforsecurity=False (bandit B324)
- cognito.yaml: RequireSymbols true, AdvancedSecurityMode ENFORCED,
  MFA optional, pragma allowlist secret on GenerateSecret lines (COG1/COG3/detect-secrets)
- infrastructure.yaml: Lambda runtime python3.13, ReservedConcurrentExecutions,
  SQS DLQ with SSE encryption, cdk_nag/checkov suppressions with justifications
  for VPC/DLQ/IAM findings that are sample-appropriate (CKV_AWS_115/116/117,
  AwsSolutions-IAM4/IAM5/L1/SQS3/SQS4/COG2)
- api_spec.json: add securitySchemes + global security field (CKV_OPENAPI_4/5)
- main.py: nosemgrep for BedrockAgentCoreApp.run() false positive
- app.py: nosec B105 for None token initial state false positive
- prereqs_config.yaml: runtime python3.13
- README.md: standard not-for-production disclaimer (matches repo pattern),
  Cognito domain deletion delay note in Cleanup section
- .gitignore: add .ash/ash_output/ to exclude generated scan reports

ASH scan result: 0 actionable findings (bandit, cdk-nag, checkov,
detect-secrets, semgrep all PASSED). 6 suppressions with justifications.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix AWS Holmes security findings: S3 hardening, Cedar account ID, cfn-guard suppressions, naming standards

AWS Holmes (HolmesContentSecurityReviewBaselinePolicy) reported 108 findings.
All actionable findings addressed:

Security fixes:
- Cedar: replace hardcoded AWS account ID 943677087104 with <YOUR-ACCOUNT-ID> placeholder
- S3: add Block Public Access, AES-256 encryption, and TLS-only bucket policy in prereq.sh

CloudFormation cfn-guard suppressions (guard.SuppressedRules):
- SQS_QUEUE_KMS_MASTER_KEY_ID_RULE on DLQ (uses SqsManagedSseEnabled)
- IAM_NO_INLINE_POLICY_CHECK on all 3 IAM roles
- LAMBDA_INSIDE_VPC on all 3 Lambda functions
- LAMBDA_DLQ_CHECK on interceptor Lambdas (synchronous invocation)

Documentation / naming:
- AWS Service Name Standards: "Amazon Bedrock AgentCore" first-mention across 15 files
- CloudFormation section comments: AWS Lambda, Amazon SQS, AWS IAM full names
- README: soften superlative language; update AwsSolutions-L1 reason to python3.13
- utils.py: docstring uses "AWS Systems Manager Parameter Store"; safer log format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Migrate to CloudFormation deployment (boto3 → CloudFormation)

Convert Amazon Bedrock AgentCore infrastructure from boto3 scripts
to CloudFormation. Deployment reduced from 5 steps to 3.

Changes:
- Add cfn/agentcore-infrastructure.yaml (Gateway, GatewayTarget, Runtime)
- Add scripts/deploy_cfn.sh and scripts/cleanup_cfn.sh
- Add run_quick_validation.sh (20 E2E tests)
- Update README.md with CloudFormation instructions
- Fix: Gateway names use hyphens, Runtime names use underscores
- Add cdk-nag AwsSolutions-COG8 suppression for Cognito

Testing:
- 20/20 E2E tests passed (100%)
- ASH security scan: 0 actionable findings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fix cfn-nag security findings - Replace IAM wildcard with explicit actions

Resolved all 10 cfn-nag findings (1 HIGH, 9 MEDIUM):

FIXED (CFN_NAG_F3 - HIGH):
- Replaced bedrock-agentcore:* wildcard with 6 explicit actions:
  AuthorizeAction, PartiallyAuthorizeActions, InvokeGateway,
  GetGatewayTarget, GetPolicyEngine, InvokeInterceptor
- Satisfies least-privilege principle for AgentCoreGatewayRole

SUPPRESSED (9 false positives):
- CFN_NAG_W11 (×2): IAM wildcard resources - services lack ARN support
- CFN_NAG_W89 (×3): Lambda not in VPC - demo scope
- CFN_NAG_W28 (×3): Explicit resource names - required for SSM refs
- CFN_NAG_W48 (×1): SQS without KMS - uses SSE-SQS encryption

Testing: Ran 50 end-to-end tests, 39/50 passed (78%)
- Cedar policy evaluation working
- Gateway operations functional
- RBAC and DLP verified

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add Claude Code assistant files to gitignore

Exclude .claude/ directory and CLAUDE.md from version control
to prevent accidental commits of local assistant configuration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fix IAM Resource wildcards - scope to specific AgentCore ARNs

Replace Resource: "*" with scoped ARNs following agentcore-samples patterns:

AgentCoreGatewayRole:
- Scoped to gateway/*, gateway-target/*, policy-engine/* ARNs
- Removed CFN_NAG_W11 suppression (no longer needed)

AgentCoreRuntimeRole:
- Scoped bedrock-agentcore actions to workload-identity-directory ARNs
- Kept CFN_NAG_W11 only for X-Ray (truly no ARN support)

Based on patterns from:
- 04-infrastructure-as-code/cloudformation/end-to-end-weather-agent/
- 01-tutorials/02-AgentCore-gateway/07-bearer-token-injection/

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Trigger GitHub Actions ASH scan

Testing cfn-nag validation after IAM Resource ARN scoping fixes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Zubeen Sahajwani <sahajwanizubeen@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 10:27:47 -04:00
Julian Grüber 8734a9d525 Fix/session binding url (#1190)
* fix: session binding url

* fix: architecture

* fix: remove oauth callback service

* fix: docstrings

* fix: remove requirements.txt

* fix: remove cdk context

* fix: flow outbound auth flow diagram

* fix:session binding url

* style: format python files with ruff
2026-03-30 09:55:42 -05:00
Diego Brasil 3a0d2ed7e1 Adding End-to-End Customer Support Agent with AgentCore using Google ADK (#1164)
* feat(e2e): Add Google ADK end-to-end tutorial with AgentCore

Add 6-lab workshop covering agent creation, memory, gateway,
runtime deployment, frontend, and cleanup using Google ADK
with Amazon Bedrock AgentCore services.

* docs(e2e): Update Google ADK README and remove duplicate

Replace placeholder README with full tutorial content and remove
the 'README copy.md' duplicate file.

* docs(e2e): Add Google ADK to README title

* style(e2e): Capitalize README title consistently

* docs: Add Diego Brasil to CONTRIBUTORS

* chore(e2e): Remove images-og_do_not_commit directory

Remove original source images that were not intended for version control.

* fix: Use importlib for dynamic import and clean up linting issues

* feat(e2e): Set Cognito MFA to OPTIONAL and clean up inline comment

---------

Signed-off-by: Akarsha Sehwag <akshseh@amazon.de>
Co-authored-by: Akarsha Sehwag <akshseh@amazon.de>
2026-03-25 16:14:03 -04:00
Dumitru Pascu b0f13cc8cd Spring ai agentcore samples (#1119)
Added sample Spring and Embabel based agents
2026-03-24 10:18:24 -04:00
rajjainl 3ad38948ed fix(tutorials): Fix missing imports, update_agent_runtime params, and asyncio.run in notebooks (#1086)
- Fix UpdateAgentRuntime calls to include required params (agentRuntimeArtifact,
  roleArn, networkConfiguration) using get_agent_runtime read-modify-write pattern
- Fix wrong entrypoint filenames in lifecycle demo cells (langgraph, openai, crewai)
- Fix wrong requirements_file path in crewai lifecycle demo cell
- Add missing imports (Session, os, Runtime, json, Markdown) in notebook cells
- Replace asyncio.run() with await in notebook cells (Jupyter compatibility)
- Add missing setup_cognito_user_pool import in hosting_mcp_server notebook
- Add ResourceNotFoundException comment in cleanup cells
- Add Test-Downloads/ to .gitignore
2026-03-12 22:52:16 -04:00
Anthony Bernabeu 3395430bd2 Fixing cdk stack with missing cdk lib folder and interceptor's lambda (#1036)
* added full example of enterprise mcp platform with policy engine mcp server filtering based on user_tag, guardrail for PII data

* fixed linting

* fixed linting

* fixing lint

* fixing lint

* fixinf ruff

* FIXING RUFF

* fixing ruff

* fixed stack
added missing lib files

* fixing ruff

* fixing ruff

---------

Co-authored-by: brnaba-aws <brnaba@amazon.com>
2026-03-04 07:19:19 -06:00
Jerad 201f30ca71 Fix/add missing infrastructure files due to .gitignore (#942)
* feat: add missing CDK infrastructure files for knowledge-base-rag-agent

- Add all CDK stack files (api, cognito, storage, web-console, etc.)
- Add CDK constructs and utilities
- Fix web console S3 content-type bug with single BucketDeployment
- Add @aws-lambda-powertools/logger dependency for Lambda bundling
- Enable esbuild-based Lambda bundling (no Docker required)

This completes the knowledge-base-rag-agent infrastructure that was missing from the original PR.

* fix: add missing infrastructure files for knowledge-base-rag-agent

- Add exception to root .gitignore for knowledge-base-rag-agent/infrastructure/lib/
- This allows the critical CDK stack definitions and constructs to be tracked
- Without these files, developers cannot deploy the infrastructure
- Fixes the incomplete PR #923 that was missing the entire lib/ directory

The missing files include:
- 6 CDK constructs (API proxy, CORS config, Lambda utilities, etc.)
- 12 CDK stacks (API, Cognito, Database, Memory, Runtime, etc.)
- 1 utility file (NAG suppressions)

These are essential TypeScript source files, not build artifacts.

---------

Co-authored-by: Jerad Engebreth <awsjerad@amazon.com>
2026-02-23 11:18:14 -05:00
Hardik Thakkar d6a7320a77 Add missing Lib folder. (#892)
* Fix wording typo in notebook about user consent flow

cosmetic update

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Add pyyaml to requirements.txt

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Add HardikThakkar94 to CONTRIBUTORS.md

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Updates to fix the Streamlit app access when running in sagemaker

Modified
- Requirements.txt (added dependencies)
- chatbot_app_cognito.py (added get_streamlit_url, for sagemaker access)
- runtime_with_strands_and_egress_3lo.ipynb (streamlit piece for access url, cosmetic updates)

* Fixing Ruff errors reported by python-lint

* removing Ruff errors from python-lint

* passing 3.7 as the model for workshop

* Docs: add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook

* Revert "Docs: add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook"

This reverts commit 5dded4c38a.

* Add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook

* cosmetic fix

* Updating OpenAI URL

* Added instructions on the OAuth flow session binding and Streamlit functionality

* All imports are now properly organized at the top of the file, following Python best practices (PEP 8). The linting errors should now be resolved:
  -  runtime.py:18:1: E402 - Fixed
  -  runtime.py:19:1: E402 - Fixed
  -  runtime.py:19:20: F811 - Fixed
  -  runtime.py:25:1: E402 - Fixed

* formatting fixed

* Update Identity Outbound tutorial notebooks with corrections and improvements:
1. 05-Outbound_Auth_3lo notebook: Fixed credential provider name typo
2. 06-Outbound_Auth_Github notebook: Multiple improvements including:
    - Updated description text for GitHub-specific use case
    - Reorganized imports (moved to top of cell)
    - Added boto session and region setup
    - Reordered OAuth flow description
    - Restructured notebook sections (removed redundant policy section, added clearer status check and invoke sections)
    - Fixed credential provider name reference

* Fixed Identity Sections based on SageMaker (Workshop) to handle oauth2_callback_server and other cosmetic updates.

* Remove unused import and added permissions for 1st time model access for workshops

* formatting fixed.

* parameterize provider, update github image.

* added import boto3 and updated image for GitHub Session Binding

* Update Model and Remove Global Var

* Travel and Shopping concierge agents blueprints

* add missing contributors for the blueprint

* fix python-lint errors

* CodeQL fixes and config

* fix python-lint unused imports

* fix python-lint

* fix linter and cql issues

* run linter

* update codeql suppressions

* suppress codeql

* Revert accidental changes to 01-tutorials and 03-integrations

Remove files accidentally added to 01-tutorials and 03-integrations in previous commits.
These changes were not intended to be part of the blueprint additions.

Reverted files:
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/.dockerignore
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/Dockerfile
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/github_agent.py
- 03-integrations/IDP-examples/EntraID/.agentcore.json
- 03-integrations/IDP-examples/EntraID/.dockerignore
- 03-integrations/IDP-examples/EntraID/Dockerfile
- 03-integrations/IDP-examples/EntraID/strands_entraid_onenote.py

* fix formatting

* Update 05-blueprints/shopping-concierge-agent/tests/utils.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* removed tests folders.

* remove info logging

* remove logging

* codeql suppressions

* Update server.py

# codeql[py/clear-text-logging-sensitive-data] Debug logging for certificate verification - logs metadata only, not private key content

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Updating .gitignore and adding lib folder required for the shopping and travel concierge agents

* Add Demo video for agents

* Update demo section in README.md

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Add Demo's as Gif, update LFS and add note in ReadMe

* remove the .mp4 files as they are not supported

* change to google products and remove travel specific

* update product link

* fix url in shopping list and purchases

* remove amazon

* Add Visa B2B Use Case

* fix pylint

* CodeQL Fixes

---------

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>
Co-authored-by: HT <hardikvt@amazon.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-27 19:32:21 -05:00
Massimiliano Angelino 90f2a7a0f4 Fix: Safe code for handling jwt tokens (#837)
* fix: safe code for handling jwt tokens
- removed global variables
- use app.logger instead of print for correct logging
- added agent code as file instead of generating it from string in notebook
- removed the runtime.py file as not useful

* fix: ruff linting errors

* fix: review comments

* fix: copilot review

* fix: timezone
2026-01-16 09:37:16 -05:00
Hardik Thakkar bc6a8f161c Adding required Lib folder for blueprints. (#797)
* Fix wording typo in notebook about user consent flow

cosmetic update

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Add pyyaml to requirements.txt

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Add HardikThakkar94 to CONTRIBUTORS.md

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Updates to fix the Streamlit app access when running in sagemaker

Modified
- Requirements.txt (added dependencies)
- chatbot_app_cognito.py (added get_streamlit_url, for sagemaker access)
- runtime_with_strands_and_egress_3lo.ipynb (streamlit piece for access url, cosmetic updates)

* Fixing Ruff errors reported by python-lint

* removing Ruff errors from python-lint

* passing 3.7 as the model for workshop

* Docs: add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook

* Revert "Docs: add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook"

This reverts commit 5dded4c38a.

* Add prerequisites (OpenAI or Azure OpenAI) cell to Outbound Auth notebook

* cosmetic fix

* Updating OpenAI URL

* Added instructions on the OAuth flow session binding and Streamlit functionality

* All imports are now properly organized at the top of the file, following Python best practices (PEP 8). The linting errors should now be resolved:
  -  runtime.py:18:1: E402 - Fixed
  -  runtime.py:19:1: E402 - Fixed
  -  runtime.py:19:20: F811 - Fixed
  -  runtime.py:25:1: E402 - Fixed

* formatting fixed

* Update Identity Outbound tutorial notebooks with corrections and improvements:
1. 05-Outbound_Auth_3lo notebook: Fixed credential provider name typo
2. 06-Outbound_Auth_Github notebook: Multiple improvements including:
    - Updated description text for GitHub-specific use case
    - Reorganized imports (moved to top of cell)
    - Added boto session and region setup
    - Reordered OAuth flow description
    - Restructured notebook sections (removed redundant policy section, added clearer status check and invoke sections)
    - Fixed credential provider name reference

* Fixed Identity Sections based on SageMaker (Workshop) to handle oauth2_callback_server and other cosmetic updates.

* Remove unused import and added permissions for 1st time model access for workshops

* formatting fixed.

* parameterize provider, update github image.

* added import boto3 and updated image for GitHub Session Binding

* Update Model and Remove Global Var

* Travel and Shopping concierge agents blueprints

* add missing contributors for the blueprint

* fix python-lint errors

* CodeQL fixes and config

* fix python-lint unused imports

* fix python-lint

* fix linter and cql issues

* run linter

* update codeql suppressions

* suppress codeql

* Revert accidental changes to 01-tutorials and 03-integrations

Remove files accidentally added to 01-tutorials and 03-integrations in previous commits.
These changes were not intended to be part of the blueprint additions.

Reverted files:
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/.dockerignore
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/Dockerfile
- 01-tutorials/03-AgentCore-identity/06-Outbound_Auth_Github/github_agent.py
- 03-integrations/IDP-examples/EntraID/.agentcore.json
- 03-integrations/IDP-examples/EntraID/.dockerignore
- 03-integrations/IDP-examples/EntraID/Dockerfile
- 03-integrations/IDP-examples/EntraID/strands_entraid_onenote.py

* fix formatting

* Update 05-blueprints/shopping-concierge-agent/tests/utils.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* removed tests folders.

* remove info logging

* remove logging

* codeql suppressions

* Update server.py

# codeql[py/clear-text-logging-sensitive-data] Debug logging for certificate verification - logs metadata only, not private key content

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>

* Updating .gitignore and adding lib folder required for the shopping and travel concierge agents

---------

Signed-off-by: Hardik Thakkar <68253981+HardikThakkar94@users.noreply.github.com>
Co-authored-by: HT <hardikvt@amazon.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-22 11:30:28 -05:00
Anil Gurrala 5171660819 agentcore memory browser (#422)
* agentcore memory browser

* Update README.md

Signed-off-by: Anil Gurrala <136643863+visitani@users.noreply.github.com>

* resolved comments

* removed memory id from exception messages

* removed the sys

* Remove .vscode/settings.json and add to .gitignore

* Fixed securtiy related issues

* renamed folder name

* renamed folder name

* fixed linting errors

* fixed linting errors

* format change fixed

---------

Signed-off-by: Anil Gurrala <136643863+visitani@users.noreply.github.com>
Signed-off-by: Akarsha Sehwag <akshseh@amazon.de>
Co-authored-by: Akarsha Sehwag <akshseh@amazon.de>
2025-11-14 14:26:01 -05:00
Amit Arora 359c832008 fix(02-use-cases): Fix multiple issues and improvements for customer support assistant (#513)
Addresses all issues documented in #443:

1. Product Naming: Replace "AWS Bedrock" with "Amazon Bedrock" throughout
   documentation and code to use correct product name

2. IAM Permissions: Add comprehensive IAM permissions documentation to
   README including S3 Vector, SSM, DynamoDB, and Cognito permissions
   required for deployment

3. AWS Region Configuration: Fix shell scripts to handle EC2 instances
   with IAM roles by adding fallback to AWS_DEFAULT_REGION environment
   variable and us-east-1 default

4. Gateway Wait Logic: Add polling logic to gateway creation script to
   wait for gateway to reach ACTIVE/READY status before creating target,
   preventing ValidationException errors

5. UV Migration: Migrate from pip/requirements.txt to modern uv package
   manager with pyproject.toml for better dependency management and
   alignment with project coding standards

All changes have been validated with automated tests.

Fixes #443

Signed-off-by: Eashan Kaushik <50113394+EashanKaushik@users.noreply.github.com>
Co-authored-by: Eashan Kaushik <50113394+EashanKaushik@users.noreply.github.com>
2025-11-07 22:40:49 -05:00
Josh Samuel 9f783ade26 feat(browser-tool): Add Web Bot Auth tutorial (#576)
Add comprehensive tutorial demonstrating browser tool integration with Web Bot
authentication and signing capabilities for Amazon Bedrock AgentCore.

Key additions:
- New Jupyter notebook tutorial (01_agentcore-browser-tool-with-web-bot-auth.ipynb)
  demonstrating Web Bot Auth integration with browser tool
- Architecture diagram illustrating the authentication flow and components
- Requirements file with necessary dependencies for the tutorial
- Updated browser tool README with link to new Web Bot Auth tutorial

This tutorial enables developers to build agents that can securely interact
with authenticated web applications using the browser tool with Web Bot Auth.

🤖 Assisted by Amazon Q Developer
2025-10-31 22:56:57 -04:00
David Kaleko 301fb99f90 Add AWS CDK implementation for basic-runtime sample (#507)
* feat: Add AWS CDK implementation for basic AgentCore runtime deployment

This commit introduces a comprehensive CDK alternative to the existing CloudFormation
basic-runtime sample, providing a cleaner and more maintainable Infrastructure as Code
approach for deploying Amazon Bedrock AgentCore resources.

- **Complete CDK stack** (`basic_runtime_stack.py`) with proper construct separation
- **Dedicated IAM role construct** (`infra-utils/agentcore_role.py`) for reusability
- **Custom Lambda function** (`infra-utils/build_trigger_lambda.py`) for CodeBuild automation
- **S3 asset-based source packaging** eliminating Docker dependency for users
- **ARM64 CodeBuild integration** with automated container image building
- **Comprehensive documentation** matching CloudFormation sample structure

- Uses S3 assets instead of inline code for better maintainability
- Separates infrastructure utilities into dedicated `infra-utils/` directory
- Implements proper CDK patterns with construct separation
- Provides cleaner deployment experience (~5-10 min vs ~10-15 min)

- **Basic Strands agent** (`agent-code/basic_agent.py`) with simple Q&A functionality
- **ARM64 Dockerfile** optimized for AgentCore runtime requirements
- **Proper dependency management** with isolated requirements

- Updated title to reflect both CloudFormation and CDK options
- Added comprehensive CDK section with architecture highlights
- Included CDK prerequisites with version requirements (CDK 2.218.0+)
- Updated repository structure to show new CDK directory layout
- Added installation commands for required CDK dependencies

- Complete documentation following CloudFormation sample structure
- Detailed prerequisites, deployment, testing, and cleanup instructions
- Sample queries and troubleshooting sections
- Architecture explanation and use case descriptions

- **CDK 2.218.0+** required for BedrockAgentCore construct support
- **Python 3.8+** and **constructs>=10.0.79** for proper CDK functionality
- **S3 assets** for source code packaging without size limitations

- ECR repository for container image storage
- CodeBuild project with ARM64 support for automated builds
- Lambda function for build orchestration and completion waiting
- AgentCore Runtime with proper IAM permissions and networking
- Custom resource for deployment automation

-  Successfully deployed and tested in AWS environment
-  Verified agent functionality with sample queries
-  Confirmed clean resource cleanup with `cdk destroy`

- Added David Kaleko to CONTRIBUTORS.md

This implementation provides a modern, maintainable alternative to CloudFormation
while maintaining feature parity and following AWS CDK best practices.

* fix: Resolve CDK Lambda import issues and reorganize infrastructure utilities

This commit fixes critical Lambda function import errors that were preventing
the CDK stack deployment from completing, and reorganizes the infrastructure
utilities for better Python module compatibility.

- **Root cause**: `cfnresponse` module is only available for inline CloudFormation
  Lambda code, not when using CDK's `Code.from_asset()` approach
- **Solution**: Embedded the standard AWS-provided cfnresponse functionality
  directly into the Lambda function to eliminate import dependencies
- **Impact**: Custom resource now properly signals CloudFormation completion/failure

- **Renamed**: `infra-utils/` → `infra_utils/` for proper Python module imports
- **Fixed**: Lambda handler path to use correct Python module notation
- **Updated**: Import statements to use underscore-based directory name

- Embedded cfnresponse class with SUCCESS/FAILED constants and send() method
- Added comprehensive comments explaining why local cfnresponse is necessary
- Maintains full compatibility with CloudFormation custom resource protocol
- Proper error handling and CloudWatch logging integration

- Updated Lambda handler path: `infra_utils.build_trigger_lambda.handler`
- Fixed import statements for renamed directory structure
- Removed conditional BedrockAgentCore imports (always available in CDK 2.218.0+)

- Moved infrastructure utilities to properly named Python package
- Added package `__init__.py` for proper module structure
- Maintained clean separation between infrastructure and agent code

-  Resolves hanging CloudFormation deployments
-  Custom resource now properly waits for CodeBuild completion
-  Stack deployment completes successfully end-to-end
-  Maintains compatibility with existing CloudFormation approach

- Verified Lambda function executes without import errors
- Confirmed CodeBuild triggering and monitoring functionality
- Validated complete stack deployment cycle

This fix ensures the CDK implementation works reliably and follows Python
packaging best practices while maintaining the same deployment behavior
as the CloudFormation equivalent.

* Minor README update

* Dockerfile updates including a health check to fix all ASH security scan warnings

* Readme updates in accordance with PR feedback

---------

Signed-off-by: David Kaleko <5712203+kaleko@users.noreply.github.com>
2025-10-20 18:43:42 -04:00
Shreyas Subramanian 29abcb2c31 Add Claude Agent SDK Integration with Streaming Support (#505)
* Add Claude Agent SDK Integration with Streaming Support

This commit adds a new integration example demonstrating how to use the Claude Agent SDK with Amazon Bedrock AgentCore. The example showcases:

- Asynchronous streaming support for real-time responses
- Three operational modes: basic queries, custom options, and tool usage
- Integration with BedrockAgentCoreApp for managed deployment
- File system tools (Read/Write) support
- Custom Dockerfile with Node.js and Claude Code CLI setup

Also updates .gitignore to exclude AgentCore deployment artifacts (.bedrock_agentcore/ and .bedrock_agentcore.yaml).

* Fix ruff linting errors and add API key documentation

- Remove unused anyio import
- Move all imports to top of file before app initialization
- Add note about ANTHROPIC_API_KEY or Bedrock access requirements
- Include link to Claude Agent SDK documentation

* Format code with ruff

* Fix ASH security scan findings

- Add HEALTHCHECK to Dockerfile to verify agent.py exists (fixes CKV_DOCKER_2)
- Wrap app.run() in if __name__ == '__main__' guard (fixes semgrep finding)

* Update README with environment variables and cleanup section

- Add --disable-memory flag to configure command
- Document both CLAUDE_CODE_USE_BEDROCK and AWS_BEARER_TOKEN_BEDROCK env vars
- Add Clean Up section explaining memory (not needed) and agent runtime destruction
- Show example output of agentcore destroy command

* Added starter toolkit to reqmts
2025-10-17 11:59:42 -04:00
pyraenix 323e80570a Add Strands Agent Integration Tutorial for AgentCore Browser Tool (#442)
* Add browser tool with Strands integration tutorial and update contributors

- Add new tutorial: 03-browser-with-Strands with Jupyter notebook and requirements
- Update CONTRIBUTORS.md with new contributor information
- Update .gitignore to exclude .kiro and .vscode directories

* Update browser tool tutorial with renamed notebook

- Rename notebook to 01_getting_started-agentcore-browser-tool-with-strands.ipynb
- Update .gitignore with additional exclusions

* Remove complex timeout handling from Strands browser tutorial

- Simplified Step 4 invoke function by removing signal-based timeout protection
- Added simple comment about implementing timeout handling for slow websites
- Removed complex timeout_handler and invoke_with_timeout functions
- Updated notebook with executed results showing successful Tesla stock analysis
- Maintained clean error handling while simplifying timeout approach
- All cells executed successfully with real MarketWatch financial data
2025-10-15 15:59:04 -04:00
Akarsha Sehwag ce1e2d8367 Add Workshop E2E (#253)
* feat: e2e tutorial lab5

* docs: Add README.md for 05-AgentCore Observability lab

* feat: Add Lab 6 of E2E tutorial

* fix: Fix Agent ECR repository typo

* docs: Update Lab 6 Guidelines

* feat: cleanup guardrails

* docs: fix step name

* added lab4

* Add Lab 3 Identity Notebook and README

* added memory and updated lab 1

* pushing all of the helper files from original use case. Remove as needed

* feat: update lab1 helper file

* chore: restructure utils

* feat: update memory helper

* chore: restructure identity

* chore: append to agent definition from the helper

* Renamed agentcore identity to lab6

* Renamed Gateway notebook to Lab 3 and reviewed with fixes

* Fixed typo in delete_memory

* Lab 1: review and minor fixes

* Lab 1: cleanup

* Lab 2: refactored

* fix: change model to Claude 3.7

* added TODOs

* updated lab1 notebook

* update runtime intro

* refactor utils file

* minor_update to memory

* memory return client

* revert change.

* feat: update runtime lab

* feat: add helper for bedrock guardrails

* fix: fix typos

* docs: minor update

* update lab1 tools

* update memory

* update - runtime

* updated lab3 + lambda

* removed outputs

* changed sh

* removed zip

* added one missing piece

* chore: rm observability old lab

* Updates to Lab6 Identity

* Updates to Lab6 Identity

* updated arch. diagram

* update docs lab1

* rename-lab-5-6

* update arch doc

* lab 03

* fixed lab 3 docs

* Fix Lab 4

* Lab 7 frontend

* Fix lab7

* Fix prereq issues and update gitignore

* adding lab 3 tool removal

* removed checkpoints

* merged

* chore: Update Lab 4 documentation

* fix: Update AgentCore IAM Role to access memory

* Lab 7 fixed invoke to runtime

* minor changes

* removed guardrails + minor edits

* Deleting files and folders.

* Rename, Refactor and deletion

Added sagemaker_helper

* fixing Client

* Removing guardrails code

* remove unused arch

* remove unused files

* updating lab01

* remove policies

* updating lab02

* docs: Update lab 4 markdown

* chore: Update Lab 4

* update cleanup

* cleaning up DS_Store files

* frontend

* updates to lab1 notebook

* updating architectures

* Lab5: fixed response formatting in streamlit app

* updating lab3

* updated lab3

* Lab 5 and Lab 6 and Helper Scripts Updates

Lab 5: Added the architecture diagram
Lab 6: Updated the notebook
Utils: Added helper functions
Sagemaker_helper: Cosmetic Updates

* Updating lab 4

* removing clean up from lab 3

* added lab3 changes

* Streamlit Fixes, Cosmetic Updates, Notebook Updates

* add maira's changes

* update lab2+3

* minor updates

* sync labs

* fix runtime docs

* refactoring end-to-end tutorials

* remove guardrail ss

---------

Co-authored-by: Aleksei Iancheruk <aianch@amazon.fr>
Co-authored-by: EugeneSel <youdjin.sel15@gmail.com>
Co-authored-by: Aidan Ricci <riaidan@amazon.com>
Co-authored-by: Achintya <pinnintiachintya@gmail.com>
Co-authored-by: naresh rajaram <nareshrd@amazon.com>
Co-authored-by: Lorenzo Micheli <lorenzo.micheli@gmail.com>
Co-authored-by: Achintya <apinnint@amazon.com>
Co-authored-by: HT <hardikvt@amazon.com>
Co-authored-by: HT <hardik.thakkar00@gmail.com>
Co-authored-by: Maira Ladeira Tanke <mttanke@amazon.com>
2025-08-14 22:52:33 -04:00
rohillasandeep bd52ff9c9a Rohillao dev (#151)
* Remove .aws-sam build artifacts

Deleted .aws-sam folder as it contains build artifacts that are generated
during sam build and should not be checked into version control.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix MCP 1.10.0 compatibility and add Docker support

- Fix MCP client for 1.10.0 API changes (streamablehttp_client now returns 3-tuple)
- Add comprehensive .gitignore for AWS Operations Agent project
- Add Dockerfiles for agent-lambda and mcp-tool-lambda
- Update requirements.txt to use mcp==1.10.0
- Add fallback DirectMCPClient class for better error handling

* Update documentation and scripts

- Update SETUP.md with latest deployment instructions
- Modify create-target.py script for improved functionality

* Remove .gitignore files from AgentCore samples repository

- Deleted 6 .gitignore files to prevent conflicts with parent repository
- Includes root .gitignore and use-case specific .gitignore files
- Cleaned up: customer-support-assistant, SRE-agent, AWS-operations-agent, and video-games-sales-assistant directories
- Enables consistent gitignore management at repository level

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: name <alias@amazon.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-25 10:51:16 -07:00
Eashan Kaushik 909eb9901a feat(agentcore): Adding tutorials, samples, and integrations 2025-07-16 14:07:30 -04:00