Skip to content

Add 04-fmkb-managed-kb sample (Managed KB via AgentCore Gateway)#1770

Open
shraiyya wants to merge 5 commits into
awslabs:mainfrom
shraiyya:add-fmkb-managed-kb-sample
Open

Add 04-fmkb-managed-kb sample (Managed KB via AgentCore Gateway)#1770
shraiyya wants to merge 5 commits into
awslabs:mainfrom
shraiyya:add-fmkb-managed-kb-sample

Conversation

@shraiyya

Copy link
Copy Markdown

What

Adds a new sample under 01-features/03-connect-your-agent-to-anything/04-fmkb-managed-kb that exposes a Bedrock Managed Knowledge Base (FMKB) as an MCP tool through AgentCore Gateway, then queries it from a Strands agent on AgentCore Runtime.

Follows the same shape as the sibling folders (01-code-interpreter, 02-browser, 03-web-search).

Layout

  • 01-raw-mcp/ — call the gateway directly via MCP + SigV4 (no agent in the loop); handy for isolating gateway → KB plumbing. Includes setup_gateway.py, raw_mcp_call.py, cleanup.py.
  • 02-strands-agent/ — production shape: Strands agent deployed to Runtime via the AgentCore CLI, with IAM trust/execution policy templates.
  • utils/ — helpers to create/reuse a managed KB + S3 source and to create the gateway + KB target.

Notes

  • The gateway uses authorizerType=AWS_IAM; the agent reaches it with SigV4-signed MCP via mcp-proxy-for-aws.
  • Last validated with bedrock-agentcore 1.15.0, strands-agents 1.44.0, mcp-proxy-for-aws 1.6.2, mcp 1.28.0, boto3/botocore 1.43.32.
  • No secrets committed — all ARNs/account IDs are placeholders (${ACCOUNT_ID}, 111122223333); populated env files are gitignored.
  • .env.example documents the variables the sample produces/consumes (force-added past the root .env.* ignore rule, matching existing samples in this repo).

Exposes a Bedrock Managed Knowledge Base (FMKB) as an MCP tool via
AgentCore Gateway, queried by a Strands agent on AgentCore Runtime.
Includes a raw MCP/SigV4 path (01-raw-mcp) and the deployed-agent path
(02-strands-agent), plus KB + gateway helpers.
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Latest scan for commit: 6a08411 | Updated: 2026-07-13 20:03:20 UTC

Security Scan Results

Scan Metadata

  • Project: ASH
  • Scan executed: 2026-07-13T19:53:18+00:00
  • ASH version: 3.0.0

Summary

Scanner Results

The table below shows findings by scanner, with status based on severity thresholds and dependencies:

Column Explanations:

Severity Levels (S/C/H/M/L/I):

  • Suppressed (S): Security findings that have been explicitly suppressed/ignored and don't affect the scanner's pass/fail status
  • Critical (C): The most severe security vulnerabilities requiring immediate remediation (e.g., SQL injection, remote code execution)
  • High (H): Serious security vulnerabilities that should be addressed promptly (e.g., authentication bypasses, privilege escalation)
  • Medium (M): Moderate security risks that should be addressed in normal development cycles (e.g., weak encryption, input validation issues)
  • Low (L): Minor security concerns with limited impact (e.g., information disclosure, weak recommendations)
  • Info (I): Informational findings for awareness with minimal security risk (e.g., code quality suggestions, best practice recommendations)

Other Columns:

  • Time: Duration taken by each scanner to complete its analysis
  • Action: Total number of actionable findings at or above the configured severity threshold that require attention

Scanner Results:

  • PASSED: Scanner found no security issues at or above the configured severity threshold - code is clean for this scanner
  • FAILED: Scanner found security vulnerabilities at or above the threshold that require attention and remediation
  • MISSING: Scanner could not run because required dependencies/tools are not installed or available
  • SKIPPED: Scanner was intentionally disabled or excluded from this scan
  • ERROR: Scanner encountered an execution error and could not complete successfully

Severity Thresholds (Thresh Column):

  • CRITICAL: Only Critical severity findings cause scanner to fail
  • HIGH: High and Critical severity findings cause scanner to fail
  • MEDIUM (MED): Medium, High, and Critical severity findings cause scanner to fail
  • LOW: Low, Medium, High, and Critical severity findings cause scanner to fail
  • ALL: Any finding of any severity level causes scanner to fail

Threshold Source: Values in parentheses indicate where the threshold is configured:

  • (g) = global: Set in the global_settings section of ASH configuration
  • (c) = config: Set in the individual scanner configuration section
  • (s) = scanner: Default threshold built into the scanner itself

Statistics calculation:

  • All statistics are calculated from the final aggregated SARIF report
  • Suppressed findings are counted separately and do not contribute to actionable findings
  • Scanner status is determined by comparing actionable findings to the threshold
Scanner S C H M L I Time Action Result Thresh
bandit 0 0 0 0 0 0 1.1s 0 PASSED MED (g)
cdk-nag 0 0 0 0 0 0 5.4s 0 PASSED MED (g)
cfn-nag 0 0 0 0 0 0 10ms 0 PASSED MED (g)
checkov 0 0 0 0 0 0 5.2s 0 PASSED MED (g)
detect-secrets 0 0 0 0 0 0 509ms 0 PASSED MED (g)
grype 0 0 0 0 0 0 36.8s 0 PASSED MED (g)
npm-audit 0 0 0 0 0 0 130ms 0 PASSED MED (g)
opengrep 0 0 0 0 0 0 <1ms 0 SKIPPED MED (g)
semgrep 0 0 0 0 0 0 <1ms 0 MISSING MED (g)
syft 0 0 0 0 0 0 1.6s 0 PASSED MED (g)

shraiyya added 4 commits July 13, 2026 11:07
Adds images/architecture.png (official AWS Bedrock/IAM icons) and embeds
it in the README in place of the ASCII box drawing.
Reformats the sample's Python files to the repo's ruff config
(line-length=120). Cosmetic only — no logic changes.
Refreshes images/architecture.png with cleaner node labels and
edge-centered labels (white background).
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