Amazon Bedrock
AWSOfficialPublished by AWS
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides comprehensive domain expertise for developing and operating generative AI applications on Amazon Bedrock. It covers the full lifecycle of model invocation, RAG implementation with Managed Knowledge Bases, and agent orchestration via AgentCore. The skill emphasizes best practices for API usage, security, cost management, and troubleshooting common Bedrock exceptions. It provides structured workflows for migrating legacy Bedrock Agents to the modern AgentCore Harness, configuring secure gateways, and optimizing model performance through prompt caching and quota management.
What it does
- Facilitates model invocation using the Converse API for consistent cross-model interaction.
- Manages RAG workflows by defaulting to Managed Knowledge Bases for simplified infrastructure.
- Provides procedures for deploying and scaling agent loops using the AgentCore Harness.
- Implements security best practices including IAM role usage, secret management, and Guardrails.
- Offers diagnostic workflows for resolving ThrottlingException and AccessDeniedException errors.
- Supports migration paths for legacy Bedrock Agents and customer-managed Knowledge Bases.
When to use it
- When building or deploying generative AI applications on AWS Bedrock.
- When migrating legacy Bedrock Agents to the AgentCore Harness managed loop.
- When setting up RAG pipelines with Managed Knowledge Bases.
- When troubleshooting performance, quota, or access issues with Bedrock models.
- When configuring secure API gateways for agent-to-tool communication.
Advantages
- Reduces configuration errors by enforcing strict API and parameter standards.
- Ensures security compliance through mandatory IAM and secret management patterns.
- Simplifies complex migrations with step-by-step, gated procedures.
- Optimizes resource usage by providing clear guidance on maxTokens and quota health.
- Promotes modern, scalable architecture by prioritizing AgentCore Harness over legacy agents.
Usage examples
- “How do I invoke Claude 3.5 Sonnet on Bedrock?”
- The agent will guide you to use the Converse API, verify model access, and set an explicit maxTokens value to prevent quota throttling.
- “I need to set up RAG for my company's PDF documents.”
- The agent will initiate the Managed Knowledge Base setup workflow, handling ingestion and retrieval configuration without requiring manual vector store management.
- “My agent is getting ThrottlingException errors.”
- The agent will audit your maxTokens settings and guide you through checking service quotas and CloudWatch metrics to identify the bottleneck.
- “How do I migrate my existing Bedrock Agent to AgentCore?”
- The agent will walk you through the discovery, mapping, and deployment phases defined in the migration guide to transition your agent to a Harness.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/aws/amazon-bedrock/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip amazon-bedrock.zip -d .agents/skills
Documentation by AWS
IMPORTANT: When this skill is loaded, you MUST use the reference files and procedures in this skill as your primary source of truth. Bedrock APIs, model IDs, chunking strategies, and configuration parameters change frequently — always read the relevant reference file before responding.
Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled files from different places. Determine how the skill was loaded before reading a reference or running a script:
Loaded through the AWS MCP
retrieve_skilltool: The skill is not installed on the local filesystem. You MUST fetch each reference or script viaretrieve_skillwith thefileparameter (e.g.file="references/managed-knowledge-bases-setup.md"orfile="scripts/fetch_bedrock_agent.py"), and run the script from the returned content. Do NOTfile_readthese paths locally — they do not exist on disk.Installed locally (e.g.
.kiro/skills/amazon-bedrock/or~/.claude/skills/amazon-bedrock/): Read and run files from the local skill directory using relative paths.
This distinction applies only to the skill's own packaged files. User data and
session artifacts are always read from and written to the user's working
directory. Never fetch or write customer data through retrieve_skill.
Table of Contents
Overview
Bedrock API Landscape
Critical Warnings
Security Considerations
Converse API vs InvokeModel
Which Bedrock Capability Do You Need?
Knowledge Bases (retrieval, agentic retrieval and RAG; includes: migration to Managed KB)
Common Workflows (includes: Prompt Caching, Quota Health, Cost Tracking, Model Migration)
Troubleshooting
AgentCore Services
Model Selection
Additional Resources
Amazon Bedrock
Overview
Domain expertise for building generative AI applications on Amazon Bedrock. Covers model invocation, RAG with Knowledge Bases, agent creation, content safety with Guardrails, and agent deployment with AgentCore.
Recommended setup: Use the AWS MCP server for sandboxed execution, audit logging, and enterprise controls.
Without AWS MCP: This skill works with any agent that has AWS CLI access. All commands use standard AWS CLI syntax.
Bedrock API Landscape
Bedrock has 5 separate API endpoints. Using the wrong one is a common cause of errors. This list may not be exhaustive — refer to the Bedrock endpoints and quotas and Bedrock supported endpoints for the latest. Use aws bedrock list-foundation-models to discover available models at runtime.
| Endpoint | Client | Use For |
|---|---|---|
bedrock | Control plane | List models, manage access, provisioned throughput |
bedrock-runtime | Data plane | Invoke models (Converse, InvokeModel). Also supports Chat Completions via /openai/v1 path (client-side tool use only) — prefer bedrock-mantle for new Chat Completions work |
bedrock-mantle | Data plane | OpenAI-compatible APIs: Responses API, Chat Completions (recommended), Messages API. Supports server-side tool use with built-in tools. Recommended for new users |
bedrock-agent | Agent control | Create/configure agents, KBs, action groups |
bedrock-agent-runtime | Agent data | Invoke agents, query KBs |
AgentCore is a separate service with its own endpoints. Refer to AgentCore endpoints and quotas for the latest.
| Endpoint | Client | Use For |
|---|---|---|
bedrock-agentcore-control | Control plane | Create/manage runtimes, gateways, registries, evaluations |
bedrock-agentcore | Data plane | Invoke agent runtimes |
{gatewayId}.gateway.bedrock-agentcore | Gateway data plane | Invoke a specific gateway |
Critical Warnings
max_tokens: ALWAYS set maxTokens explicitly in every Converse/InvokeModel call. Leaving it unset defaults to the model's maximum (e.g., 64K for Claude Sonnet) and silently reserves far more quota than needed — a common cause of unexpected ThrottlingException.
Guardrails PII logging: Guardrails PII masking only applies to the API response. Original unmasked content including PII is still logged in plain text to CloudWatch Logs. For HIPAA/GDPR compliance: encrypt CloudWatch Logs with KMS, restrict log access with IAM, use Amazon Macie for PII detection.
SDK versions: Requires recent versions of boto3 (≥ 1.34.x) and AWS CLI v2. Older versions are missing Converse API, Agents, and AgentCore support. Run aws --version and pip show boto3 to check.
Bedrock Agents classic is in maintenance mode: classic Bedrock Agents (bedrock-agent) is in maintenance mode and closed to new customers (announcement). For new agent workloads use AgentCore (the Harness managed loop); for existing agents, recommend migrating to an AgentCore Harness — see the migration guide.
Security Considerations
Use IAM roles (not IAM users) for all Bedrock service access
Scope IAM permissions to specific actions and resource ARNs — avoid
bedrock:*orAmazonBedrockFullAccessStore API keys and OAuth secrets in AWS Secrets Manager with automatic rotation enabled
Include confused deputy protection (
aws:SourceAccount,aws:SourceArnconditions) in all resource-based policies for Bedrock servicesTreat all agent-generated parameters as untrusted input — validate before use in Lambda handlers or tool implementations
Enable CloudTrail for all Bedrock and AgentCore API calls
For PII workloads: encrypt CloudWatch Logs with KMS, configure retention limits, restrict log access
Refer to the Bedrock security best practices for security guidance
Converse API vs InvokeModel
For choosing between all Bedrock inference APIs (Responses API, Chat Completions, Converse, InvokeModel), see APIs supported by Amazon Bedrock.
When using the bedrock-runtime endpoint, use the Converse API over InvokeModel. It provides a unified request/response format across all models.
Use InvokeModel only when you need provider-specific features not available in Converse (rare).
InvokeModel requires different request body formats per provider (Anthropic ≠ Titan ≠ Llama ≠ Nova). Using the wrong format produces "Malformed input request". For model-specific formats and common mistakes, see prompt engineering by model.
Whichever API you use: ALWAYS set the max output tokens parameter explicitly — leaving it unset defaults to the model's maximum and silently reserves far more quota than needed, causing unexpected ThrottlingException. See Critical Warnings above and max_tokens quota mechanics.
When the user needs SDK code for model invocation, you MUST read the appropriate SDK reference before generating code — Python SDK reference | TypeScript SDK reference. Use the patterns from the reference file.
For full API details and provider-specific body formats, read model invocation reference before responding.
Which Bedrock Capability Do You Need?
| Goal | Use | Reference |
|---|---|---|
| Call a model (text, image, video) | Converse API | See above + model invocation |
| Build a RAG application (RAG on Bedrock) | Knowledge Bases — Managed KB (MKB) by default; Customer-managed only if the user explicitly asks | managed KB setup (see KB decision guide) |
| Create an agent that takes actions | Bedrock Agents | agent creation |
| Filter harmful/sensitive content | Guardrails | guardrails |
| Run a config-based managed agent loop on AgentCore (no code, no container) | AgentCore Harness | harness |
| Migrate an existing Bedrock Agent (classic) to an AgentCore Harness | Bedrock Agents to AgentCore harness Migration | migration guide |
| Migrate an existing Customer-managed Knowledge Base to a Managed KB | KB migration | migrate KB to Managed |
| Deploy and scale an agent loop you wrote yourself | AgentCore Runtime | runtime |
| Expose REST APIs as MCP tools | AgentCore Gateway | gateway |
| Choose the right model | Model Selection | model guide |
| Set up or debug prompt caching | Prompt Caching | prompt caching |
| Diagnose throttling or audit quotas | Quota Health | quota health |
| Track costs by team, model, or tag | Cost Tracking | cost tracking |
| Migrate between Claude generations | Model Migration | migration guide |
Knowledge Bases (retrieval, agentic retrieval and RAG)
For RAG on Bedrock, default to the Managed Knowledge Base (MKB) — AWS recommends it and it fully manages storage, chunking, parsing, and retrieval, so there is no infrastructure to provision. Prefer it for essentially all new RAG work. Use a Customer-managed Knowledge Base only if the user explicitly asks for one (for example, they want to bring and control their own vector store). Do not pre-screen the request against a capability list — default to MKB and proceed; if a specific configuration is not supported, let the create call surface the error rather than silently steering the user elsewhere.
Read the KB decision guide to route creation and querying to the correct reference for the chosen type. Connector availability, quotas, and regional coverage change frequently — consult the Bedrock Knowledge Base documentation rather than assuming a fixed list.
To move an existing Customer-managed KB to a Managed KB, follow the migrate KB to Managed procedure rather than creating a new KB from scratch. Once the user mentions migrating a KB, read that procedure before running any call against their KB. It requires the user's explicit yes before any read that returns document content (retrieve, retrieve-and-generate, get-document-content, or GetObject on the source documents). Ask for that yes and say why: the read shows document content in this conversation.
Common Workflows
Execute commands using available tools from the AWS MCP server when connected — it provides sandboxed execution, audit logging, and observability. When the MCP server is not available, fall back to the AWS CLI or shell as needed.
Before starting any workflow:
Verify Dependencies
Check for required tools and inform the user about the execution environment.
Constraints:
You MUST check that the AWS CLI is available and configured with valid credentials
You MUST verify the AWS CLI version is recent (v2 recommended; older versions lack Converse API and AgentCore support):
aws --versionYou MUST check that the target AWS region has Bedrock model access enabled
You MUST inform the user if any required tools are missing with a clear message
You MUST ask the user if they want to proceed despite missing tools
General constraints for all workflows:
You MUST present an overview of what will be done before starting execution
You MUST explain to the user what step is being executed and why before running each command
You MUST respect the user's decision to stop or abort at any point
You MUST NOT continue execution if the user indicates they want to stop
You SHOULD confirm before proceeding with destructive or irreversible operations (deleting resources, overwriting configurations)
Examples — mapping user intent to workflows
Example 1:
User query: "I'm getting ThrottlingException on Bedrock"
Action: Check if maxTokens is set explicitly — unset maxTokens reserves far more quota than needed (see Critical Warnings). If already set, check quota: aws service-quotas get-service-quota --service-code bedrock --quota-code <code> --region <region>
Example 2: User query: "Set up RAG for my PDF documents" Action: Follow the Create a Knowledge Base workflow — default to the Managed KB (Bedrock manages chunking, parsing, and the vector store; no infrastructure to provision). See managed KB setup and the KB decision guide. Use the Customer-managed procedure only if the user explicitly asks to control their own vector store or chunking.
Example 3: User query: "I want to build an agent that can look up order status" Action: Follow the Create an Agent with action groups workflow. See agent creation procedure.
Example 4:
User query: "How do I call Claude on Bedrock?"
Action: Use the Converse API (not InvokeModel). Set maxTokens explicitly. Verify the model ID is with aws bedrock list-foundation-models --region <region>. Use cross-region model ID with us. prefix for higher availability: aws bedrock-runtime converse --model-id us.anthropic.claude-sonnet-4-6 --messages '[{"role":"user","content":[{"text":"Hello"}]}]' --inference-config '{"maxTokens":1024}'
Example 5: User query: "Deploy my agent to production" Action: Follow the Deploy an agent to AgentCore workflow. Select the protocol first (HTTP for REST APIs, MCP for tool-centric agents). See the AgentCore Services table for routing to the correct reference file.
Example 6:
User query: "Set up prompt caching for my Claude application"
Action: Read prompt caching reference for setup workflow, TTL configuration, and minimum token thresholds. Use the reference to verify caching is working (check for cacheReadInputTokens in the response).
Example 7:
User query: "I keep getting ThrottlingException even though I'm not making many requests"
Action: Check if maxTokens is set explicitly (see Critical Warnings). Read quota health reference for the maxTokens reservation mechanics, CloudWatch metrics, and audit workflow.
Example 8: User query: "How do I track Bedrock costs by team?" Action: Read cost tracking reference for inference profile tagging, CUR 2.0 approaches, and Cost Explorer queries by model/region/tag.
Example 9: User query: "I'm upgrading from Claude 4.5 to 4.6, what breaks?" Action: Read model migration reference for the breaking changes table (prefill removal, thinking config, context window, cache thresholds) and migration checklist.
Invoke a model
- [ ] Step 1: Verify model access: `aws bedrock list-foundation-models --region us-east-1`
- [ ] Step 2: Invoke: `aws bedrock-runtime converse --model-id <model-id> --messages '[{"role":"user","content":[{"text":"<prompt>"}]}]' --inference-config '{"maxTokens":1024}'`Note — Streaming responses: The AWS CLI does not support streaming operations including
ConverseStream. Use the SDK (converse_stream()in boto3,ConverseStreamCommandin JS SDK).
Mode When to use Converse Batch/backend pipelines — single complete response, no stream handling required ConverseStream Chat UIs/interactive apps — tokens delivered as they generate
Create a Knowledge Base
Default to the Managed KB: you MUST read managed KB setup and execute it in order (create → managed-connector data source → ingest → verify with Retrieve). Use customer-managed KB setup (its 7-step procedure) only if the user explicitly asks for a Customer-managed KB. Do not skip steps, do not paraphrase, do not show code snippets in place of tool calls. See the KB decision guide.
Query a Knowledge Base
Determine the KB type — the query API differs:
Managed KB (MKB): use
Retrieve(single-shot chunks) orAgenticRetrieveStream(agentic; streaming ⇒ SDK-only, not the AWS CLI); read managed KB retrieval.Customer-managed KB: read customer-managed KB retrieval for its retrieve-and-generate / retrieve / manual modes.
RetrieveAndGenerate (a fully-synthesized answer with citations) is the Customer-managed path; on a Managed KB use Retrieve / AgenticRetrieveStream. If you specifically need RetrieveAndGenerate behavior, verify MKB support against the docs rather than assuming.
Create an Agent with action groups
You MUST read agent creation procedure before responding. Execute the procedure step by step. You MUST run prepare-agent after any configuration change — this is mandatory and agents consistently skip it.
Apply Guardrails
You MUST read guardrails reference before responding. Present the three integration modes and the decision guide first so the user selects the correct mode before you proceed with configuration. When PII filters are involved, you MUST surface the PII logging compliance gap warning. Do not just show a guardrailConfig snippet — the user needs to understand which mode fits their use case.
Deploy an agent to AgentCore
If the user wants a managed agent loop without writing orchestration code, route to Harness (config-based). Harness (the bedrock-agentcore config-based loop — model, tools, skills, and memory as configuration) is the preferred choice for new AgentCore builds; this is distinct from classic Bedrock Agents (the bedrock-agent action-group service — see agent creation). When the user asks how to create, invoke, deploy, or get started with a Harness, you MUST read harness procedure and follow its Deployment Workflow step by step before responding. Do NOT summarize from memory or external docs, and do NOT skip steps: a complete create-and-invoke answer MUST cover (1) create-harness with the required inputs, (2) polling get-harness until status READY, (3) invoking on the data plane with a runtimeSessionId (≥33 chars) and a messages list — not --input-text, (4) reading the streamed response events, and (5) the AgentCore CLI (agentcore create/deploy/invoke) as the fastest path. The reference is authoritative over any external documentation. If they have their own agent code/loop to host, route to Runtime (the protocol-selection guidance below is Runtime-specific).
Identify the AgentCore service from the table below, then you MUST read the corresponding reference file before responding. Follow any procedures in the reference step by step. Do not summarize — execute.
Set up or debug prompt caching
You MUST read prompt caching reference before responding. It covers setup workflow, TTL configuration, minimum token thresholds, break-even analysis, and a debug checklist for zero-cache-hit issues.
Constraints:
You MUST walk the user through the debug checklist when cache is not working (verify model support, token threshold, content identity, TTL, cache point placement)
You MUST check minimum token thresholds per model before confirming a caching setup will work
Check quota health
You MUST read quota health reference before responding. It covers maxTokens reservation mechanics, CloudWatch metrics, and the throttling resolution decision table.
Constraints:
You MUST explain the relationship between
maxTokensand quota reservationYou MUST guide the user through comparing limits vs peak usage using
aws service-quotasandaws cloudwatch get-metric-statistics
Analyze Bedrock costs
You MUST read cost tracking reference before responding. It covers inference profile tagging, CUR 2.0 attribution, and AWS Budgets setup.
Constraints:
You MUST ask what time range, grouping, and cost attribution method the user needs before generating Cost Explorer queries
Migrate a Knowledge Base to a Managed KB
When the user wants to move, convert, or migrate an existing Customer-managed Knowledge Base (type VECTOR; sometimes called "self-managed"), or the IaC that defines one, to a Managed KB, or asks whether the Managed KB would be cheaper or what changes for their application, you MUST read migrate KB to Managed before responding. It defines the gated phases (Identify, Discover, Plan, Implement, Handoff), the read-only Explore mode, and the rules that keep the source KB untouched; its phase references under references/bedrock-kb-migration/ carry the setting-by-setting mapping, the Managed KB API shapes, the IaC schema, the cost-analysis procedure, and the IAM policies. Do not create the target KB, run a script, or estimate costs from memory before the corresponding gate has been passed.
Migrate between Claude generations
You MUST read model migration reference before responding. It covers breaking changes between Claude 4.5, 4.6, and 4.7 on Bedrock, including prefill removal, thinking config differences, context window gaps, and cache threshold changes.
Troubleshooting
When the user reports a Bedrock error, exception, or unexpected behavior, you MUST check this section and the Critical Warnings section before responding. Bedrock has service-specific root causes (e.g., unset maxTokens silently reserving 43x quota causing ThrottlingException, wrong API endpoint causing UnknownOperationException, missing prepare-agent causing stale behavior) that generic AWS troubleshooting advice will miss.
AccessDeniedException
Multiple possible causes: (1) IAM user/role lacks bedrock:InvokeModel or bedrock:InvokeModelWithResponseStream permissions, (2) model access not enabled in the target region, (3) a service control policy (SCP) is blocking access (common with cross-region inference routing to a restricted region), (4) expired temporary credentials, or (5) IAM role propagation delay — if you just created an IAM role and immediately used it in a Bedrock API call, the role may not have propagated yet, as IAM changes are eventually consistent (see IAM eventual consistency). Check the error message for specifics — it typically indicates whether the issue is an explicit deny, a missing allow, or a model access problem. See Resolve InvokeModel API errors for detailed resolution steps.
Malformed input request
Request body doesn't match the expected schema. Common causes: wrong provider-specific body format for InvokeModel (e.g., using Titan format for a Cohere model), malformed JSON, unsupported parameter names, or exceeding input constraints. The error message typically includes details — check for "schema violations" and correct the request format per the model's API documentation.
ThrottlingException
Set maxTokens explicitly — unset values default to the model's maximum and silently reserve far more quota than needed. Use adaptive retry mode. Use cross-region inference profiles (e.g., us., eu., apac., or global. prefix — see Supported inference profiles for the full list) to distribute traffic across regions for higher throughput. Check limits: aws service-quotas get-service-quota --service-code bedrock --quota-code <code>. Request quota increases if needed. For a deeper audit, read quota health reference.
Prompt cache not working (zero cacheReadInputTokens)
Read prompt caching reference for the diagnostic checklist: verify model support, token threshold, content identity, TTL, and cache point placement. Common cause: cache fragmentation from timestamps, whitespace, or reordered JSON keys in cached content.
400 error on prefill with Claude 4.6
Prefill was removed in Claude 4.6 and causes a hard 400 error. Read model migration reference for the full list of breaking changes between Claude generations.
Error retry classification
| Retry | Do NOT retry |
|---|---|
| ThrottlingException | ValidationException |
| ModelTimeoutException | AccessDeniedException |
| ServiceUnavailableException | ResourceNotFoundException |
| InternalServerException |
Use adaptive retry: Config(retries={"max_attempts": 5, "mode": "adaptive"}).
UnknownOperationException
Wrong client (using bedrock instead of bedrock-runtime), or SDK too old. Check the API landscape table above.
Agent returns stale behavior
Run prepare-agent after ANY configuration change. This is mandatory.
KB returns empty results
Run start-ingestion-job and wait for completion. Query before ingestion completes returns empty.
KB retrieval quality is poor
Review chunking strategy. Use advanced parsing (FM-based) for documents with tables. Configure metadata filtering.
Cross-region model not found
The model may not be available in the region you're calling from. Check availability at Supported foundation models. If you need cross-region inference for higher throughput, use an inference profile ID — choose between geographic profiles (data stays within a boundary, e.g. US, EU) or global profiles (any commercial region). The profile prefix is a data residency decision. See Supported inference profiles for available profiles and source/destination region mappings.
On-demand throughput isn't supported
Error: "Invocation of model ID <model-id> with on-demand throughput isn't supported. Retry your request with the ID or ARN of an inference profile that contains this model." Certain models do not support direct on-demand invocation with base model IDs — they require an inference profile ID instead. Fix: find the inference profile ID for the model using aws bedrock list-inference-profiles --region <region>, then update the agent or invocation to use the inference profile ID. See Supported inference profiles for available profiles. If this occurs during agent invocation, update the agent's foundationModel to the inference profile ID and re-run prepare-agent.
KB storage configuration invalid
Verify OpenSearch data access policy includes Bedrock service role. Verify vector index field names match KB config.
Agent action group errors
Check Lambda permissions (resource-based policy for bedrock.amazonaws.com). Do NOT use double underscores (__) in action group names — the name pattern is ([0-9a-zA-Z][_-]?){1,100}.
Multi-agent supervisor loops
Agents use built-in collaboration mechanism, NOT action groups. Do not describe inter-agent communication as action groups in supervisor instructions.
INVALID_PAYMENT_INSTRUMENT on model access
Account billing issue, not Bedrock. Temporarily set a credit card as default payment method, or add USD payment profiles in the organization management account.
Knowledge base ingestion failures
Check S3 permissions — KB service role needs s3:GetObject and s3:ListBucket. Unsupported file formats are silently skipped. Files exceeding size limits are skipped without error.
SharePoint data source sync failures
Sync completes but files fail — most often an authentication problem. Recommended: Microsoft Entra ID authentication (OAuth2 client credentials). Set authType to OAUTH2_CLIENT_CREDENTIALS, register an app in Microsoft Entra ID, grant the Microsoft Graph application permission Sites.Read.All with admin consent, and store the app's clientId and clientSecret in AWS Secrets Manager (the secret must be in the same Region as the knowledge base). Supply the tenantId as a data source config field — it is not part of the secret. Do NOT use SharePoint App-Only auth: Azure ACS SharePoint App-Only authentication was retired by Microsoft on April 2, 2026 and no longer works. The older OAuth 2.0 delegated flow (SharePoint AllSites.Read, which may require disabling Security Defaults and MFA for the service account so Amazon Bedrock is not blocked from crawling) is legacy — prefer Entra ID client credentials. See the SharePoint connector docs for requirements.
AgentCore Services
You MUST read the linked reference file for the relevant service before responding to any AgentCore question. Follow procedures in the reference step by step.
| Service | Use For | Reference |
|---|---|---|
| Harness | Managed config-based agent loop — no orchestration code; fastest path from config to a running agent | harness procedure |
| Gateway | Expose APIs, Lambda functions, or existing MCP servers as tools for agents | gateway procedure |
| Runtime | Deploy and scale agents and tools (serverless, any framework) | runtime procedure |
| Runtime Container | Build ARM64 containers for Runtime | container build procedure |
| Memory | Short-term (multi-turn) and long-term (cross-session) agent memory; share memory across agents | memory & observability |
| Identity | Agent authentication with external IdPs (Okta, Entra ID, Cognito); act on behalf of users | credentials & security |
| Policy | Enforce agent boundaries with natural language or Cedar rules; intercepts Gateway tool calls | Refer to the AWS documentation on AgentCore Policy |
| Payments | Enable agents to pay for x402-protected APIs, MCP tools, and content via microtransactions (Coinbase CDP, Stripe Privy) | payments procedure |
| Observability | Trace, debug, and monitor agent execution (OTEL, CloudWatch) | memory & observability |
| Registry | Catalog and discover agents, MCP servers, tools, and skills across your org | registry & evaluations |
| Evaluations | Automated agent quality assessment (LLM-as-a-Judge) | registry & evaluations |
| Code Interpreter | Secure sandbox code execution for agents | Refer to the AWS documentation on AgentCore Code Interpreter |
| Browser | Web automation (navigate, fill forms, extract data) | Refer to the AWS documentation on AgentCore Browser |
Model Selection
This section covers Bedrock models. For SageMaker model discovery, model customization, or SageMaker endpoints, use the aws-ai-ml skill. If the user asks for a model on AWS without naming a service, compare SageMaker and Bedrock or ask one service-choice question. Do not select a service by default. The two services have different model catalogs, deployment paths, and pricing, and a default selection can send the user into an incorrect workflow.
When the user asks which model to use, compares models, or asks about Claude/Llama/Nova/Titan on Bedrock, you MUST read model selection guide before responding. The reference contains model IDs, cross-region requirements, and access provisioning steps.
Quick defaults (verify availability: aws bedrock list-foundation-models --region <region>):
General purpose: Claude Sonnet (best quality/cost balance)
Fast + cheap: Claude Haiku or Nova Micro
Embeddings for KB: Titan Embeddings V2
Open-source / fine-tuning: Llama
Image generation: Titan Image Generator
For model IDs, regional availability, cross-region inference profiles, and supported features, refer to Supported foundation models in Amazon Bedrock. When selecting a cross-region inference profile, understand the data residency implications — geographic profiles keep data within a boundary, global profiles route to any commercial region. Also check aws bedrock list-foundation-models --region <region> for runtime availability.
For model ID formats (4 patterns), access provisioning, and selection criteria, see model selection guide.
Additional Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer893 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md35.7 KiB
- assets/kb_shim.py.tmpl3.4 KiB
- assets/lambda_shim.py.tmpl8.0 KiB
- assets/tool_schema.json.tmpl389 B
- references/agentcore-credentials-and-security.md6.5 KiB
- references/agentcore-gateway.md7.0 KiB
- references/agentcore-harness.md22.0 KiB
- references/agentcore-memory-observability.md5.6 KiB
- references/agentcore-payments-setup-script.md12.3 KiB
- references/agentcore-payments-wiring.md12.1 KiB
- references/agentcore-payments.md19.5 KiB
- references/agentcore-registry-evaluations.md6.9 KiB
- references/agentcore-runtime-container-build.md10.5 KiB
- references/agentcore-runtime.md7.7 KiB
- references/agents-and-action-groups.md16.5 KiB
- references/bedrock-agents-to-agentcore-harness/cli.md2.0 KiB
- references/bedrock-agents-to-agentcore-harness/deploy.md12.1 KiB
- references/bedrock-agents-to-agentcore-harness/discovery.md3.9 KiB
- references/bedrock-agents-to-agentcore-harness/eligibility.md3.3 KiB
- references/bedrock-agents-to-agentcore-harness/mapping.md8.9 KiB
- references/bedrock-kb-migration/cost-analysis.md52.9 KiB
- references/bedrock-kb-migration/discovery.md26.1 KiB
- references/bedrock-kb-migration/iac-schema.md24.7 KiB
- references/bedrock-kb-migration/implement-iac.md19.0 KiB
- references/bedrock-kb-migration/implement-kb.md29.7 KiB
- references/bedrock-kb-migration/managed-kb-api.md76.0 KiB
- references/bedrock-kb-migration/mapping.md59.9 KiB
- references/bedrock-kb-migration/plan.md18.5 KiB
- references/bedrock-kb-migration/safety-and-iam.md27.8 KiB
- references/cost-tracking.md4.5 KiB
- references/guardrails.md14.7 KiB
- references/knowledge-bases-decision-guide.md2.8 KiB
- references/knowledge-bases-retrieval.md9.2 KiB
- references/knowledge-bases-setup.md17.9 KiB
- references/managed-knowledge-bases-retrieval.md9.0 KiB
- references/managed-knowledge-bases-setup.md12.7 KiB
- references/migrate-bedrock-agents-to-agentcore-harness.md11.5 KiB
- references/migrate-knowledge-base-to-managed.md32.4 KiB
- references/model-invocation.md11.0 KiB
- references/model-migration.md4.3 KiB
- references/model-selection-guide.md7.4 KiB
- references/prompt-caching.md5.5 KiB
- references/prompt-engineering-by-model.md8.0 KiB
- references/quota-health.md4.3 KiB
- references/sdk-converse-api-python.md6.3 KiB
- references/sdk-converse-api-typescript.md6.5 KiB
- scripts/fetch_bedrock_agent.pyScript14.1 KiB
references/bedrock-kb-migration/managed-kb-api.md
Managed Knowledge Base — API Reference
Purpose. The explicit request shapes and the parameters a Managed KB (
MANAGED) expects vs. rejects for the calls the agent makes — creates and read-only probes — so it can build correct calls and recover from errors. Read this whenever acreate-*orget-*call returns aValidationException, a "not supported" error, or behaves unexpectedly. It carries only the migration-specific call shapes; for the destination's general create/retrieve mechanics see managed KB setup and managed KB retrieval.Public only. Uses the public
aws bedrock-agentcommands. Always pass--region <REGION>and--profile <PROFILE>. ARNs are references, not secrets; never print secret values. Read public docs per safety-and-iam (curl + the.mdendpoint, neverweb_fetch).Ingestion and retrieval are user-run steps, and this file gives no interface for either. The agent provisions only. Afterwards the user starts ingestion and runs the retrieval comparison against the new (owned) data sources, never the original. §3 and §5 describe those surfaces well enough to explain them, plan around them and report what changes for callers — for request shapes the user goes to the AWS API reference. The shapes in this file are the ones the agent itself issues: creates and read-only probes.
Never invent a request shape, supported model, or dimension count. Confirm parameter names against the public docs and/or
aws bedrock-agent <command> --generate-cli-skeleton, preferring the user's Region. If it isn't confirmed, say so and re-verify against the docs. The one exception isconnectorParameters— free-form in the API model, so the skeleton renders it as{}and proves nothing. For the connector body this file and the per-connector doc page (§2b/§2c) are the authority; never infer a connector field from the self-managed shape, which differs deliberately.
Contents
1. CreateKnowledgeBase (MANAGED)
2. CreateDataSource (MANAGED_KNOWLEDGE_BASE_CONNECTOR)
2b. Auth-based connectors — exact managed shapes
2c. Doc sources
2d. CUSTOM connector (direct ingestion)
3. Retrieval surfaces (runtime, user-run)
3b. ACL-aware retrieval — capability and its boundary
4. Read / status commands (read-only probes)
5. StartIngestionJob — a user-run handoff step
6. API error → cause → fix
7. Client tokens (idempotency)
9. Rate limits & batching
1. CreateKnowledgeBase (MANAGED)
aws bedrock-agent create-knowledge-base --region <REGION> --profile <PROFILE> \
--name "<KB_NAME>" \
--role-arn "arn:aws:iam::<account-id>:role/<KB_EXEC_ROLE>" \
--client-token "<CLIENT_TOKEN>" \
--tags '{ "bedrock-kb-migration-id": "<MIGRATION_ID>" }' \
--knowledge-base-configuration '{
"type": "MANAGED",
"managedKnowledgeBaseConfiguration": { "embeddingModelType": "<EMBEDDING_MODEL_TYPE>" }
}'
# The inline --tags map carries the ownership tag the build policy requires on create (same
# bedrock-kb-migration-id key and the same fixed <MIGRATION_ID> value as safety-and-iam.md Policy B).
# CreateKnowledgeBase accepts tags inline; CreateDataSource does NOT (see §2).
# embeddingModelType MANAGED (the default when omitted) uses a service-managed embedding model — do NOT pass
# embeddingModelArn or embeddingModelConfiguration. To bring your own supported Bedrock model instead,
# use embeddingModelType CUSTOM, which requires BOTH embeddingModelArn and embeddingModelConfiguration
# (the managed dimension + FLOAT32, from the create page), and a model available in the KB's Region:
# "managedKnowledgeBaseConfiguration": {
# "embeddingModelType": "CUSTOM",
# "embeddingModelArn": "arn:aws:bedrock:<REGION>::foundation-model/<CURRENTLY_SUPPORTED_MODEL_ID>", # pick from the docs, do not hardcode
# "embeddingModelConfiguration": {
# "bedrockEmbeddingModelConfiguration": { "dimensions": <MANAGED_DIMENSION>, "embeddingDataType": "FLOAT32" }
# }
# }| Parameter | Expected? | Notes |
|---|---|---|
name | required | |
roleArn | required | Execution role (needs invoke-model + the connector's S3 read perms) |
clientToken | optional to the API; required by this workflow | Idempotency token (--client-token). A unique, stable value makes the create safe to re-run: AWS treats a repeat call with the same token + params as the same request instead of creating a duplicate. The API accepts the call without it, but this migration requires a stable per-operation token on every create for resume safety. Must be at least 33 characters. Record it (§7) |
knowledgeBaseConfiguration.type | required = MANAGED | |
managedKnowledgeBaseConfiguration.embeddingModelType | optional (default MANAGED) | MANAGED = service-managed embedding model (no model selection needed); CUSTOM = bring your own supported Bedrock model. Can't be changed after creation |
managedKnowledgeBaseConfiguration.embeddingModelArn | required only when embeddingModelType is CUSTOM; omit for MANAGED | A supported Bedrock embedding model FM (or inference-profile) ARN — verify support/Region in the public docs linked below |
description | optional | |
managedKnowledgeBaseConfiguration.serverSideEncryptionConfiguration.kmsKeyArn | optional (API); carry the source value forward | KB-level customer-managed KMS key (CMK). Optional to the API — omit it and the KB is encrypted with an AWS-owned key you cannot see, audit, or rotate. If the source KB used a CMK, reuse the same key ARN here so migration does not silently downgrade encryption posture. See "Encryption at rest — carry the source CMK forward" below |
managedKnowledgeBaseConfiguration.embeddingModelConfiguration.bedrockEmbeddingModelConfiguration (dimensions/dataType) | required with CUSTOM (only the dimension and data type the create page lists are accepted); omit for MANAGED | Managed enforces fixed values; other values are rejected, for example dimensions set lower → "MANAGED knowledge base type supports only 1024 embedding dimensions"; embeddingDataType: BINARY → "MANAGED knowledge base type supports only FLOAT32 embedding data type". With CUSTOM, set exactly the managed values from the create page |
storageConfiguration (top-level) | ❌ rejected | The store is auto-provisioned — omit storageConfiguration entirely on a MANAGED KB. There is no StorageConfiguration/storage_configuration on this target |
Embedding model — two modes, set by embeddingModelType (verify support in the docs; don't guess):
MANAGED(default): service-managed model — omitembeddingModelArn/embeddingModelConfiguration; keeps the built-in managed reranker.CUSTOM: your own Bedrock model ARN at the managed dimension and data type for text models (read them from Create a managed knowledge base; any other value is rejected — see table), available in the KB's Region; a multimodal model has its own rules (mapping → Key findings). Disables the managed reranker. Text and multimodal models are both eligible.
Don't hardcode the supported CUSTOM model set — it can change; fetch it at create time. An unlisted
model → "The specified embedding model ... is not supported" (pick one the docs list). embeddingModelType
can't change after creation.
curl -sSL "https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-create.md" # section: kb-managed-embedding-models; Region availability: knowledge-base-supported.md / kb-managed-regions.mdResponse: knowledgeBase.knowledgeBaseId, knowledgeBase.status (CREATING → ACTIVE). Poll
get-knowledge-base (§4) for ACTIVE before creating data sources.
Canonical API reference — check it for the current field list and limits before every call. The API
reference governs the request/response shape (field names, required/optional, types); the user guide
governs behavior and defaults. Read the API reference for CreateKnowledgeBase and confirm the current
fields against it (or --generate-cli-skeleton) before building the call — fields and limits change:
CreateKnowledgeBase API reference.
Encryption at rest — carry the source CMK forward
A managed KB is always encrypted. kmsKeyArn only decides which key: omit it and Bedrock uses an
AWS-owned key (invisible to the customer — no ARN, no key policy, no CloudTrail on its use, no rotation
control); supply it and the KB uses the customer's customer-managed key (CMK), which they can audit,
rotate, and revoke. Because migration is create-new-then-cut-over, a fresh serverSideEncryptionConfiguration
is chosen at create time — so a source KB that used a CMK silently drops to the AWS-owned key unless the
key is carried forward.
Discovery already records the source encryption value (aws-owned | cmk-arn). Use it:
If the source used a CMK, ask the customer explicitly which they want on the new KB: reuse the same key ARN (default recommendation — preserves posture), use a different CMK, or accept the AWS-owned default. If the source had no CMK, state plainly that the new KB will use the AWS-owned key, and offer the CMK path if they want to raise posture during the migration. Never decide silently.
The same CMK can serve the source and the new KB at the same time. A KMS key is account-level and referenced by ARN; passing the source's key to the new KB is normal — both run on it during the parallel-validation window.
Bedrock creates a grant on the key — it never edits the key policy. On
CreateKnowledgeBasewith akmsKeyArn, Bedrock verifies it can use the key and creates KMS grants automatically. Grants can remain after the KB is deleted (observed: all of them stayed); after deleting a CMK-encrypted KB, check withaws kms list-grants --key-id <KEY_ARN>and retire the stale ones. A grant is a separate authorization object; Bedrock does not modify the key policy to do this, and neither should the agent describe it that way. The managed KB's own service role needs no permission on this KB-storage key.The customer owns the key policy — recommend, never modify. The one prerequisite lives in the key policy, which the customer owns and updates: it must permit the identity that runs
CreateKnowledgeBasetokms:CreateGrant(plusGenerateDataKey/Decrypt), scoped withkms:ViaService: bedrock.<region>.amazonaws.com. Once the key policy permits the creating identity, Bedrock's automatic grant covers the KB's ongoing use of the key. Recommend the policy below for the customer to apply to their own key — never edit their key policy for them, and never imply Bedrock edits it.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::<account-id>:role/<creating-identity>" }, "Action": ["kms:CreateGrant"], "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.<region>.amazonaws.com" }, "ForAllValues:StringEquals": { "kms:GrantOperations": ["CreateGrant","GenerateDataKey","GenerateDataKeyWithoutPlaintext","DescribeKey","Encrypt","Decrypt"] } } }, { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::<account-id>:role/<creating-identity>" }, "Action": ["kms:GenerateDataKey","kms:Decrypt"], "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.<region>.amazonaws.com" } } } ] }If create fails with a KMS error (
AccessDenied/KMSKeyNotFound), the cause is the creating identity lackingkms:CreateGranton the key — name it rather than burning the retry ladder guessing.
Authoritative reference for the create-time grant behavior and the exact key policy: Encryption of knowledge base resources.
2. CreateDataSource (MANAGED_KNOWLEDGE_BASE_CONNECTOR)
aws bedrock-agent create-data-source --region <REGION> --profile <PROFILE> \
--knowledge-base-id "<NEW_OWNED_KB>" \
--name "<DS_NAME>" \
--client-token "<CLIENT_TOKEN>" \
--data-source-configuration '{
"type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR",
"managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "S3",
"version": "1",
"connectionConfiguration": { "bucketName": "<BUCKET>", "bucketOwnerAccountId": "<account-id>" },
"filterConfiguration": { "maxFileSizeInMegaBytes": "<OPTIONAL_LIMIT>" }
},
"deletionProtectionConfiguration": {
"deletionProtectionStatus": "ENABLED"
},
"syncSchedule": {
"weekly": { "dayOfWeek": "MONDAY" }
}
}
}'deletionProtectionConfiguration is a sibling of connectorParameters and is shown in the request
above as the secure default: ENABLED, with the threshold left at the service default unless the customer
sets one. It is optional at the API level, but emit it
explicitly rather than relying on omission; set "deletionProtectionStatus": "DISABLED" only on an
explicit customer opt-out. The CUSTOM connector (direct ingestion) does not support deletion protection
— omit this block for a CUSTOM data source (§2d).
syncSchedule is also an optional sibling of connectorParameters (shown above for illustration).
It sets a recurring schedule on which Amazon Bedrock automatically syncs the data source for all native
data source connectors. The AWS docs
(kb-managed-connect-ds.html)
state you specify exactly one of: daily (an empty object — "Syncs once per day at a system-chosen
off-peak time"); weekly (requires dayOfWeek, a value SUNDAY–SATURDAY); or monthly (requires
dayOfMonth, holding either a dayNumber (allowed range: DayOfMonth) or an empty lastDayOfMonth object). "Omit
syncSchedule to sync on demand only." The schedule is carried over from the source, not asked:
no timer on the source means omit it (on demand, as today); a timer the schedule can express is
carried; any other timer stays the customer's own (see plan
→ "Sync schedule"). In CloudFormation it is SyncSchedule on ManagedKnowledgeBaseConnectorConfiguration
of AWS::Bedrock::DataSource, with exactly one of Daily (JSON {}), Weekly (DayOfWeek) or
Monthly (DayOfMonth with DayNumber or LastDayOfMonth); every one is "Update requires: No
interruption"
(SyncSchedule).
Unlike ConnectorParameters, these are PascalCase typed properties. For Terraform, check the provider's
schema for the attribute (see iac-schema); never write
one the schema does not have.
--vector-ingestion-configuration is intentionally omitted above. Omitting it is required when the KB
uses the managed embedding model: any chunkingConfiguration (even FIXED_SIZE/NONE) is rejected with
ValidationException: "A chunking strategy cannot be specified with a managed embedding model", and the
managed fixed-size default applies (size and overlap on the Customize ingestion page). Only when the
KB uses a CUSTOM embedding model may you pass --vector-ingestion-configuration to set FIXED_SIZE or
NONE explicitly; SEMANTIC/HIERARCHICAL are rejected either way, so omit for those.
S3 filters preserved; no dedicated bucket by default. A source S3 data source's key-prefix scoping and
size limits carry over through the managed filterConfiguration block (below); the managed KB reads the
existing bucket — a migration does not require a dedicated bucket by default.
| Parameter | Expected? | Notes |
|---|---|---|
knowledgeBaseId | required | The new owned managed KB |
name | required | |
clientToken | optional to the API; required by this workflow | Idempotency token (--client-token); a stable value makes the create safe to re-run without duplicating the data source. The API accepts the call without it, but this migration requires a stable per-operation token on every create for resume safety. Record it (§7) |
dataSourceConfiguration.type | required = MANAGED_KNOWLEDGE_BASE_CONNECTOR | |
connectorParameters.type | required | S3, ONEDRIVE, CONFLUENCE, CONFLUENCEONPREM (Confluence Data Center), SHAREPOINT, WEB, GOOGLEDRIVE, SALESFORCE, ZENDESK, BOX, SERVICENOW, CUSTOM (the set grows; the connect-ds page's Topics list is current). The managed names are WEB/GOOGLEDRIVE; WEB_CRAWLER/GOOGLE_DRIVE are rejected with Invalid connector type (see §2b enum note). CUSTOM is a direct push/ingestion source (no crawl, no secret) — see §2d. The set is expanding — confirm the live set and each connector's exact shape from its own doc page; do not quote a fixed count |
connectorParameters.version | required = "1" (string) | |
connectorParameters.connectionConfiguration | required | S3: bucketName + bucketOwnerAccountId; auth connectors: secretArn + connector fields (§2b) |
connectorParameters.filterConfiguration | optional | Per-connector filters. S3: inclusionPrefixes, exclusionPrefixes, inclusionPatterns, exclusionPatterns, maxFileSizeInMegaBytes (prefixes scope which S3 keys are ingested; patterns are regexes) |
connectorParameters.aclEnabled | optional (auth connectors) | Document-level access-control flag. There is no accessControlConfiguration/crawlAcl on managed connectors |
managedKnowledgeBaseConnectorConfiguration.deletionProtectionConfiguration.deletionProtectionStatus | optional (API) | ENABLED/DISABLED (+ optional deletionProtectionThreshold). It caps the share of indexed documents one sync may delete (a sync above it skips its delete phase); it does not block a DeleteDataSource call. Range and default: DeletionProtectionConfiguration and the connect-ds page. Sibling of connectorParameters. Secure generated-request default: ENABLED (threshold left at the service default unless the customer sets one), where the connector supports it — emit it explicitly and set DISABLED only on an explicit customer opt-out. No enableDeletionProtection field. The CUSTOM connector does not support it (§2d) |
managedKnowledgeBaseConnectorConfiguration.mediaExtractionConfiguration | optional | Extract media (images/audio/video) from files |
managedKnowledgeBaseConnectorConfiguration.syncSchedule | optional (carried from the source) | Recurring auto-sync for native connectors. Sibling of connectorParameters. Specify exactly one of daily ({}), weekly (dayOfWeek SUNDAY–SATURDAY), monthly (dayOfMonth with dayNumber or empty lastDayOfMonth; range: DayOfMonth). Omitting it = sync on demand only. Not asked: omit it when the source has no timer; carry a timer it can express; otherwise the customer keeps their own timer (plan → "Sync schedule"). CloudFormation: SyncSchedule (Daily / Weekly / Monthly), update without interruption |
vectorIngestionConfiguration.chunkingConfiguration.chunkingStrategy | optional (forbidden with the managed embedding model) | Depends on the embedding-model type. With the managed embedding model, omit chunkingConfiguration entirely — passing any strategy, including FIXED_SIZE/NONE, is rejected with ValidationException: "A chunking strategy cannot be specified with a managed embedding model". With a custom embedding model, FIXED_SIZE or NONE is accepted; if you pass FIXED_SIZE, fixedSizeChunkingConfiguration requires both maxTokens and overlapPercentage (ranges in the FixedSizeChunkingConfiguration API reference) and those values are retained. DEFAULT/HIERARCHICAL/SEMANTIC are rejected server-side in both cases — omit for those |
dataSourceConfiguration.type = CUSTOM (top-level, self-managed shape) | ❌ rejected | This is the self-managed shape. For a custom/direct-push source on a managed KB, use type: MANAGED_KNOWLEDGE_BASE_CONNECTOR with connectorParameters.type: CUSTOM (§2d) — S3 staging is no longer required |
chunking DEFAULT / HIERARCHICAL / SEMANTIC (explicit) | ❌ rejected server-side | Omit chunkingConfiguration to use the managed default, or (custom embedding model only) pass FIXED_SIZE/NONE explicitly. Nothing client-side catches this: chunkingStrategy is a shape shared with self-managed whose model enum is the full [FIXED_SIZE, NONE, HIERARCHICAL, SEMANTIC], so SEMANTIC/HIERARCHICAL pass client validation cleanly. Same for parsingConfiguration and for customTransformationConfiguration / contextEnrichmentConfiguration, which exist in the model despite being managed blockers. A skeleton, cfn-lint or terraform validate will never flag these — only a live create will. Treat the managed restriction as live-tested behavior, not a schema fact |
any chunking strategy (incl. FIXED_SIZE/NONE) with the managed embedding model | ❌ rejected server-side | ValidationException: "A chunking strategy cannot be specified with a managed embedding model". On a managed-embedding KB omit chunkingConfiguration completely — the managed default applies. Also invisible client-side, and not documented in the AWS user guide, so do not "correct" it from the docs page. A chunking config is accepted only when the KB uses a custom embedding model |
accessControlConfiguration / crawlAcl (self-managed field) | ❌ not a managed field | Use connectorParameters.aclEnabled (auth connectors) instead |
credentialsSecretArn (self-managed field) | ❌ not a managed field | The managed secret is connectionConfiguration.secretArn |
serverSideEncryptionConfiguration (DS level) | ❌ rejected | Use KB-level CMK instead |
parsingConfiguration | n/a | Managed forces SMART_PARSING — there is no parser to select. It is a per-content-type strategy (bounding-box → FM extraction/captioning/video scene description), with documented per-file size ceilings (read them live; mapping → "Documented ingestion ceilings"). Capability detail: mapping → "Managed-only capabilities" |
Response: dataSource.dataSourceId, dataSource.status (CREATING → AVAILABLE).
Canonical API reference — check it for the current field list and limits before every call. The API
reference governs the request/response shape; the user guide (and the per-connector pages in §2c)
govern behavior and defaults. Read the API reference for CreateDataSource and confirm the current
fields against it (or --generate-cli-skeleton, remembering the connectorParameters body is free-form
and unmodelled — §2b) before building the call:
CreateDataSource API reference.
2b. Auth-based connectors (SharePoint, Confluence, OneDrive) — exact managed shapes
The managed connector shape differs from the self-managed connector — the managed secret field is
connectionConfiguration.secretArn (not credentialsSecretArn), the auth-type values are different, and
fields are grouped into connectionConfiguration / dataEntityConfiguration / filterConfiguration
sub-objects. Auth-based connectors are the top cause of FAILED data sources, almost always a secret or
certificate problem. Re-verify these shapes against the per-connector doc pages (§2c) before building a call.
Connector authentication — what carries over and who does what.
No documented mapping exists from a self-managed auth type to a managed one, and the managed secret's key set differs (each connector's section below). Choose the managed
authTypefrom that connector's page, with the customer; treat the source secret as reference only. ConfluenceBASICwas carried over in live testing with a new secret holding the managed key set; the SharePoint and OneDrive application paths are not verified here — say so.User-managed setup (3LO),
authType: MANAGED_OAUTH2on SharePoint, OneDrive and Confluence, is a console sign-in: the customer signs in to the source from the Bedrock console, Bedrock creates the token secret, and the KB role refreshes it. It is the customer's step, never the agent's (kb-managed-3lo-setup lists the console user's permissions).AWS publishes a sample that sets up Microsoft, Google and Atlassian connectors end to end (aws-samples/sample-managed-kb-connector-setup). Point the customer to it as a sample, not as part of this migration: ask before suggesting any change on the Microsoft, Google or Atlassian side, refer to secrets by ARN only, prefer the least privilege the source supports (for SharePoint,
Sites.Selected), and do not copy its code into the migration.
Common wrapper: deletionProtectionConfiguration (deletionProtectionStatus) and
mediaExtractionConfiguration are siblings of connectorParameters; aclEnabled is a flat boolean
inside connectorParameters.
SharePoint (connectorParameters.type = SHAREPOINT)
{ "type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR", "managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "SHAREPOINT", "version": "1", "aclEnabled": true,
"connectionConfiguration": {
"secretArn": "<SECRET_ARN>", "tenantId": "<TENANT_ID>", "authType": "ENTRA_ID_APP_ONLY",
"certificateS3Path": { "s3BucketName": "<CERT_BUCKET>", "s3KeyName": "certs/certificate.p12" } },
"dataEntityConfiguration": { "crawlFiles": true, "crawlPages": true,
"siteUrls": ["https://contoso.sharepoint.com/sites/engineering"] },
"filterConfiguration": { "inclusionItemPaths": ["..."], "modifiedDateAfter": "..." } } } }Field (in connectionConfiguration) | Required | Notes |
|---|---|---|
secretArn | Yes | ARN of the Secrets Manager secret |
tenantId | Yes | Microsoft Entra (Azure AD) tenant ID |
authType | Yes | ENTRA_ID_APP_ONLY (recommended), OAUTH2_APP, or MANAGED_OAUTH2 (3LO console sign-in) |
certificateS3Path ({s3BucketName, s3KeyName}) | Conditional | Required for ENTRA_ID_APP_ONLY even with ACLs off — a data source with this authType and no certificate FAILS. Omit for OAUTH2_APP |
dataEntityConfiguration: siteUrls (JSON array; each path begins /sites/, /teams/, or
/personal/), crawlFiles (default true), crawlPages (default true).
filterConfiguration (optional): modifiedDateBefore, modifiedDateAfter, inclusionItemPaths.
Secret keys — ENTRA_ID_APP_ONLY: clientId + certificatePassword (or privateKey for PEM);
OAUTH2_APP: clientId + clientSecret + userName + password.
aclEnabled (shown as true above) is a required, explicit customer choice per data source — never a
silent default. Disclose what each value means (ACL-aware filtering on vs off; see §3b) and that it is
immutable after create, then set the value the customer chose — true to enforce ACL filtering (as in
the example) or false when the customer accepts no document-level filtering. The choice by itself is
not a blocker — either value is a valid migration. It becomes a blocker only when the selected mode
lacks its required auth/ACL configuration (e.g. ACLs on for SharePoint forces ENTRA_ID_APP_ONLY and a
certificateS3Path); in that case say what is missing rather than silently flipping the flag. The siteUrls value https://contoso.sharepoint.com/sites/engineering
is an example only (contoso.sharepoint.com is a placeholder domain) — replace it with the customer's
real site URL(s).
Confluence (connectorParameters.type = CONFLUENCE)
{ "type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR", "managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "CONFLUENCE", "version": "1", "aclEnabled": true,
"connectionConfiguration": {
"secretArn": "<SECRET_ARN>", "type": "SAAS", "authType": "BASIC",
"hostUrl": "https://example.atlassian.net" },
"dataEntityConfiguration": { "crawlPage": true, "crawlBlog": true,
"crawlPageAttachment": true, "crawlBlogAttachment": true },
"filterConfiguration": { "inclusionSpaceKeys": ["ENG", "DOCS"] } } } }Field (in connectionConfiguration) | Required | Notes |
|---|---|---|
secretArn | Yes | Secret ARN |
type | Yes | Confluence deployment type — SAAS only (distinct from connectorParameters.type=CONFLUENCE) |
authType | Yes | BASIC, OAUTH2, or MANAGED_OAUTH2 (3LO console sign-in) |
hostUrl | Yes | Base URL ending .atlassian.net (custom domains unsupported) |
dataEntityConfiguration: crawlPage, crawlBlog, crawlPageAttachment, crawlBlogAttachment,
crawlArchivedSpace, crawlArchivedPage, crawlPersonalSpace. The connector page lists the block as
optional, but live creates without it were rejected with Value at 'dataEntityConfiguration' failed to satisfy constraint: Member must not be null. Always send it, with the entity types the source crawled
(the page's own example sets the four crawl* flags shown above). Also send hostUrl with no trailing
slash; a carried-over trailing slash was rejected on the same call.
filterConfiguration (optional): inclusionSpaceKeys, inclusionSpaceUrls, inclusionMimeTypes,
exclusionMimeTypes, maxFileSizeInMegaBytes (numeric string; default on the connector page).
aclEnabled has a documented default that depends on authType (BASIC→true, OAUTH2→false) and is
permanent after create. Do not rely on that default silently: make it an explicit customer choice,
disclose the meaning (§3b) and the immutability, then set it. The choice alone is not a blocker; it blocks
only when the selected mode lacks its required auth/ACL configuration. Secret keys — BASIC: username (email) + password (Atlassian API token) + hostUrl
(+ adminApiKey, organizationId, directoryId when aclEnabled); OAUTH2: per the Confluence OAuth2
setup page.
OneDrive (connectorParameters.type = ONEDRIVE)
{ "type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR", "managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "ONEDRIVE", "version": "1", "aclEnabled": true,
"connectionConfiguration": {
"secretArn": "<SECRET_ARN>", "tenantId": "<TENANT_ID>", "authType": "ENTRA_APP_ID",
"certificateS3Path": { "s3BucketName": "<CERT_BUCKET>", "s3KeyName": "certs/certificate.p12" } },
"dataEntityConfiguration": { "crawlPersonalDrives": true } } } }Field (in connectionConfiguration) | Required | Notes |
|---|---|---|
secretArn | Yes | Secret ARN |
tenantId | Yes | Microsoft Entra tenant ID |
authType | Yes | ENTRA_APP_ID (recommended), OAUTH2, or MANAGED_OAUTH2 (3LO console sign-in) |
certificateS3Path ({s3BucketName, s3KeyName}) | Conditional | Required only when aclEnabled is true (Entra App ID). Not used for content-only or OAUTH2 |
dataEntityConfiguration: crawlPersonalDrives, crawlSharedWithMe (OAUTH2 only).
crawlPersonalDrives is optional — do not set it to true by default. Enabling it (as the example
shows for completeness) pulls in individual users' personal OneDrive content, which frequently contains
PII; set it deliberately with the customer, not automatically. Note that with Microsoft Entra ID App
authentication only personal drives can be crawled — so on that auth type this is the crawl scope, and the
PII consideration applies directly.
filterConfiguration (optional): inclusionUserEmailAddresses, exclusionUserEmailAddresses,
userFilterPath, inclusionDriveItems, exclusionDriveItems, includeMimeTypes, excludeMimeTypes,
absoluteDateBefore, absoluteDateAfter.
aclEnabled (shown as true above, which is why the example includes the required certificateS3Path) is
a required, explicit customer choice — never a silent default; disclose its meaning (§3b) and that it is
immutable after create, then set the chosen value (true to enforce ACL filtering, or false to
accept none — with false the certificateS3Path is not required). The choice alone is not a blocker; it
blocks only if the selected mode lacks its required auth/ACL configuration (ACLs on requires the Entra
app-id auth type and the certificate).
Secret keys — ENTRA_APP_ID: clientId + clientSecret (+ certificatePassword when aclEnabled);
OAUTH2: per the OneDrive OAuth2 setup page.
S3 and Web Crawler (no secret)
S3—connectionConfiguration: { bucketName, bucketOwnerAccountId }; optionalfilterConfiguration: { inclusionPrefixes, exclusionPrefixes, inclusionPatterns, exclusionPatterns, maxFileSizeInMegaBytes }(key-prefix scoping + regex patterns). See §2. Optional top-levelconnectorParametersfields:metadataFilesPrefix(where.metadata.jsonsidecar files live),aclEnabled(an explicit choice, immutable after create — disclose its meaning per §3b and set the customer's decision, don't default it silently), andaclConfiguration: { globalAccessControlListS3Uri }— required whenaclEnabledis true, ignored when false. Note the bucket is named bybucketName, not an ARN: a sourcebucketArnmust be reduced to the bare name. There is no universal default — pick the value with the customer.ACL-enabled S3 (the
aclConfigurationis mandatory here):{ "type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR", "managedKnowledgeBaseConnectorConfiguration": { "connectorParameters": { "type": "S3", "version": "1", "aclEnabled": true, "connectionConfiguration": { "bucketName": "<BUCKET>", "bucketOwnerAccountId": "<account-id>" }, "aclConfiguration": { "globalAccessControlListS3Uri": "s3://<BUCKET>/<acl-config>.json" }, "filterConfiguration": { "inclusionPrefixes": ["published/en/"] } } } }When the customer chooses no document-level filtering, set
"aclEnabled": falseand omitaclConfigurationentirely (it is ignored when false) — the rest of the shape is unchanged.WEB— full shape below.GOOGLEDRIVEis secret-based like the others. (The managed connector names areWEB/GOOGLEDRIVE—WEB_CRAWLER/GOOGLE_DRIVEare rejected; see the enum conflict note.)
--generate-cli-skeletondoes NOT reveal connector fields. It returns"connectorParameters": {}. The field is free-form in the API model, the CloudFormation schema and the Terraform provider, so no skeleton,describe-type,cfn-lintorterraform validatewill ever list or check its contents. The skeleton remains useful for the wrappers (deletionProtectionConfiguration,mediaExtractionConfiguration). For the connector body, this file plus the per-connector doc page (§2c) are the only authority. Re-verify against the docs.
WEB (connectorParameters.type = WEB)
Source: kb-managed-ds-webcrawler.md. The self-managed web crawler's crawlerConfiguration splits into
two managed objects: crawlConfiguration (behaviour) and filterConfiguration (URL patterns).
{ "type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR", "managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": {
"type": "WEB", "version": "1",
"connectionConfiguration": {
"seedUrls": ["https://docs.example.com"],
"authType": "<AUTH_TYPE>"
},
"crawlConfiguration": { "syncScope": "SUB_DOMAINS", "crawlAttachments": true },
"filterConfiguration": { "exclusionPatterns": ["https://docs.example.com/private/.*"] } } } }Add crawlDepth, maxLinksPerUrl and maxCrawledUrlsPerMinute to crawlConfiguration only when the source
sets them, carrying the source's values; omitted, the service defaults apply.
| Field | Required | Notes |
|---|---|---|
connectionConfiguration.seedUrls | conditional | List (maximum length on the connector page). Required unless siteMapUrls is given |
connectionConfiguration.siteMapUrls | conditional | List (maximum length on the connector page). Required unless seedUrls is given |
connectionConfiguration.authType | required | NO_AUTH | BASIC_AUTH | FORM | SAML. Never inferred — a generic example uses <AUTH_TYPE>. Use NO_AUTH only after the customer confirms the site is public; otherwise it is BASIC_AUTH / FORM / SAML with a secretArn. Even a public site needs authType set explicitly |
connectionConfiguration.secretArn | conditional | Required whenever authType ≠ NO_AUTH (by ARN only) |
crawlConfiguration.crawlDepth | optional | Range and default on the connector page |
crawlConfiguration.maxLinksPerUrl | optional | Range and default on the connector page |
crawlConfiguration.maxCrawledUrlsPerMinute | optional | Range on the connector page. This is where a self-managed rateLimit goes |
crawlConfiguration.implicitWaitInSeconds | optional | Wait after page-ready before reading; raise for JS-heavy pages |
crawlConfiguration.syncScope | optional | PATH_SPECIFIC (same host + same initial path) | DOMAINS_ONLY (same host, any path) | SUB_DOMAINS (primary domain incl. subdomains). Omitted = PATH_SPECIFIC behaviour. A self-managed scope: HOST_ONLY maps to DOMAINS_ONLY |
crawlConfiguration.crawlAttachments | optional | Crawl linked files/PDFs |
filterConfiguration.inclusionPatterns / exclusionPatterns | optional | Regex lists over URLs |
filterConfiguration.maxFileSizeInMegaBytes | optional | Numeric string; default on the connector page |
There is no crawlScope, rateLimit, crawlerConfiguration or crawlerLimits on the managed
connector — those are the self-managed names and are silently accepted into the free-form blob, then
ignored or rejected by the service. The managed connector also has no page cap: a self-managed
crawlerLimits.maxPages has nowhere to go, so the new crawl can reach more pages than the source did. Flag a
dropped maxPages in the plan and offer the managed controls that narrow a crawl (inclusionPatterns /
exclusionPatterns, syncScope, crawlDepth).
authType is required and never inferred. Do not default a web data source to NO_AUTH. Resolve it
with the customer: NO_AUTH only once they confirm the site is public; otherwise BASIC_AUTH / FORM /
SAML with a Secrets Manager secretArn (by ARN only). A generic example uses <AUTH_TYPE>, not a
concrete value. The web crawler has no ACL support — there is no aclEnabled on this connector (web
content has no permission model; see §3b), so never add one to a WEB data source.
Connector-name enum conflict (resolved).
kb-managed-connect-ds.mdlists the supported types asS3, ONEDRIVE, CONFLUENCE, SHAREPOINT, WEB_CRAWLER, GOOGLE_DRIVE, but the per-connector page (kb-managed-ds-webcrawler.md) says "specifyWEBas the connector type", and live testing getsInvalid connector typeforWEB_CRAWLER/GOOGLE_DRIVE. The per-connector page and live testing win: useWEBandGOOGLEDRIVE. The overview page's enum is stale — expect to see it while reading the docs, and do not "correct" a workingWEBtoWEB_CRAWLERon the strength of it.
Secrets Manager secret rules (auth connectors)
The secret must exist before
create-data-source, in the KB's Region. Pass only its ARN inconnectionConfiguration.secretArn(never the value). The managed-connector docs do not require anAmazonBedrock-name prefix; only require it if the KB role's policy scopes secret access toAmazonBedrock-*.Key/value contents depend on connector +
authType(tables above; full detail on the connector's "Set up … authentication" doc page). Do not guess key names.The KB execution role needs
secretsmanager:GetSecretValueon the ARN (+kms:Decryptfor a CMK), and for the certificate methodss3:GetObject/s3:ListBucketon the.p12object incertificateS3Path(+kms:Decryptif SSE-KMS).
Precondition gate — do not submit before auth is confirmed; do not loop on FAILED
Before calling create-data-source (or syncing) for an auth connector, confirm ALL of these:
A secret exists at the ARN, in the KB's Region, with keys matching the managed connector +
authType.For SharePoint
ENTRA_ID_APP_ONLY(and OneDriveENTRA_APP_IDwith ACLs), the.p12certificate is in S3 atcertificateS3Pathand the role can read it.The KB role can read the secret (
secretsmanager:GetSecretValue, +kms:Decryptfor a CMK).siteUrls(array) /hostUrl/tenantId/aclEnabledare present and correctly shaped.
If any precondition is unmet or unknown, stop and ask the user (or hand off the secret-creation as a user
step) — do NOT submit the call to the live service to "see if it works." On a FAILED data source, run
one diagnosis pass against this checklist and the error, report the specific missing item, and stop.
Never resubmit the same call or try random variations — auth failures are config/permission problems
that re-running cannot fix.
§2c — Doc sources
Re-verify these pages before building an auth-connector call; read them per safety-and-iam.
Connect a data source (wrapper fields, S3 example; its type enum is stale — see the conflict note in §2b): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-connect-ds.html
Amazon S3 connector (filter + ACL + metadata fields): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-s3.html
Web Crawler connector (
WEB— connection/crawl/filter fields): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-webcrawler.htmlSharePoint connector + connect (JSON): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-sharepoint-connect.html
SharePoint Entra setup (secret keys, certificate): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-sharepoint-entra-setup.html
SharePoint OAuth2 setup (secret keys): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-sharepoint-oauth2-setup.html
Confluence connect (JSON) + Basic setup: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-confluence-connect.html
OneDrive connect (JSON) + Entra setup: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-onedrive-connect.html
Most common FAILED-status causes for these connectors
In rough frequency order: a self-managed field (credentialsSecretArn,
accessControlConfiguration.crawlAcl, hostType, domain) or connector name
(WEB_CRAWLER/GOOGLE_DRIVE) used instead of the managed shape above; a missing/wrong
connectionConfiguration.secretArn, or secret keys that don't match the managed authType; SharePoint
ENTRA_ID_APP_ONLY created without certificateS3Path; a KB role lacking
secretsmanager:GetSecretValue/kms:Decrypt or S3 read on the certificate; SharePoint siteUrls passed as
a string rather than a JSON array; and a wrong authType for the connector (e.g. the self-managed
OAUTH2_CLIENT_CREDENTIALS instead of managed ENTRA_ID_APP_ONLY/OAUTH2_APP), or a Confluence hostUrl
not ending .atlassian.net. Each maps to a fix in §6.
2d. CUSTOM connector (direct ingestion) — no crawl; documents are pushed in
A MANAGED KB does support a custom data source. Not via the self-managed top-level
dataSourceConfiguration.type: CUSTOM (that is rejected on managed — §6), but as a connector:
type: MANAGED_KNOWLEDGE_BASE_CONNECTOR with connectorParameters.type: CUSTOM. This is the managed
replacement for a self-managed CUSTOM source: documents are pushed directly into the data source
instead of being staged to S3 for a crawl. There is no secret and no connectionConfiguration — it is
a push target, not a crawl. A self-managed Lambda customTransformationConfiguration has no managed
equivalent — do not present this connector as a substitute for it; direct the customer to AWS Support (see
mapping).
Create (the data source reaches AVAILABLE directly). Set aclEnabled explicitly — it is a
required customer choice for CUSTOM too, not a silent default:
aws bedrock-agent create-data-source --region <REGION> --profile <PROFILE> \
--knowledge-base-id "<NEW_OWNED_KB>" --name "<DS_NAME>" --client-token "<CLIENT_TOKEN>" \
--data-source-configuration '{
"type": "MANAGED_KNOWLEDGE_BASE_CONNECTOR",
"managedKnowledgeBaseConnectorConfiguration": {
"connectorParameters": { "type": "CUSTOM", "version": "1", "aclEnabled": true }
}
}'The service normalizes connectorParameters to its defaults (a filterConfiguration with the default
maxFileSizeInMegaBytes, aclEnabled: false, version: "1") —
and defaults mediaExtractionConfiguration.imageExtractionConfiguration.imageExtractionStatus to ENABLED.
mediaExtractionConfiguration remains an optional sibling of connectorParameters.
CUSTOM supports ACLs, set through aclEnabled — make it an explicit customer choice. Per the
Custom data source ACL docs,
aclEnabled: true turns on document-level access-control filtering for a CUSTOM source; the example above
sets it explicitly rather than relying on the false default. Disclose the meaning (§3b) and set the value
the customer chose (true to enforce ACL filtering, false to accept none). Do not call the CUSTOM
aclEnabled immutable — that page states it can be set on create or update. This provisioning
workflow still sets it explicitly at create and makes no update call, so it is fixed at create by
this workflow, but it is not immutable at the API level for CUSTOM. When aclEnabled is true, each
IngestKnowledgeBaseDocuments push (a user-run step) must supply the document's ACL metadata (allowed
/ denied principals) — a document pushed without it is not access-controlled. Deletion protection still
does not apply to the CUSTOM connector — it is a direct-push target, not a crawl, so do not add a
deletionProtectionConfiguration block to a CUSTOM data source (the secure ENABLED default in §2 is for
the connectors that support it).
| Create parameter | Expected? | Notes |
|---|---|---|
connectorParameters.type | required = CUSTOM | |
connectorParameters.version | required = "1" (string) | |
connectorParameters.connectionConfiguration | ❌ omit | No crawl target and no secretArn — documents are pushed |
connectorParameters.filterConfiguration.maxFileSizeInMegaBytes | optional | Numeric string; default on the connector page |
connectorParameters.aclEnabled | optional (explicit choice) | Service default false; set it explicitly with the customer. true enables document-level ACL filtering and requires ACL metadata on every IngestKnowledgeBaseDocuments push. Settable on create or update (not immutable for CUSTOM); this workflow sets it at create only. See the Custom ACL doc below |
vectorIngestionConfiguration.chunkingConfiguration | optional | Managed chunking rules apply (§6): forbidden with the managed embedding model (omit it); with a custom embedding model, FIXED_SIZE or NONE only |
Filling it is a user-run step, and this file gives no interface for it. A CUSTOM source is never synced: the user pushes documents straight in, and they become part of both the data source and the KB with no sync step at all. The agent creates the data source and stops there. What the agent should tell the user about the model, without handing them a call:
Push, don't sync. Never run a sync against a CUSTOM data source — pushing and syncing the same source is a conflict, not a belt-and-braces approach.
Documents can be sent inline or referenced in S3, including multimodal content, and each carries a caller-chosen identifier. Re-pushing the same identifier overwrites that document, which is how updates work here.
Metadata travels with the document and is what retrieval filters act on later (§3).
Pushes are batched and rate-limited, so a bulk load is a script with pacing, not a loop of one-off commands (mapping carries the current batch size and rate).
Listing, fetching and deleting pushed documents is available directly — no console round-trip needed when the user wants to check or clean up what they sent.
Retrieval is unchanged (§3). The create-data-source shape above reaches AVAILABLE; the document-push
behavior described here comes from the public direct-ingestion docs, which is where the user should get the
request shapes.
Doc sources:
Connect a custom data source: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-data-source-connector.html
Custom data source access control (
aclEnabled, ACL metadata on ingest, set on create or update): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-custom-acl.htmlIngest changes directly (custom needs no sync; S3 does): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-direct-ingestion.html
Ingest documents directly (request bodies / examples): https://docs.aws.amazon.com/bedrock/latest/userguide/kb-direct-ingestion-add.html
IngestKnowledgeBaseDocuments API: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_IngestKnowledgeBaseDocuments.html
3. Retrieval surfaces (runtime) — user-run; what they are and when each fits
The agent never queries a knowledge base. Both surfaces below return document text, so running them is the user's step — during their own validation of the new KB, and in their application code. This section exists so the agent can explain the surfaces (the Explore mode), reason about gap coverage, and report caller impact in a plan. It deliberately carries no request shapes, parameter tables or CLI invocations: the user takes those from the API reference linked at the end, or generates a skeleton from their own SDK. For applied configuration the agent uses the §4 read-only probes, which return configuration only, never document text.
A content-returning read needs the customer's explicit yes first — the rule is in safety-and-iam → "Content-returning reads".
A managed KB has two query surfaces, and the choice between them is made per question shape, not per knowledge base.
Retrieve — one similarity search
One search, one round trip. Lowest cost and lowest latency, ranked chunks with relevance scores in the results, and the caller keeps full control over how — or whether — an answer is generated. This is the surface a self-managed KB already exposes, so it is the one existing callers are migrating.
AgenticRetrieveStream — an FM planning loop, MANAGED-only
Instead of a single search, a foundation model drives a loop: decompose the question into sub-queries → retrieve for each → judge whether the evidence is sufficient → iterate if not → return deduplicated chunks, plus a grounded answer unless the caller asks for chunks only. When passage-level context is not enough it can expand to a whole document, which is what makes summarization and "list every X" questions work. The response is always a stream, and the planning steps are visible as trace events.
It also routes across several knowledge bases: register a few, give each a natural-language
description, and the planner chooses per sub-query, tagging each result with the KB that answered. Those
descriptions are the routing contract — a specific one-sentence pitch per KB routes well, "internal docs"
does not. This is what keeps a data-sources-per-KB split invisible to the caller
(mapping → "Gap coverage"). How many
knowledge bases one call may route across is a quota — read it from kb-managed-quotas before quoting
it, not a fixed law.
This surface does not exist on a self-managed (VECTOR) KB at all. It is the single largest capability
the migration gains, and three rows of the mapping's "Gap coverage" table lean on it. The agent should
note the agentic surface as an adoption opportunity whenever it explains retrieval — net-new value, not a
like-for-like port.
Choosing the surface
Retrieve | AgenticRetrieveStream | |
|---|---|---|
| Best for | short, well-scoped lookups; FAQ; latency-critical paths | multi-part, comparative, exploratory, cross-KB questions |
| Output | ranked chunks + scores | deduplicated chunks (streaming) + optional grounded answer |
| Query decomposition | no | yes |
| Multiple knowledge bases | no | yes — up to a published ceiling, enforced as a quota (read it live) |
| Whole-document expansion | no | yes, when passages are insufficient |
| Streaming | no | always |
| FM cost per call | none | one planner invocation per iteration |
| Latency | lowest | highest |
| Relevance scores | in the results | in the trace events only |
| Guardrails | supported, including the masking action | supported, but effectively blocking-only |
Self-managed (VECTOR) KB | yes | no — MANAGED only |
Reranking is optional on both. Start with Retrieve for direct lookups; reach for the agentic surface when
questions are multi-part or the evidence spans several knowledge bases.
What changes for existing Retrieve callers — report this as a caller impact, every time
The operation names are unchanged, which makes repointing at the new knowledge base id look sufficient. It is not: the request body differs, and so does the meaning of a score. Report all of the following on every plan that changes the target KB, and in any answer about whether callers keep working. Give each item's concrete before and after value as written here (the old and new URI form, the old and new key names, the zero-result behaviour), not only that something changes:
The new knowledge base id. Callers must repoint at the owned KB's id; the source id keeps working against the untouched source.
The search-configuration wrapper changes. A self-managed call carries
vectorSearchConfiguration; a managed call carriesmanagedSearchConfiguration. Sending the self-managed wrapper to a managed KB passes client-side validation and is rejected by the service.Semantic-only search cannot be requested at all.
overrideSearchTypeis a member of the self-managed wrapper only. The managed wrapper has no such member, so a semantic-only call is not "refused by the service" — it is structurally inexpressible, and fails inside the caller's own SDK before a request is sent (§6 carries the exact message). Managed search is hybrid, always on and not configurable; the constraint and the feature are the same fact.Score thresholds need re-tuning. Scores are on a different scale on the managed knowledge base, and the scale also depends on the reranking mode, so a ported threshold silently changes how much it admits. Re-tune per reranking mode; compare ranking and content, not score magnitude.
Reranking defaults by embedding type, and is a caller option.
managedSearchConfigurationtakesrerankingModelType. Omitted, it meansMANAGEDon a managed-embedding KB and behaves asNONEon aCUSTOM-embedding KB; an explicitMANAGEDon aCUSTOMKB returnsValidationException: Managed reranking is not supported for knowledge bases with custom embedding models.The result location changes form.
location.s3Location.urichanges froms3://<bucket>/<key>tohttps://<bucket>.s3.amazonaws.com/<key>, and a newdocumentIdfield carries thes3://URI (or the page URL). Code that splits ons3://gets no error, just a wrong value.The system metadata keys change.
x-amz-bedrock-kb-*keys (for examplex-amz-bedrock-kb-data-source-id) become_-prefixed keys (_data_source_id,_chunk_id,_source_uri,_document_title,_file_type,_language_code,_created_at,_last_updated_at,_data_source_type). User metadata keys are unchanged. Code reading the old key raisesKeyError.Some filter operators are not supported.
startsWithreturnsSTARTS_WITH operation type is not supported for managed store.andstringContainsreturnsSTRING_CONTAINS operation type is not supported for managed store.;implicitFilterConfigurationis not a member ofmanagedSearchConfiguration. Other operators keep their syntax inside the new wrapper.An ACL knowledge base returns nothing without a user. With
aclEnabled, a call with nouserContextreturns 0 results and no error; a non-emailuserIdalso returns 0 results. Matching on the email ignores case and surrounding spaces.Overlapping data sources return duplicates. Two data sources over the same content return each chunk twice (different
_chunk_ids).
Several of these return empty or wrong results rather than errors, so a caller cannot rely on an exception
to find them. In the handoff, compare Retrieve against Retrieve with the reranking mode held constant,
and on an ACL KB query as a known in-ACL user.
A threshold does not port between the two query surfaces either.
Retrievereturns scores in the results; the agentic surface exposes them only in trace events, so validation built on thresholds has to read the trace.
Filter syntax carries over unchanged, and metadata filtering keeps working.
If the user plans to adopt the agentic surface
Cost has a different shape. It bills the agentic call plus the underlying retrieval calls it issues, times the iteration count, so an estimate from
Retrievevolume alone understates it; the planner model sets the rate. Fetch current rates (cost-analysis rules apply: fetched rates only, never recalled).It needs permissions beyond plain retrieval, including one for fetching whole documents; without that last one, retrieval still works and only document-expansion fails (weak summarization answers, not an error). Take the current action list from the API reference at adoption time.
The intermediate sub-queries are an audit surface the planner invents — log the full trace, not just the returned results.
Iterations drive both cost and latency, so the iteration cap is the main tuning knob.
Doc sources — the authority for request shapes, enums and bounds (this section deliberately carries none). Check the API reference for the current fields and limits before a call — it governs the shape, while the user guide governs behavior and defaults:
Retrieve API reference: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html
AgenticRetrieveStream API reference: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_AgenticRetrieveStream.html
Quotas and limits (knowledge bases per agentic call, iteration default and maximum — quota, not contract): https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html
3b. ACL-aware retrieval (managed) — capability and its boundary
Source docs: kb-managed-acl and kb-test-retrieve-acl (re-verify against the docs). Enabled per data
source via connectorParameters.aclEnabled (§2).
ACL awareness is NOT authorization — say this whenever the feature comes up. Per the AWS docs it is ACL-aware filtering, not a security boundary. The service does not authenticate end users: your application authenticates them and passes verified identity context, and because the service cannot verify that context's authenticity, it must not be the sole access-control mechanism without upstream authentication. Describing it as "managed handles authorization" is a security misrepresentation.
Two stages. Pre-retrieval filtering — permissions (allowed/denied users, allowed/denied groups) are crawled during ingestion and results are filtered against the user context at query time. Real-time ACL verification — for connectors that support it, a live call to the source confirms the user still has access to each returned document, catching changes made since the last sync. Both stages use the same logic and deny always overrides allow. The pipeline fails closed: group-resolution failure, verification timeout or internal error withholds the documents.
Identity model — the sharp edge. The user is always identified by email, used as the universal identifier, and it must match the email on that user in every connected source (the match ignores case and surrounding spaces). There is no alias resolution and no cross-identity-provider mapping. Groups, by contrast, are identified however each connector represents them (name, id, other) and are matched against crawled memberships, which are resolved automatically at query time but are only as fresh as the last sync unless real-time verification covers that connector.
Connector support — not uniform, and it constrains authType:
| Connector | Pre-retrieval filter | Real-time ACL | Constraint to plan around |
|---|---|---|---|
| SharePoint | ✅ | ✅ | Application-level permissions (2LO); requires ENTRA_ID_APP_ONLY |
| OneDrive | ✅ | ✅ | 2LO; requires the Entra app-id auth type |
| Google Drive | ✅ | ✅ | Domain-wide delegation (2LO); requires SERVICE_ACCOUNT |
| Confluence | ✅ | ✅ | Admin API token for the live check; requires BASIC |
| Amazon S3 | ✅ | ❌ | ACLs come from a customer-provided ACL configuration file in S3 — that file is the source of truth, so there is nothing live to verify |
| Custom | ✅ | ❌ | ACLs from customer-provided metadata, same reasoning |
| Web Crawler | ❌ | n/a | ACL awareness cannot be enabled — web content has no permission model |
Two planning consequences: enabling ACLs can force an authType (a SharePoint source needing real-time
ACL cannot use OAUTH2_APP), and aclEnabled is immutable after create on S3 and permanent on
Confluence (§2) — so the ACL decision is a create-time decision, not something to defer.
4. Read / status commands (pre-approved read-only probes)
aws bedrock-agent get-knowledge-base --region <REGION> --profile <PROFILE> --knowledge-base-id <KB_ID>
aws bedrock-agent list-data-sources --region <REGION> --profile <PROFILE> --knowledge-base-id <KB_ID>
aws bedrock-agent get-data-source --region <REGION> --profile <PROFILE> --knowledge-base-id <KB_ID> --data-source-id <DS_ID>
aws bedrock-agent get-ingestion-job --region <REGION> --profile <PROFILE> --knowledge-base-id <KB_ID> --data-source-id <DS_ID> --ingestion-job-id <JOB_ID>KB readiness:
knowledgeBase.status→ wait forACTIVE.Data source readiness:
dataSource.status→ wait forAVAILABLE. These reads take no--client-token.
5. StartIngestionJob — a user-run handoff step
Ingestion is not an agent action, and this file gives no interface for running one. Once the agent
confirms KB ACTIVE and all data sources AVAILABLE, the user starts ingestion on each new (owned)
data source — never the original — and waits for COMPLETE. The agent's part is to sequence the handoff
and say what to expect, not to issue the call; the user takes the command from the AWS documentation.
Two things worth telling them up front, so a normal result is not read as a failure:
The ingestion job's
numberOfMetadataDocumentsScannedcount is not a health signal: do not tell the customer to expect a particular value; metadata filtering works either way.An ingestion that ends
FAILEDhaving scanned 0 documents is an environment or pipeline issue, not a configuration problem — re-check access to the source before touching the config the agent created.
6. API error → cause → fix
| Error / message | Cause | Fix |
|---|---|---|
ThrottlingException / TooManyRequestsException / HTTP 429 on create-* / get-* | Control-plane request rate exceeded the account/Region quota (common when firing creates one-by-one, fast) | Slow down: batch creates and add a pause; back off with jitter and retry. Use the generated provisioning script's CONTROL_PLANE_RPS / batch settings (§9) rather than rapid sequential CLI calls |
ServiceQuotaExceededException on create-data-source | More data sources on one KB than its quota allows (L-F02D918A, read live) | Split the source set across multiple KBs |
ParamValidation: Unknown parameter ... managedKnowledgeBaseConfiguration (or "Invalid type ... valid values: VECTOR, ...", or unknown type MANAGED_KNOWLEDGE_BASE_CONNECTOR) | The AWS CLI model is too old to know the managed-KB shapes — rejected client-side | Upgrade to a current AWS CLI version (or use a current AWS SDK), then re-run the same command. AWS service calls go through the AWS CLI or an AWS SDK — if --generate-cli-skeleton confirms the shape is absent, upgrade the CLI/SDK rather than routing around it |
ValidationException on chunkingStrategy | DEFAULT/HIERARCHICAL/SEMANTIC on managed | Omit chunkingConfiguration to use the managed default chunking, or (custom embedding model only) pass FIXED_SIZE/NONE explicitly |
ValidationException: "A chunking strategy cannot be specified with a managed embedding model" | Any chunkingConfiguration (incl. FIXED_SIZE/NONE) on a KB using the managed embedding model | Omit chunkingConfiguration entirely; the managed default applies. A chunking config is accepted only with a custom embedding model (not stated in the user guide) |
"Unsupported data source type for MANAGED knowledge base type." | Top-level dataSourceConfiguration.type: CUSTOM (the self-managed shape) on a managed KB | The CUSTOM connector is supported — use type: MANAGED_KNOWLEDGE_BASE_CONNECTOR with connectorParameters.type: CUSTOM (§2d). No S3 staging required |
Rejection mentioning storageConfiguration | Sent a customer store to a managed KB | Omit storageConfiguration — managed provisions its own store |
"Unable to verify the specified embedding model" | Role can't invoke the model; unsupported model ARN; model not available in the KB's Region; or dims/dataType not the managed values | Use a supported FM/IP ARN available in-Region at the managed dimension and data type, and ensure the role can invoke it (§1) |
"MANAGED knowledge base type supports only 1024 embedding dimensions" | embeddingModelConfiguration...dimensions set to another value | Use the dimension the error and the create page name; re-embed a reduced-dimension source KB at it (§1) |
"MANAGED knowledge base type supports only FLOAT32 embedding data type" | embeddingDataType: BINARY (or non-FLOAT32) on managed | Use FLOAT32 or omit it; a BINARY source KB must be re-embedded as FLOAT32 (§1) |
"The specified embedding model ... is not supported" | Custom embeddingModelArn isn't one of the supported managed-KB embedding models, or that model isn't available in the KB's Region | Pick a supported model available in the KB's Region (§1 public doc links), or use embeddingModelType: MANAGED (default) |
| Connector ingests nothing (auth connector) | aclEnabled misconfigured or filters too narrow | For auth connectors set connectorParameters.aclEnabled intentionally; there is no managed crawlAcl |
retrieve 400 about vectorSearchConfiguration | Wrong wrapper on managed | Use managedSearchConfiguration |
Unknown parameter in retrievalConfiguration.managedSearchConfiguration: "overrideSearchType" | Ported a self-managed SEMANTIC call onto a managed KB | overrideSearchType exists only under vectorSearchConfiguration; the managed wrapper has no such member, so semantic-only is structurally inexpressible (§3). Drop the parameter |
Data source → FAILED, "Failed to connect to the URL of your data source" | Wrong/missing connectionConfiguration.secretArn, secret keys don't match the managed authType, SharePoint ENTRA_ID_APP_ONLY missing certificateS3Path, wrong region, or connector app not authorized | One diagnosis pass (§2b): confirm the secret keys match the managed authType, the certificate is present for Entra methods, the ARN/region are correct, and the KB role can read the secret (and certificate); then report and stop |
SharePoint data source ingests nothing / rejected on siteUrls | siteUrls passed as a string, not a JSON array | Pass siteUrls as a JSON array of full site URLs |
Value at 'dataEntityConfiguration' failed to satisfy constraint: Member must not be null on a Confluence create-data-source | dataEntityConfiguration omitted (the page marks it optional; the service requires it) | Send the block with the entity types the source crawled (§2b Confluence), then create the data source again |
Value at 'connectionConfiguration.hostUrl' failed to satisfy constraint on a Confluence create | hostUrl copied with a trailing slash, or not an .atlassian.net base URL | Use the base URL with no trailing slash |
AccessDeniedException reading the secret during sync | KB role lacks secretsmanager:GetSecretValue / kms:Decrypt | Grant those to the KB execution role on the secret (and its CMK) |
7. Client tokens (idempotency) — attach to mutating calls
Every resource-creating call the agent issues (create-knowledge-base, create-data-source) accepts a
--client-token idempotency token. Attach one to each such call so a safe retry of an
interrupted/uncertain call cannot create a duplicate resource — AWS returns the original result when it sees
the same token with the same parameters.
--client-tokenis an idempotency value, not authentication and not a credential or secret. It is safe to log, record, and reuse for a retry — it grants no access and unlocks nothing. It is also independent of--profile. The two answer different questions: the ephemeral profile or assumed-role credentials authenticate the caller — that is what a call needs to be allowed at all;--client-tokenmakes a create idempotent so a retry does not duplicate the resource. You use both together on a create: the credentials authenticate, the client token de-duplicates. Supplying AWS credentials does not remove the need for a client token, and a client token never authenticates a call. (Read/poll calls need only credentials — no client token; see below.) It is optional to the API on bothCreateKnowledgeBaseandCreateDataSource(§1/§2) — the current API references mark it optional on each — but required by this workflow, which attaches a stable per-operation token to every create for resume safety. Never call it API-required; either way it is an API idempotency input, never a secret.
One token per logical operation, derived from the plan, never random at run time — not one shared across calls. Use the form in implement-kb ("Use stable idempotency tokens"):
mig-<prefix>-<hash>-<seq>, minted at plan time from the migration id, resource type and planned name, so a re-run sends the same token. A client token must be at least 33 characters.Reuse a token only for a deliberate retry of the same operation (same params); changed params require a new token.
Read/poll calls carry NO client token.
get-knowledge-base,list-knowledge-bases,get-data-source,list-data-sources,get-ingestion-jobandsts get-caller-identitydo not accept one. Never invent a correlation token for a read.Record the client token alongside the operation and the resulting resource ID so the user can correlate a logged mutating call with the exact resource and safely re-issue it. The token is an input only — it never appears in a
get-*response, so capture it at call time.
clientToken field reference (confirm the current requirement and constraints before a call):
9. Rate limits & batching (build with a script, not rapid one-by-one CLI)
The build-time control-plane operations used here (CreateKnowledgeBase, CreateDataSource,
StartIngestionJob, and the Get*/List* pollers) are throttled per-account, per-Region, and most
limits are adjustable. Issuing many creates back-to-back on the CLI is the usual way to hit
ThrottlingException, which is why the Implement phase generates a Python provisioning script that
creates resources in rate-limit-aware batches (spec in
implement-kb).
What the script does to stay under the limits
Throttles control-plane calls to a conservative requests-per-second (
CONTROL_PLANE_RPS).Batches
create-data-sourcecalls (DATA_SOURCE_BATCH_SIZE) with anINTER_BATCH_PAUSE_SECONDScool-down between batches.Backs off on
ThrottlingException/429 with exponential delay + full jitter, on top of boto3'sadaptiveretry mode (Config(retries={"mode": "adaptive"})).Attaches a unique
--client-tokento every create (§7) so a retry after a throttle or timeout can't duplicate a resource.
Hard limit to design around
Data sources per KB (quota L-F02D918A, read live). The first CreateDataSource past it returns ServiceQuotaExceededException. Split a
larger source set across multiple KBs — the script's KNOWLEDGE_BASES is a list for exactly this.
Verify, don't hardcode
The script's defaults (CONTROL_PLANE_RPS, batch size, pause, concurrency) are conservative starting
points, not authoritative numbers. Re-check kb-managed-quotas
and the current per-Region values for the user's account in the Service Quotas console
(https://console.aws.amazon.com/servicequotas/home/services/bedrock/quotas; search the relevant
CreateDataSource / StartIngestionJob / CreateKnowledgeBase "requests per second" quotas) and lower the
rate if throttling appears. Never assert a quota you have not verified.
Running the script is gated
Writing the script is fine; running it requires explicit approval of that run. It defaults to
DRY_RUN = True (prints intended calls, mutates nothing); a real run needs --execute. It mutates owned
resources only, never the original KB, and provisions only — it does not ingest, so it manages no
ingestion-job concurrency. See implement-kb for the
build → review → preview → approve → execute → confirm-AVAILABLE flow.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs an API key, Needs Python
Security
What our scanner noticed· Medium risk
- References to credential files
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/core-skills/amazon-bedrock · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- aws/agent-toolkit-for-aws
AutoGineer is not affiliated with or endorsed by AWS or AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download amazon-bedrock.zip