[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-aws-agents-harden":3,"mdc-meqnn8-key":35,"related-org-aws-agents-harden":5559,"related-repo-aws-agents-harden":5721},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":33,"mdContent":34},"agents-harden","harden agents for production","Use when preparing your agent for production — IAM scoping, inbound auth (JWT, SigV4), secrets management, cold start optimization, session lifecycle, rate limiting, input validation, and quota guidance. Triggers on: \"production checklist\", \"harden agent\", \"production ready\", \"secure agent\", \"inbound auth\", \"going live\", \"cold start optimization\", \"session lifecycle\", \"StopRuntimeSession\", \"quota\", \"throttling\", \"maxVms\", \"rate limit\", \"security audit of outbound API calls\", \"gateway target audit for production\", \"restrict who can call\", \"lock down endpoint\", \"only our app can call\". Not for Cedar tool-restriction policies — use agents-connect. Not for quality measurement — use agents-optimize. Not for outbound credential storage or API key wiring — use agents-connect. Not for A2A agent-to-agent auth — use agents-build. Cold start observation and diagnosis (not optimization) routes to agents-debug.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"aws","AWS (Amazon)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Faws.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Security","security","tag",{"name":17,"slug":18,"type":15},"Best Practices","best-practices",{"name":20,"slug":21,"type":15},"Agents","agents",{"name":23,"slug":8,"type":15},"AWS",1822,"https:\u002F\u002Fgithub.com\u002Faws\u002Fagent-toolkit-for-aws","2026-07-16T06:00:42.174705",null,157,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":32},[],"Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS","https:\u002F\u002Fgithub.com\u002Faws\u002Fagent-toolkit-for-aws\u002Ftree\u002FHEAD\u002Fplugins\u002Faws-agents\u002Fskills\u002Fagents-harden","---\nname: agents-harden\ndescription: >\n  Use when preparing your agent for production — IAM scoping, inbound\n  auth (JWT, SigV4), secrets management, cold start optimization, session\n  lifecycle, rate limiting, input validation, and quota guidance. Triggers\n  on: \"production checklist\", \"harden agent\", \"production ready\", \"secure\n  agent\", \"inbound auth\", \"going live\", \"cold start optimization\", \"session\n  lifecycle\", \"StopRuntimeSession\", \"quota\", \"throttling\", \"maxVms\",\n  \"rate limit\", \"security audit of outbound API calls\", \"gateway target\n  audit for production\", \"restrict who can call\", \"lock down endpoint\",\n  \"only our app can call\".\n  Not for Cedar tool-restriction policies — use agents-connect. Not\n  for quality measurement — use agents-optimize. Not for outbound\n  credential storage or API key wiring — use agents-connect. Not for\n  A2A agent-to-agent auth — use agents-build. Cold start observation\n  and diagnosis (not optimization) routes to agents-debug.\nallowed-tools: Read Grep Glob Bash\nmetadata:\n  type: skill\n  version: \"1.0.0\"\n  author: aws-agentcore\n  requires-cli: \">=0.9.0\"\n---\n\n# harden\n\nPrepare your AgentCore agent for production — security, reliability, and performance.\n\n## When to use\n\n- You're about to take an agent to production\n- You want a checklist of what to review before launch\n- You want to restrict who can call your agent\n- You want to scope down IAM permissions from the defaults\n- You're hitting throttling or quota errors (loads [`references\u002Flimits.md`](references\u002Flimits.md))\n- You need to tune session lifecycle for your workload\n- You're running long-running background work in your agent\n\n## Input\n\nNo arguments required. The skill reads your project config and produces a checklist with specific findings for your project.\n\n## Process\n\n### Step 0: Verify CLI version\n\nRun `agentcore --version`. This skill requires v0.9.0 or later. If the version is older, tell the developer to run `agentcore update` before proceeding.\n\n### Step 1: Read the project\n\nRead `agentcore\u002Fagentcore.json` to understand:\n\n- What resources are configured (memory, gateway, credentials, evaluators)\n- What framework is being used\n- What network mode is configured (PUBLIC or VPC)\n\n### Step 2: Run through the checklist\n\nWork through each category and report findings specific to the project.\n\n---\n\n## IAM: Scope down permissions\n\nThe auto-created execution role has broad Bedrock access (`arn:aws:bedrock:*::foundation-model\u002F*`). For production, scope it to the specific models your agent uses.\n\n**Check the current execution role:**\n\n```bash\nagentcore status --json | jq -r '.runtimes[0].executionRoleArn'\n```\n\n**Recommended production Bedrock policy:**\n\n```json\n{\n  \"Effect\": \"Allow\",\n  \"Action\": [\n    \"bedrock:InvokeModel\",\n    \"bedrock:InvokeModelWithResponseStream\"\n  ],\n  \"Resource\": [\n    \"arn:aws:bedrock:\u003CREGION>::foundation-model\u002Fanthropic.claude-sonnet-4-5-20250929-v1:0\"\n  ]\n}\n```\n\nReplace the resource ARN with the specific model(s) your agent uses.\n\n**ECR access:** Scope to your specific repository:\n\n```json\n{\n  \"Effect\": \"Allow\",\n  \"Action\": [\"ecr:BatchGetImage\", \"ecr:GetDownloadUrlForLayer\"],\n  \"Resource\": \"arn:aws:ecr:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:repository\u002Fbedrock-agentcore-\u003CAGENT_NAME>-*\"\n}\n```\n\n**Trust policy:** Verify the execution role's trust policy is scoped to your account:\n\n```json\n{\n  \"Principal\": {\"Service\": \"bedrock-agentcore.amazonaws.com\"},\n  \"Action\": \"sts:AssumeRole\",\n  \"Condition\": {\n    \"StringEquals\": {\"aws:SourceAccount\": \"\u003CYOUR_ACCOUNT_ID>\"},\n    \"ArnLike\": {\"aws:SourceArn\": \"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:*\"}\n  }\n}\n```\n\n**Runtime resource-based policies** (API-only): For fine-grained control over which principals can invoke your runtime — beyond what IAM roles and JWT auth provide — use `PutAgentRuntimeResourcePolicy` via boto3. This is not exposed in the CLI or `agentcore.json`. Use the `awsknowledge` MCP server if available to look up the current API shape.\n\n---\n\n## Shell Access: Scope `InvokeAgentRuntimeCommand` separately\n\nIf your project uses `InvokeAgentRuntimeCommand` (see [`agents-build\u002Freferences\u002Fintegrate.md`](..\u002Fagents-build\u002Freferences\u002Fintegrate.md)), audit its IAM permissions separately from `InvokeAgentRuntime`. The two actions have different blast radii: `InvokeAgentRuntimeCommand` is arbitrary shell execution inside a live microVM with the runtime's full execution role — callers can read\u002Fwrite the filesystem, reach any network resource the agent can reach, and access the execution role's credentials.\n\n**Check which principals have the permission:**\n\n```bash\n# List customer-managed policies in your account, then inspect each for InvokeAgentRuntimeCommand\naws iam list-policies --scope Local \\\n  --query 'Policies[*].[PolicyName, Arn, DefaultVersionId]' \\\n  --output table\n# Then for each policy of interest:\naws iam get-policy-version \\\n  --policy-arn \u003CPOLICY_ARN> \\\n  --version-id \u003CVERSION_ID> \\\n  --query 'PolicyVersion.Document'\n```\n\nAlternatively, use the IAM console: **IAM → Policies → Filter by type: Customer managed** → search for `InvokeAgentRuntimeCommand` in the policy JSON editor.\n\n**Separate IAM policy for command callers** — keep this distinct from the policy granting `InvokeAgentRuntime`:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Effect\": \"Allow\",\n    \"Action\": \"bedrock-agentcore:InvokeAgentRuntimeCommand\",\n    \"Resource\": \"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:runtime\u002F\u003CRUNTIME_NAME>-*\"\n  }]\n}\n```\n\n**Enable CloudTrail alerting.** Create an EventBridge rule to notify your security team when `InvokeAgentRuntimeCommand` is called:\n\n```bash\naws events put-rule \\\n  --name AgentCoreCommandExecution \\\n  --event-pattern '{\"source\":[\"aws.bedrock-agentcore\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"eventName\":[\"InvokeAgentRuntimeCommand\"]}}' \\\n  --state ENABLED\n```\n\n**If commands are constructed from user input anywhere in calling code:** validate before passing — reject strings containing `&&`, `;`, `$(...)`, backticks, `|`, or other shell metacharacters.\n\n---\n\n## Inbound auth: Control who can call your agent\n\nBy default, agents use AWS IAM (SigV4) for inbound auth. For production, verify this is configured correctly.\n\n**Check current auth config:**\n\n```bash\nagentcore status --runtime \u003CAgentName> --json | jq '.runtimes[0].authorizerConfig'\n```\n\n**Options:**\n\n`AWS_IAM` (default) — callers must sign requests with SigV4. Good for internal services and AWS-native clients.\n\n`CUSTOM_JWT` — callers present a JWT from your identity provider. Good for web\u002Fmobile apps and external clients.\n\n```bash\nagentcore add agent \\\n  --name MyAgent \\\n  --authorizer-type CUSTOM_JWT \\\n  --discovery-url https:\u002F\u002Fyour-idp.example.com\u002F.well-known\u002Fopenid-configuration \\\n  --allowed-audience my-api \\\n  --allowed-clients my-client-id\n```\n\n> [!WARNING]\n> Never use `--authorizer-type NONE` in production. It allows unauthenticated access\n> to your agent — anyone with the endpoint URL can invoke it. Always use AWS_IAM or\n> CUSTOM_JWT. If you see NONE in production, change it immediately.\n\n### Choosing `allowedClients` vs `allowedAudience`\n\nThis is the most common JWT misconfiguration. The right choice depends on what's inside the token your IdP issues.\n\n**Decode a sample token** (at your IdP or with `jwt.io`) and look at the payload:\n\n- Token has a `client_id` claim, no `aud` claim → configure **`allowedClients`** on the runtime\n- Token has an `aud` claim → configure **`allowedAudience`** on the runtime\n- Token has both → use `allowedAudience`. The `aud` claim is the standard OIDC audience field; use that as the primary check.\n\nIf you pick the wrong one, invocations return 403 even with a valid token — the runtime is validating against a claim the token doesn't have.\n\n### Issuer ↔ discovery URL prefix requirement\n\nAgentCore enforces the OIDC discovery spec (RFC 8414 §3): the `issuer` value in the discovery document must be a URL prefix of the discovery endpoint.\n\nThat means if your discovery URL is `https:\u002F\u002Fqa.example.com\u002F.well-known\u002Fopenid-configuration`, the `issuer` field in that document must start with `https:\u002F\u002Fqa.example.com`. If the document advertises an issuer like `https:\u002F\u002Fexample.com` (no subdomain), validation fails.\n\nSome enterprise IdPs (PingFederate, Paylocity, some Keycloak setups) host the discovery endpoint on an environment-specific subdomain while advertising a production-level issuer. This pattern is incompatible with the RFC 8414 prefix rule.\n\nFix options:\n\n1. **Align the IdP's discovery endpoint with its issuer** — serve discovery from the same origin as the issuer.\n2. **Point the runtime at the actual discovery URL domain** — configure the runtime's discovery URL with the subdomain that matches the token's issuer.\n\n### Debugging JWT auth failures\n\nWhen invocations fail with 403, narrow down which check is failing.\n\n**`Authorization method mismatch`** — the runtime's auth type and the request's auth type don't match. Two cases:\n\n- The runtime is configured for `AWS_IAM` (or no authorizer) but the caller is sending a Bearer token → reconfigure the runtime for `CUSTOM_JWT`, or have the caller use SigV4.\n- The runtime is configured for `CUSTOM_JWT` but the caller's request is being SigV4-signed → likely the SDK or environment is injecting SigV4 headers alongside the Bearer token. Check for `X-Amz-Date`, `X-Amz-Security-Token`, or `Authorization: AWS4-HMAC-SHA256` in the outbound request. Remove the SigV4 path and send only the Bearer token.\n\n**`Invalid inbound token`** (or similar) — the token was rejected by the JWT validator. Walk through these in order:\n\n1. **Issuer ↔ discovery URL prefix** (above) — verify the token's `iss` claim matches the discovery URL's origin\n2. **`allowedClients` vs `allowedAudience`** — is the runtime configured for the right claim for your token format?\n3. **JWKS reachability** — can AgentCore reach the `jwks_uri` listed in the discovery document? It must be publicly reachable.\n4. **Token expired** — decode the token, check `exp` against now\n5. **Signing algorithm support** — some IdPs sign with algorithms (PS256, ES384, etc.) that aren't universally supported. Check your IdP's supported algorithms and switch to RS256 if compatibility is the issue.\n\nOnly after ruling all of those out should you treat it as a service-side issue.\n\n---\n\n## Error handling: Fail gracefully\n\nCheck that your agent code handles errors without exposing internal details:\n\n```python\nfrom bedrock_agentcore.runtime import BedrockAgentCoreApp\n\napp = BedrockAgentCoreApp()\n\n@app.entrypoint\ndef invoke(payload, context):\n    try:\n        # your agent logic\n        return {\"response\": result}\n    except Exception as e:\n        # Log the full error internally\n        app.logger.error(f\"Agent error: {e}\", exc_info=True)\n        # Return a safe message to the caller\n        return {\"error\": \"An error occurred. Please try again.\"}\n\nif __name__ == \"__main__\":\n    app.run()\n```\n\n**Check for:** bare `except` blocks that swallow errors silently, error messages that expose stack traces or internal details to callers, missing error handling in tool call code.\n\n---\n\n## Input validation and rate limiting\n\nAgent entrypoints receive arbitrary payloads from callers. Validate inputs before processing:\n\n```python\n@app.entrypoint\ndef invoke(payload, context):\n    prompt = payload.get(\"prompt\", \"\")\n\n    # Validate input\n    if not prompt or not isinstance(prompt, str):\n        return {\"error\": \"Missing or invalid 'prompt' field\"}\n    if len(prompt) > 10000:\n        return {\"error\": \"Prompt exceeds maximum length (10,000 characters)\"}\n\n    # Sanitize — strip control characters, excessive whitespace\n    prompt = \" \".join(prompt.split())\n\n    # Proceed with validated input\n    result = agent(prompt)\n    return {\"response\": str(result)}\n```\n\n**What to validate:**\n\n- Required fields are present and have the expected type\n- String inputs don't exceed reasonable length limits (prevents token-bombing the model)\n- Numeric inputs are within expected ranges\n- User-provided IDs (actor_id, session_id) match expected formats\n\n**Rate limiting:** AgentCore Runtime has built-in invocation rate limits (default 25 TPS per agent — see [`references\u002Flimits.md`](references\u002Flimits.md)). For application-level rate limiting (per-user, per-tenant), implement it in your calling application or API Gateway layer, not in the agent code itself. The agent should assume it's already been rate-limited by the time a request reaches it.\n\n---\n\n## Secrets: No credentials in code, no secrets in runtime env vars\n\nTwo failure modes to check for:\n\n### 1. Hardcoded secrets in agent code\n\n```bash\n# Search for common secret patterns in agent code\ngrep -r \"sk-\\|api_key\\s*=\\s*['\\\"]\" app\u002F --include=\"*.py\"\ngrep -r \"password\\s*=\\s*['\\\"]\" app\u002F --include=\"*.py\"\n```\n\n### 2. Secrets pulled from runtime environment variables\n\nAgentCore Runtime environment variables are **not** vault-backed. Anything a developer stuffs into the runtime's env (via CDK, boto3 `UpdateAgentRuntime`, or similar) is a plaintext config value, not a secret. Audit for the pattern:\n\n```bash\n# Flag any os.getenv \u002F os.environ call whose name implies a secret\ngrep -rE \"os\\.(getenv|environ).*(TOKEN|SECRET|KEY|PASSWORD|CREDENTIAL)\" app\u002F --include=\"*.py\"\n```\n\nNon-secret identifiers injected by the platform are fine and should not match an allowlist (e.g., `MEMORY_*_ID`, `AGENTCORE_GATEWAY_*_URL`, `AWS_REGION`, downstream agent ARNs). Review hits and confirm none are secrets.\n\n**Correct pattern:** Register each outbound credential with `agentcore add credential`, then fetch it in code via the integrated credential providers:\n\n```python\nfrom bedrock_agentcore.identity.auth import requires_api_key, requires_access_token\n\n@requires_api_key(provider_name=\"MyAPI\")\ndef call_api(payload: dict, *, api_key: str) -> dict:\n    ...\n\n@requires_access_token(provider_name=\"MyOAuthProvider\", scopes=[\"read\"], auth_flow=\"M2M\")\nasync def call_downstream(data: dict, *, access_token: str) -> dict:\n    ...\n```\n\nThe decorator fetches from Secrets Manager at call time and handles caching\u002Frefresh. Credentials registered this way are encrypted at rest and rotated without a redeploy.\n\n**Local dev:** `agentcore\u002F.env.local` (gitignored) is read by `agentcore dev` so the decorator resolves locally. This file is **not** uploaded to runtime on deploy — production credentials live in the credential provider.\n\n---\n\n## Tool surface: Prefer Gateway targets over direct HTTP in agent code\n\nA related audit — for every external service the agent calls, ask whether it should be a Gateway target instead of a direct HTTP call buried in agent code. Gateway's credential providers inject auth at the edge (so the agent process never sees the secret), the tool catalog is policy-enforceable, and a leaked traceback\u002Flog line from agent code can't exfiltrate credentials that never reached it.\n\n```bash\n# Find direct outbound HTTP calls in agent code\ngrep -rEn 'httpx\\.|requests\\.|aiohttp\\.' app\u002F --include=\"*.py\"\n```\n\nFor each hit, decide:\n\n| Hit looks like | Action |\n|---|---|\n| Calls an external REST API the agent treats as a tool | Front as a Gateway target (`agentcore add gateway-target --type open-api-schema` or `api-gateway`). Load [`agents-connect\u002FSKILL.md`](..\u002Fagents-connect\u002FSKILL.md) Path C. |\n| Calls an MCP server directly | Front as a Gateway target (`--type mcp-server`). Load [`agents-connect\u002FSKILL.md`](..\u002Fagents-connect\u002FSKILL.md) Path A. |\n| Calls an AWS service (S3, DynamoDB, etc.) — not appropriate to match this row, should be `boto3` | Migrate from `requests`\u002F`httpx` to the `boto3` client, using the runtime's execution role for IAM. No credential needed. |\n| Calls a streaming service (SSE-with-live-output, WebSocket, WebRTC) | OK to keep direct — Gateway doesn't front these yet. Confirm any auth uses `@requires_*`, not `os.getenv`. |\n| Calls another agent via A2A | OK to keep direct — A2A is HTTP-by-design. Confirm it uses `@requires_access_token` for the bearer token. |\n| Calls a measured latency hot path and the team chose it | OK, but confirm measurement exists and auth uses `@requires_*`. |\n\nIf the hit fits none of the \"OK to keep direct\" rows, open a ticket to convert it to a Gateway target. Gateway targets can be added without a code change in the agent for most framework integrations (MCP tool discovery handles binding).\n\n---\n\n## Observability: Verify tracing is enabled\n\nAgentCore enables X-Ray tracing and CloudWatch logging automatically. Verify:\n\n```bash\nagentcore status --runtime \u003CAgentName> --json | jq '.runtimes[0].observabilityConfig'\n```\n\n**CloudWatch dashboard:** AWS Console → CloudWatch → GenAI Observability → Bedrock AgentCore\n\n**Log retention:** By default, logs are retained indefinitely. Set a retention policy for cost control:\n\n```bash\naws logs put-retention-policy \\\n  --log-group-name \u002Faws\u002Fbedrock-agentcore\u002Fruntimes\u002F\u003CAGENT_ID>-DEFAULT \\\n  --retention-in-days 30\n```\n\n---\n\n## Evaluation baseline: Know your quality before launch\n\nBefore going to production, establish a quality baseline so you can detect regressions:\n\n```bash\n# Run a baseline eval\nagentcore run eval \\\n  --evaluator \"Builtin.Helpfulness\" \\\n  --evaluator \"Builtin.GoalSuccessRate\"\n\n# Set up continuous monitoring\nagentcore add online-eval \\\n  --name production_monitor \\\n  --runtime \u003CAgentName> \\\n  --evaluator \"Builtin.Helpfulness\" \\\n  --sampling-rate 5\nagentcore deploy -y\n```\n\nRecord the baseline scores. If scores drop significantly after a change, investigate before continuing.\n\n---\n\n## Network: VPC for private resources\n\nIf your agent accesses private AWS resources (RDS, internal APIs), configure VPC:\n\n```bash\nagentcore add agent \\\n  --name MyAgent \\\n  --network-mode VPC \\\n  --subnets subnet-abc,subnet-def \\\n  --security-groups sg-123\n```\n\nSee `agents-build` (loads [`references\u002Fvpc.md`](..\u002Fagents-build\u002Freferences\u002Fvpc.md)) for full VPC configuration guidance.\n\n---\n\n## Initialization time: Optimize cold start performance\n\nSlow agent initialization causes timeouts, 424 errors, and poor user experience — especially on first invocation after a period of inactivity. Everything the agent does before it's ready to handle a request adds to the time users wait.\n\n### Where cold start time actually goes\n\nA typical cold start for a new environment takes around 20–30 seconds. The breakdown, roughly:\n\n- **Container image pull** — dominates for Container builds. A 100 MB image takes a few seconds; a 500 MB image can take 15+ seconds.\n- **Application startup** — your code's import time, framework init, module-level setup. Usually 5–10 seconds, can be much more if you're loading models or opening connections at import.\n- **Platform overhead** (microVM boot, network attach, container start) — sub-second to a couple of seconds.\n\nThe two you control are image size and application startup. Optimizing either one directly reduces time to first response.\n\n### Session reuse is the highest-leverage optimization\n\nSame-session requests route to an existing initialized environment — no cold start. The first request per session pays the cold-start cost; every subsequent request on that session is fast.\n\nConcrete patterns:\n\n- **Multi-turn conversations:** reuse the same `session_id` across turns. Don't generate a new UUID per turn.\n- **Batch processing:** reuse the same `session_id` across items in the batch.\n- **User-facing apps:** scope a session to a user interaction (e.g., one session per chat conversation), not one session per message.\n\nCross-SDK note: if you're using MCP, pass **one** session identifier, not both `runtimeSessionId` and `mcpSessionId` at once. Sending both can cause the platform to bind two separate environments to the same logical session, doubling cold-start cost.\n\n### Package size budget\n\nEvery MB of deployment package adds to cold-start time.\n\n- **Target:** under 200 MB. Aim for under 100 MB if you can.\n- **For Container builds:** multi-stage Dockerfiles, slim or distroless base images, remove build tools and test files, add a `.dockerignore`.\n- **For CodeZip builds:** prune dev dependencies from `pyproject.toml` \u002F `requirements.txt`. Don't ship `tests\u002F`, `docs\u002F`, `.git\u002F`, local caches.\n- **Audit regularly:** `pip list` (Python) or `npm ls` (Node) will show you what's actually installed. Remove anything you're not using.\n\n### Defer heavy initialization\n\nDon't load large models, connect to databases, or initialize MCP clients at module import time. Every second spent in module import is a second the agent can't respond to requests.\n\n```python\n# ❌ Slow — runs at import time, before the agent can handle requests\nimport heavy_library\nclient = heavy_library.Client(config)\n\n# ✅ Fast — defers until first request\n_client = None\ndef get_client():\n    global _client\n    if _client is None:\n        import heavy_library\n        _client = heavy_library.Client(config)\n    return _client\n```\n\n### Choose deployment type based on traffic pattern, not by default\n\nThe skill previously recommended CodeZip over Container when possible. That's an oversimplification. Here's the real trade-off:\n\n- **CodeZip:** simpler to iterate on, smaller surface area. Cold start includes code download + extract — a ~95 MB package adds around 1.3 seconds of platform download before application startup even begins.\n- **Container:** you control the full image, needed for custom system dependencies. Larger images cost more per cold start, but you can optimize aggressively with multi-stage builds.\n\nNeither wins universally. Both benefit the same way from session reuse and from keeping the package small. If your traffic pattern has lots of bursty cold sessions, invest in shrinking whichever deployment artifact you're using. If your traffic pattern reuses sessions, the deployment type matters much less.\n\n### For Lambda targets behind Gateway\n\nUse provisioned concurrency on the Lambda function to eliminate Lambda cold starts. This is separate from Runtime initialization — it's the Lambda itself that adds latency on first invocation of a cold Lambda.\n\n---\n\n## Session lifecycle management\n\nSession management is tightly linked to cost, performance, and the `maxVms` quota. Getting this right is often the difference between a smooth production launch and a quota-blocked one.\n\n### The default lifecycle\n\nWhen a request arrives with a new session ID, the runtime initializes a fresh environment for it. That environment stays alive until one of:\n\n1. **The session is explicitly stopped** via `StopRuntimeSession`.\n2. **The idle timeout expires.** The runtime reclaims environments that haven't received a request for `idleRuntimeSessionTimeout` (default 900 seconds).\n3. **The maximum lifetime is reached** (`maxLifetime`, default 8 hours).\n\nIdle environments count against your `maxVms` quota until they're reclaimed, even though they're not serving traffic. This is the #1 cause of unexpected `maxVms` errors.\n\n### Pick timeouts by workload shape\n\nDon't leave defaults for production. Pick values that match how your workload actually uses sessions:\n\n| Workload | `idleRuntimeSessionTimeout` | `maxLifetime` | Reasoning |\n|---|---|---|---|\n| Interactive chat \u002F support agent | 600–900s (default) | 3600–7200s | Users pause to read\u002Fthink. Reclaim fast after they leave. |\n| Request\u002Freply API with no follow-up | 60–120s | 1800s | Each call is self-contained — release the VM quickly. |\n| Batch processing, one session per job | 120s | match job length + buffer | Idle gap between items in the batch is small; reclaim aggressively between jobs. |\n| Background \u002F long-running tasks (use `add_async_task`) | 120–300s | up to 28800s (8h) | Async task API keeps the VM alive during tracked work; idle timeout applies between tasks. |\n\n**Trade-offs at a glance:**\n\n- **Low idle timeout** = more headroom under `maxVms`, lower cost. **Risk:** reclaim mid-conversation causing next turn to cold-start.\n- **High idle timeout** = warm turns, lower latency. **Risk:** idle VMs consume quota; `maxVms` errors on bursts.\n- **Low max lifetime** = predictable recycle, bounds memory leaks \u002F stale state. **Risk:** active long sessions get killed mid-flow.\n- **High max lifetime** = sticky sessions, big warm-state savings. **Risk:** drift, stale in-memory state, harder rollouts.\n\n### Best practices\n\n**Call `StopRuntimeSession` when the work is done.** If your agent finishes a task and doesn't expect more requests on that session, explicitly stop it. This releases the environment immediately instead of waiting for idle timeout.\n\n```python\n# After your invocation logic completes and you know the session is done:\nclient.stop_runtime_session(\n    agentRuntimeArn=runtime_arn,\n    runtimeSessionId=session_id,\n)\n```\n\n**Reuse session IDs for related work.** A new session ID for every HTTP request means a new environment for every HTTP request. For multi-turn conversations, batch jobs, or user-facing interactions, use one session ID per conversation\u002Fbatch\u002Fuser-interaction and route all related requests to it.\n\n**Tune `idleRuntimeSessionTimeout` to your workload.** The default 900 seconds is appropriate for interactive workloads where you expect quick follow-up requests. For request-reply workloads where sessions are short-lived, lower it.\n\nEdit the runtime's entry in `agentcore\u002Fagentcore.json`:\n\n```json\n{\n  \"runtimes\": [\n    {\n      \"name\": \"MyAgent\",\n      \"lifecycleConfiguration\": {\n        \"idleRuntimeSessionTimeout\": 120,\n        \"maxLifetime\": 3600\n      }\n    }\n  ]\n}\n```\n\nThen `agentcore deploy` to apply. The CLI and CDK handle the underlying `UpdateAgentRuntime` call for you.\n\nIf you prefer the CLI, `agentcore add agent ... --idle-timeout 120 --max-lifetime 3600` writes the same fields into `agentcore.json`. The file is the source of truth — every field in it has IDE autocomplete via the `$schema` URL at the top of the file (`https:\u002F\u002Fschema.agentcore.aws.dev\u002Fv1\u002Fagentcore.json`).\n\nLower timeout = faster VM reclamation = more headroom under `maxVms`. Too low = environments get reclaimed mid-conversation, causing the next turn to cold-start.\n\n**Don't pass both `runtimeSessionId` and `mcpSessionId` together.** For MCP agents, use one. Passing both can bind two separate VMs to the same logical session.\n\n### Diagnosing `maxVms` problems\n\nIf you hit `ServiceQuotaExceededException: maxVms limit exceeded`, don't request a quota increase first. CloudWatch's concurrent-sessions metric is not the same as live VM count — idle environments count against the quota until reclaimed.\n\nWork through this order:\n\n1. Add `StopRuntimeSession` after each logical request completes\n2. Audit session-ID generation — are you creating a new ID per request that should reuse one?\n3. Lower `idleRuntimeSessionTimeout` if your sessions are short-lived\n4. Only then, if you've done all of the above and still hit the limit, request an increase\n\nSee [`references\u002Flimits.md`](references\u002Flimits.md) for the increase-request workflow (via the Service Quotas console) and the justification template.\n\n---\n\n## Long-running background tasks\n\nIf your agent fires off work that outlives the `\u002Finvocations` response — background processing, async jobs, long tool chains — a fire-and-forget pattern isn't enough. The environment can be reclaimed at `idleRuntimeSessionTimeout` even while your background task is still running, because the runtime considers the session idle once the invocation response is sent.\n\n### Use the SDK's async task API to signal \"still busy\"\n\nThe bedrock-agentcore SDK provides task registration that keeps the environment alive while tracked work runs. In Python:\n\n```python\nfrom bedrock_agentcore.runtime import BedrockAgentCoreApp\n\napp = BedrockAgentCoreApp()\n\n@app.entrypoint\ndef invoke(payload, context):\n    # Register the task BEFORE starting it\n    task_id = app.add_async_task(\"background_work\")\n\n    # Kick off the work (in a thread, asyncio, etc.)\n    start_background_work(task_id, payload)\n\n    # Return the invocation response — the task is still tracked\n    return {\"status\": \"processing\", \"taskId\": task_id}\n\n\ndef start_background_work(task_id, payload):\n    try:\n        # Long-running work here\n        do_the_work(payload)\n    finally:\n        # Mark the task complete when done — this releases the \"busy\" signal\n        app.complete_async_task(task_id)\n\nif __name__ == \"__main__\":\n    app.run()\n```\n\nWhile at least one registered task is active, the runtime sees the environment as busy and doesn't reclaim it at `idleRuntimeSessionTimeout`. `maxLifetime` (default 8 hours) still applies as a hard ceiling.\n\nCheck the bedrock-agentcore SDK docs for your language for the equivalent API — the TypeScript SDK has an analogous pattern.\n\n### Alternatives when async task API isn't an option\n\n- **Increase `idleRuntimeSessionTimeout` to match your expected task duration.** If you know tasks run up to 10 minutes, set the timeout to 12 minutes. Keep it well under `maxLifetime`.\n- **Keep the HTTP connection open** with a streaming response and emit periodic heartbeat events. Useful when you want the caller to wait for the result rather than polling. See the SSE keepalive pattern in [`agents-debug\u002FSKILL.md`](..\u002Fagents-debug\u002FSKILL.md) (\"Connection drops mid-stream\" section).\n- **Split long work across multiple invocations** on the same session. Each invocation resets the idle clock.\n\n---\n\n## Quotas and limits\n\nIf you're hitting throttling, `ServiceQuotaExceededException`, or any other quota-related error — or you're about to launch and want to make sure quotas won't block you — load [`references\u002Flimits.md`](references\u002Flimits.md).\n\nThat reference covers:\n\n- Which quota each error maps to\n- Mitigations to try before requesting an increase (critical — most \"quota\" errors are actually session-lifecycle issues)\n- How to request an increase through the Service Quotas console (the edge case where a direct Support case is needed is rare)\n- A copy-paste justification template with everything a reviewer needs to approve\n\n---\n\n## Production checklist summary\n\nGenerate a checklist specific to the project:\n\n```\nProduction Readiness Checklist for \u003CAgentName>\n\nIAM\n[ ] Execution role Bedrock access scoped to specific model ARNs\n[ ] ECR access scoped to specific repository\n[ ] Trust policy scoped to your account ID\n\nAuthentication\n[ ] Inbound auth is AWS_IAM or CUSTOM_JWT (not NONE)\n[ ] If CUSTOM_JWT: discovery URL, audience, and client IDs configured\n\nShell Access (if using InvokeAgentRuntimeCommand)\n[ ] InvokeAgentRuntimeCommand permission granted only to identities that need it\n[ ] Separate IAM policy from InvokeAgentRuntime policy\n[ ] CloudTrail \u002F EventBridge alert configured for InvokeAgentRuntimeCommand calls\n[ ] If commands constructed from user input: shell injection validation implemented\n\nCode quality\n[ ] Error handling wraps all agent logic\n[ ] Input validation on payload fields (type, length, format)\n[ ] No secrets hardcoded in agent code\n[ ] Credentials registered via agentcore add credential\n\nObservability\n[ ] X-Ray tracing enabled (auto-configured)\n[ ] CloudWatch log retention policy set\n[ ] Eval baseline established\n\nPerformance\n[ ] Agent initialization time measured and optimized\n[ ] Deployment package size under 200 MB (target under 100 MB)\n[ ] Dependencies audited — no unused packages\n[ ] Heavy initialization deferred to request time\n[ ] Session reuse strategy chosen for multi-turn \u002F batch workloads\n[ ] `StopRuntimeSession` called after work completes where applicable\n[ ] `idleRuntimeSessionTimeout` tuned to workload (default 900s)\n[ ] For long-running background tasks: `add_async_task` \u002F `complete_async_task` used\n\nResources\n[ ] Memory strategies appropriate for use case (if using memory)\n[ ] Gateway auth configured (if using gateway)\n[ ] Policy engine attached (if restricting tool access)\n\nTesting\n[ ] Agent tested with production-representative inputs\n[ ] Error cases tested (tool failures, model errors)\n[ ] Memory cross-session tested (if using LTM)\n```\n\n## Output\n\n- Checklist with specific findings for the project\n- Specific commands to fix any issues found\n- Recommended IAM policy for the detected model and resources\n",{"data":36,"body":43},{"name":4,"description":6,"allowed-tools":37,"metadata":38},"Read Grep Glob Bash",{"type":39,"version":40,"author":41,"requires-cli":42},"skill","1.0.0","aws-agentcore",">=0.9.0",{"type":44,"children":45},"root",[46,54,60,67,120,126,131,137,144,165,171,184,202,208,213,217,223,236,245,310,318,514,519,529,677,687,954,988,991,1005,1044,1052,1250,1269,1285,1479,1496,1579,1620,1623,1629,1634,1642,1708,1716,1727,1738,1846,1868,1888,1893,1911,1984,1989,1995,2008,2044,2049,2054,2078,2084,2089,2103,2159,2173,2259,2264,2267,2273,2278,2429,2447,2450,2456,2461,2591,2599,2622,2642,2645,2651,2656,2662,2787,2793,2813,2873,2900,2918,2994,2999,3031,3034,3040,3045,3105,3110,3318,3323,3326,3332,3337,3400,3410,3420,3501,3504,3510,3515,3728,3733,3736,3742,3747,3835,3860,3863,3869,3874,3880,3885,3918,3923,3929,3934,3939,3986,4014,4020,4025,4128,4134,4139,4241,4247,4252,4275,4280,4286,4291,4294,4300,4313,4319,4324,4380,4399,4405,4410,4547,4555,4637,4642,4659,4706,4716,4733,4744,4935,4955,4991,5003,5026,5039,5052,5057,5094,5108,5111,5117,5137,5143,5148,5358,5377,5382,5388,5446,5449,5455,5477,5482,5505,5508,5514,5519,5529,5535,5553],{"type":47,"tag":48,"props":49,"children":51},"element","h1",{"id":50},"harden",[52],{"type":53,"value":50},"text",{"type":47,"tag":55,"props":56,"children":57},"p",{},[58],{"type":53,"value":59},"Prepare your AgentCore agent for production — security, reliability, and performance.",{"type":47,"tag":61,"props":62,"children":64},"h2",{"id":63},"when-to-use",[65],{"type":53,"value":66},"When to use",{"type":47,"tag":68,"props":69,"children":70},"ul",{},[71,77,82,87,92,110,115],{"type":47,"tag":72,"props":73,"children":74},"li",{},[75],{"type":53,"value":76},"You're about to take an agent to production",{"type":47,"tag":72,"props":78,"children":79},{},[80],{"type":53,"value":81},"You want a checklist of what to review before launch",{"type":47,"tag":72,"props":83,"children":84},{},[85],{"type":53,"value":86},"You want to restrict who can call your agent",{"type":47,"tag":72,"props":88,"children":89},{},[90],{"type":53,"value":91},"You want to scope down IAM permissions from the defaults",{"type":47,"tag":72,"props":93,"children":94},{},[95,97,108],{"type":53,"value":96},"You're hitting throttling or quota errors (loads ",{"type":47,"tag":98,"props":99,"children":101},"a",{"href":100},"references\u002Flimits.md",[102],{"type":47,"tag":103,"props":104,"children":106},"code",{"className":105},[],[107],{"type":53,"value":100},{"type":53,"value":109},")",{"type":47,"tag":72,"props":111,"children":112},{},[113],{"type":53,"value":114},"You need to tune session lifecycle for your workload",{"type":47,"tag":72,"props":116,"children":117},{},[118],{"type":53,"value":119},"You're running long-running background work in your agent",{"type":47,"tag":61,"props":121,"children":123},{"id":122},"input",[124],{"type":53,"value":125},"Input",{"type":47,"tag":55,"props":127,"children":128},{},[129],{"type":53,"value":130},"No arguments required. The skill reads your project config and produces a checklist with specific findings for your project.",{"type":47,"tag":61,"props":132,"children":134},{"id":133},"process",[135],{"type":53,"value":136},"Process",{"type":47,"tag":138,"props":139,"children":141},"h3",{"id":140},"step-0-verify-cli-version",[142],{"type":53,"value":143},"Step 0: Verify CLI version",{"type":47,"tag":55,"props":145,"children":146},{},[147,149,155,157,163],{"type":53,"value":148},"Run ",{"type":47,"tag":103,"props":150,"children":152},{"className":151},[],[153],{"type":53,"value":154},"agentcore --version",{"type":53,"value":156},". This skill requires v0.9.0 or later. If the version is older, tell the developer to run ",{"type":47,"tag":103,"props":158,"children":160},{"className":159},[],[161],{"type":53,"value":162},"agentcore update",{"type":53,"value":164}," before proceeding.",{"type":47,"tag":138,"props":166,"children":168},{"id":167},"step-1-read-the-project",[169],{"type":53,"value":170},"Step 1: Read the project",{"type":47,"tag":55,"props":172,"children":173},{},[174,176,182],{"type":53,"value":175},"Read ",{"type":47,"tag":103,"props":177,"children":179},{"className":178},[],[180],{"type":53,"value":181},"agentcore\u002Fagentcore.json",{"type":53,"value":183}," to understand:",{"type":47,"tag":68,"props":185,"children":186},{},[187,192,197],{"type":47,"tag":72,"props":188,"children":189},{},[190],{"type":53,"value":191},"What resources are configured (memory, gateway, credentials, evaluators)",{"type":47,"tag":72,"props":193,"children":194},{},[195],{"type":53,"value":196},"What framework is being used",{"type":47,"tag":72,"props":198,"children":199},{},[200],{"type":53,"value":201},"What network mode is configured (PUBLIC or VPC)",{"type":47,"tag":138,"props":203,"children":205},{"id":204},"step-2-run-through-the-checklist",[206],{"type":53,"value":207},"Step 2: Run through the checklist",{"type":47,"tag":55,"props":209,"children":210},{},[211],{"type":53,"value":212},"Work through each category and report findings specific to the project.",{"type":47,"tag":214,"props":215,"children":216},"hr",{},[],{"type":47,"tag":61,"props":218,"children":220},{"id":219},"iam-scope-down-permissions",[221],{"type":53,"value":222},"IAM: Scope down permissions",{"type":47,"tag":55,"props":224,"children":225},{},[226,228,234],{"type":53,"value":227},"The auto-created execution role has broad Bedrock access (",{"type":47,"tag":103,"props":229,"children":231},{"className":230},[],[232],{"type":53,"value":233},"arn:aws:bedrock:*::foundation-model\u002F*",{"type":53,"value":235},"). For production, scope it to the specific models your agent uses.",{"type":47,"tag":55,"props":237,"children":238},{},[239],{"type":47,"tag":240,"props":241,"children":242},"strong",{},[243],{"type":53,"value":244},"Check the current execution role:",{"type":47,"tag":246,"props":247,"children":252},"pre",{"className":248,"code":249,"language":250,"meta":251,"style":251},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","agentcore status --json | jq -r '.runtimes[0].executionRoleArn'\n","bash","",[253],{"type":47,"tag":103,"props":254,"children":255},{"__ignoreMap":251},[256],{"type":47,"tag":257,"props":258,"children":261},"span",{"class":259,"line":260},"line",1,[262,268,274,279,285,290,295,300,305],{"type":47,"tag":257,"props":263,"children":265},{"style":264},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[266],{"type":53,"value":267},"agentcore",{"type":47,"tag":257,"props":269,"children":271},{"style":270},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[272],{"type":53,"value":273}," status",{"type":47,"tag":257,"props":275,"children":276},{"style":270},[277],{"type":53,"value":278}," --json",{"type":47,"tag":257,"props":280,"children":282},{"style":281},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[283],{"type":53,"value":284}," |",{"type":47,"tag":257,"props":286,"children":287},{"style":264},[288],{"type":53,"value":289}," jq",{"type":47,"tag":257,"props":291,"children":292},{"style":270},[293],{"type":53,"value":294}," -r",{"type":47,"tag":257,"props":296,"children":297},{"style":281},[298],{"type":53,"value":299}," '",{"type":47,"tag":257,"props":301,"children":302},{"style":270},[303],{"type":53,"value":304},".runtimes[0].executionRoleArn",{"type":47,"tag":257,"props":306,"children":307},{"style":281},[308],{"type":53,"value":309},"'\n",{"type":47,"tag":55,"props":311,"children":312},{},[313],{"type":47,"tag":240,"props":314,"children":315},{},[316],{"type":53,"value":317},"Recommended production Bedrock policy:",{"type":47,"tag":246,"props":319,"children":323},{"className":320,"code":321,"language":322,"meta":251,"style":251},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"Effect\": \"Allow\",\n  \"Action\": [\n    \"bedrock:InvokeModel\",\n    \"bedrock:InvokeModelWithResponseStream\"\n  ],\n  \"Resource\": [\n    \"arn:aws:bedrock:\u003CREGION>::foundation-model\u002Fanthropic.claude-sonnet-4-5-20250929-v1:0\"\n  ]\n}\n","json",[324],{"type":47,"tag":103,"props":325,"children":326},{"__ignoreMap":251},[327,335,379,405,427,445,454,479,496,505],{"type":47,"tag":257,"props":328,"children":329},{"class":259,"line":260},[330],{"type":47,"tag":257,"props":331,"children":332},{"style":281},[333],{"type":53,"value":334},"{\n",{"type":47,"tag":257,"props":336,"children":338},{"class":259,"line":337},2,[339,344,350,355,360,365,370,374],{"type":47,"tag":257,"props":340,"children":341},{"style":281},[342],{"type":53,"value":343},"  \"",{"type":47,"tag":257,"props":345,"children":347},{"style":346},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[348],{"type":53,"value":349},"Effect",{"type":47,"tag":257,"props":351,"children":352},{"style":281},[353],{"type":53,"value":354},"\"",{"type":47,"tag":257,"props":356,"children":357},{"style":281},[358],{"type":53,"value":359},":",{"type":47,"tag":257,"props":361,"children":362},{"style":281},[363],{"type":53,"value":364}," \"",{"type":47,"tag":257,"props":366,"children":367},{"style":270},[368],{"type":53,"value":369},"Allow",{"type":47,"tag":257,"props":371,"children":372},{"style":281},[373],{"type":53,"value":354},{"type":47,"tag":257,"props":375,"children":376},{"style":281},[377],{"type":53,"value":378},",\n",{"type":47,"tag":257,"props":380,"children":382},{"class":259,"line":381},3,[383,387,392,396,400],{"type":47,"tag":257,"props":384,"children":385},{"style":281},[386],{"type":53,"value":343},{"type":47,"tag":257,"props":388,"children":389},{"style":346},[390],{"type":53,"value":391},"Action",{"type":47,"tag":257,"props":393,"children":394},{"style":281},[395],{"type":53,"value":354},{"type":47,"tag":257,"props":397,"children":398},{"style":281},[399],{"type":53,"value":359},{"type":47,"tag":257,"props":401,"children":402},{"style":281},[403],{"type":53,"value":404}," [\n",{"type":47,"tag":257,"props":406,"children":408},{"class":259,"line":407},4,[409,414,419,423],{"type":47,"tag":257,"props":410,"children":411},{"style":281},[412],{"type":53,"value":413},"    \"",{"type":47,"tag":257,"props":415,"children":416},{"style":270},[417],{"type":53,"value":418},"bedrock:InvokeModel",{"type":47,"tag":257,"props":420,"children":421},{"style":281},[422],{"type":53,"value":354},{"type":47,"tag":257,"props":424,"children":425},{"style":281},[426],{"type":53,"value":378},{"type":47,"tag":257,"props":428,"children":430},{"class":259,"line":429},5,[431,435,440],{"type":47,"tag":257,"props":432,"children":433},{"style":281},[434],{"type":53,"value":413},{"type":47,"tag":257,"props":436,"children":437},{"style":270},[438],{"type":53,"value":439},"bedrock:InvokeModelWithResponseStream",{"type":47,"tag":257,"props":441,"children":442},{"style":281},[443],{"type":53,"value":444},"\"\n",{"type":47,"tag":257,"props":446,"children":448},{"class":259,"line":447},6,[449],{"type":47,"tag":257,"props":450,"children":451},{"style":281},[452],{"type":53,"value":453},"  ],\n",{"type":47,"tag":257,"props":455,"children":457},{"class":259,"line":456},7,[458,462,467,471,475],{"type":47,"tag":257,"props":459,"children":460},{"style":281},[461],{"type":53,"value":343},{"type":47,"tag":257,"props":463,"children":464},{"style":346},[465],{"type":53,"value":466},"Resource",{"type":47,"tag":257,"props":468,"children":469},{"style":281},[470],{"type":53,"value":354},{"type":47,"tag":257,"props":472,"children":473},{"style":281},[474],{"type":53,"value":359},{"type":47,"tag":257,"props":476,"children":477},{"style":281},[478],{"type":53,"value":404},{"type":47,"tag":257,"props":480,"children":482},{"class":259,"line":481},8,[483,487,492],{"type":47,"tag":257,"props":484,"children":485},{"style":281},[486],{"type":53,"value":413},{"type":47,"tag":257,"props":488,"children":489},{"style":270},[490],{"type":53,"value":491},"arn:aws:bedrock:\u003CREGION>::foundation-model\u002Fanthropic.claude-sonnet-4-5-20250929-v1:0",{"type":47,"tag":257,"props":493,"children":494},{"style":281},[495],{"type":53,"value":444},{"type":47,"tag":257,"props":497,"children":499},{"class":259,"line":498},9,[500],{"type":47,"tag":257,"props":501,"children":502},{"style":281},[503],{"type":53,"value":504},"  ]\n",{"type":47,"tag":257,"props":506,"children":508},{"class":259,"line":507},10,[509],{"type":47,"tag":257,"props":510,"children":511},{"style":281},[512],{"type":53,"value":513},"}\n",{"type":47,"tag":55,"props":515,"children":516},{},[517],{"type":53,"value":518},"Replace the resource ARN with the specific model(s) your agent uses.",{"type":47,"tag":55,"props":520,"children":521},{},[522,527],{"type":47,"tag":240,"props":523,"children":524},{},[525],{"type":53,"value":526},"ECR access:",{"type":53,"value":528}," Scope to your specific repository:",{"type":47,"tag":246,"props":530,"children":532},{"className":320,"code":531,"language":322,"meta":251,"style":251},"{\n  \"Effect\": \"Allow\",\n  \"Action\": [\"ecr:BatchGetImage\", \"ecr:GetDownloadUrlForLayer\"],\n  \"Resource\": \"arn:aws:ecr:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:repository\u002Fbedrock-agentcore-\u003CAGENT_NAME>-*\"\n}\n",[533],{"type":47,"tag":103,"props":534,"children":535},{"__ignoreMap":251},[536,543,578,638,670],{"type":47,"tag":257,"props":537,"children":538},{"class":259,"line":260},[539],{"type":47,"tag":257,"props":540,"children":541},{"style":281},[542],{"type":53,"value":334},{"type":47,"tag":257,"props":544,"children":545},{"class":259,"line":337},[546,550,554,558,562,566,570,574],{"type":47,"tag":257,"props":547,"children":548},{"style":281},[549],{"type":53,"value":343},{"type":47,"tag":257,"props":551,"children":552},{"style":346},[553],{"type":53,"value":349},{"type":47,"tag":257,"props":555,"children":556},{"style":281},[557],{"type":53,"value":354},{"type":47,"tag":257,"props":559,"children":560},{"style":281},[561],{"type":53,"value":359},{"type":47,"tag":257,"props":563,"children":564},{"style":281},[565],{"type":53,"value":364},{"type":47,"tag":257,"props":567,"children":568},{"style":270},[569],{"type":53,"value":369},{"type":47,"tag":257,"props":571,"children":572},{"style":281},[573],{"type":53,"value":354},{"type":47,"tag":257,"props":575,"children":576},{"style":281},[577],{"type":53,"value":378},{"type":47,"tag":257,"props":579,"children":580},{"class":259,"line":381},[581,585,589,593,597,602,606,611,615,620,624,629,633],{"type":47,"tag":257,"props":582,"children":583},{"style":281},[584],{"type":53,"value":343},{"type":47,"tag":257,"props":586,"children":587},{"style":346},[588],{"type":53,"value":391},{"type":47,"tag":257,"props":590,"children":591},{"style":281},[592],{"type":53,"value":354},{"type":47,"tag":257,"props":594,"children":595},{"style":281},[596],{"type":53,"value":359},{"type":47,"tag":257,"props":598,"children":599},{"style":281},[600],{"type":53,"value":601}," [",{"type":47,"tag":257,"props":603,"children":604},{"style":281},[605],{"type":53,"value":354},{"type":47,"tag":257,"props":607,"children":608},{"style":270},[609],{"type":53,"value":610},"ecr:BatchGetImage",{"type":47,"tag":257,"props":612,"children":613},{"style":281},[614],{"type":53,"value":354},{"type":47,"tag":257,"props":616,"children":617},{"style":281},[618],{"type":53,"value":619},",",{"type":47,"tag":257,"props":621,"children":622},{"style":281},[623],{"type":53,"value":364},{"type":47,"tag":257,"props":625,"children":626},{"style":270},[627],{"type":53,"value":628},"ecr:GetDownloadUrlForLayer",{"type":47,"tag":257,"props":630,"children":631},{"style":281},[632],{"type":53,"value":354},{"type":47,"tag":257,"props":634,"children":635},{"style":281},[636],{"type":53,"value":637},"],\n",{"type":47,"tag":257,"props":639,"children":640},{"class":259,"line":407},[641,645,649,653,657,661,666],{"type":47,"tag":257,"props":642,"children":643},{"style":281},[644],{"type":53,"value":343},{"type":47,"tag":257,"props":646,"children":647},{"style":346},[648],{"type":53,"value":466},{"type":47,"tag":257,"props":650,"children":651},{"style":281},[652],{"type":53,"value":354},{"type":47,"tag":257,"props":654,"children":655},{"style":281},[656],{"type":53,"value":359},{"type":47,"tag":257,"props":658,"children":659},{"style":281},[660],{"type":53,"value":364},{"type":47,"tag":257,"props":662,"children":663},{"style":270},[664],{"type":53,"value":665},"arn:aws:ecr:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:repository\u002Fbedrock-agentcore-\u003CAGENT_NAME>-*",{"type":47,"tag":257,"props":667,"children":668},{"style":281},[669],{"type":53,"value":444},{"type":47,"tag":257,"props":671,"children":672},{"class":259,"line":429},[673],{"type":47,"tag":257,"props":674,"children":675},{"style":281},[676],{"type":53,"value":513},{"type":47,"tag":55,"props":678,"children":679},{},[680,685],{"type":47,"tag":240,"props":681,"children":682},{},[683],{"type":53,"value":684},"Trust policy:",{"type":53,"value":686}," Verify the execution role's trust policy is scoped to your account:",{"type":47,"tag":246,"props":688,"children":690},{"className":320,"code":689,"language":322,"meta":251,"style":251},"{\n  \"Principal\": {\"Service\": \"bedrock-agentcore.amazonaws.com\"},\n  \"Action\": \"sts:AssumeRole\",\n  \"Condition\": {\n    \"StringEquals\": {\"aws:SourceAccount\": \"\u003CYOUR_ACCOUNT_ID>\"},\n    \"ArnLike\": {\"aws:SourceArn\": \"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:*\"}\n  }\n}\n",[691],{"type":47,"tag":103,"props":692,"children":693},{"__ignoreMap":251},[694,701,761,797,822,881,939,947],{"type":47,"tag":257,"props":695,"children":696},{"class":259,"line":260},[697],{"type":47,"tag":257,"props":698,"children":699},{"style":281},[700],{"type":53,"value":334},{"type":47,"tag":257,"props":702,"children":703},{"class":259,"line":337},[704,708,713,717,721,726,730,735,739,743,747,752,756],{"type":47,"tag":257,"props":705,"children":706},{"style":281},[707],{"type":53,"value":343},{"type":47,"tag":257,"props":709,"children":710},{"style":346},[711],{"type":53,"value":712},"Principal",{"type":47,"tag":257,"props":714,"children":715},{"style":281},[716],{"type":53,"value":354},{"type":47,"tag":257,"props":718,"children":719},{"style":281},[720],{"type":53,"value":359},{"type":47,"tag":257,"props":722,"children":723},{"style":281},[724],{"type":53,"value":725}," {",{"type":47,"tag":257,"props":727,"children":728},{"style":281},[729],{"type":53,"value":354},{"type":47,"tag":257,"props":731,"children":732},{"style":264},[733],{"type":53,"value":734},"Service",{"type":47,"tag":257,"props":736,"children":737},{"style":281},[738],{"type":53,"value":354},{"type":47,"tag":257,"props":740,"children":741},{"style":281},[742],{"type":53,"value":359},{"type":47,"tag":257,"props":744,"children":745},{"style":281},[746],{"type":53,"value":364},{"type":47,"tag":257,"props":748,"children":749},{"style":270},[750],{"type":53,"value":751},"bedrock-agentcore.amazonaws.com",{"type":47,"tag":257,"props":753,"children":754},{"style":281},[755],{"type":53,"value":354},{"type":47,"tag":257,"props":757,"children":758},{"style":281},[759],{"type":53,"value":760},"},\n",{"type":47,"tag":257,"props":762,"children":763},{"class":259,"line":381},[764,768,772,776,780,784,789,793],{"type":47,"tag":257,"props":765,"children":766},{"style":281},[767],{"type":53,"value":343},{"type":47,"tag":257,"props":769,"children":770},{"style":346},[771],{"type":53,"value":391},{"type":47,"tag":257,"props":773,"children":774},{"style":281},[775],{"type":53,"value":354},{"type":47,"tag":257,"props":777,"children":778},{"style":281},[779],{"type":53,"value":359},{"type":47,"tag":257,"props":781,"children":782},{"style":281},[783],{"type":53,"value":364},{"type":47,"tag":257,"props":785,"children":786},{"style":270},[787],{"type":53,"value":788},"sts:AssumeRole",{"type":47,"tag":257,"props":790,"children":791},{"style":281},[792],{"type":53,"value":354},{"type":47,"tag":257,"props":794,"children":795},{"style":281},[796],{"type":53,"value":378},{"type":47,"tag":257,"props":798,"children":799},{"class":259,"line":407},[800,804,809,813,817],{"type":47,"tag":257,"props":801,"children":802},{"style":281},[803],{"type":53,"value":343},{"type":47,"tag":257,"props":805,"children":806},{"style":346},[807],{"type":53,"value":808},"Condition",{"type":47,"tag":257,"props":810,"children":811},{"style":281},[812],{"type":53,"value":354},{"type":47,"tag":257,"props":814,"children":815},{"style":281},[816],{"type":53,"value":359},{"type":47,"tag":257,"props":818,"children":819},{"style":281},[820],{"type":53,"value":821}," {\n",{"type":47,"tag":257,"props":823,"children":824},{"class":259,"line":429},[825,829,834,838,842,846,850,856,860,864,868,873,877],{"type":47,"tag":257,"props":826,"children":827},{"style":281},[828],{"type":53,"value":413},{"type":47,"tag":257,"props":830,"children":831},{"style":264},[832],{"type":53,"value":833},"StringEquals",{"type":47,"tag":257,"props":835,"children":836},{"style":281},[837],{"type":53,"value":354},{"type":47,"tag":257,"props":839,"children":840},{"style":281},[841],{"type":53,"value":359},{"type":47,"tag":257,"props":843,"children":844},{"style":281},[845],{"type":53,"value":725},{"type":47,"tag":257,"props":847,"children":848},{"style":281},[849],{"type":53,"value":354},{"type":47,"tag":257,"props":851,"children":853},{"style":852},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[854],{"type":53,"value":855},"aws:SourceAccount",{"type":47,"tag":257,"props":857,"children":858},{"style":281},[859],{"type":53,"value":354},{"type":47,"tag":257,"props":861,"children":862},{"style":281},[863],{"type":53,"value":359},{"type":47,"tag":257,"props":865,"children":866},{"style":281},[867],{"type":53,"value":364},{"type":47,"tag":257,"props":869,"children":870},{"style":270},[871],{"type":53,"value":872},"\u003CYOUR_ACCOUNT_ID>",{"type":47,"tag":257,"props":874,"children":875},{"style":281},[876],{"type":53,"value":354},{"type":47,"tag":257,"props":878,"children":879},{"style":281},[880],{"type":53,"value":760},{"type":47,"tag":257,"props":882,"children":883},{"class":259,"line":447},[884,888,893,897,901,905,909,914,918,922,926,931,935],{"type":47,"tag":257,"props":885,"children":886},{"style":281},[887],{"type":53,"value":413},{"type":47,"tag":257,"props":889,"children":890},{"style":264},[891],{"type":53,"value":892},"ArnLike",{"type":47,"tag":257,"props":894,"children":895},{"style":281},[896],{"type":53,"value":354},{"type":47,"tag":257,"props":898,"children":899},{"style":281},[900],{"type":53,"value":359},{"type":47,"tag":257,"props":902,"children":903},{"style":281},[904],{"type":53,"value":725},{"type":47,"tag":257,"props":906,"children":907},{"style":281},[908],{"type":53,"value":354},{"type":47,"tag":257,"props":910,"children":911},{"style":852},[912],{"type":53,"value":913},"aws:SourceArn",{"type":47,"tag":257,"props":915,"children":916},{"style":281},[917],{"type":53,"value":354},{"type":47,"tag":257,"props":919,"children":920},{"style":281},[921],{"type":53,"value":359},{"type":47,"tag":257,"props":923,"children":924},{"style":281},[925],{"type":53,"value":364},{"type":47,"tag":257,"props":927,"children":928},{"style":270},[929],{"type":53,"value":930},"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:*",{"type":47,"tag":257,"props":932,"children":933},{"style":281},[934],{"type":53,"value":354},{"type":47,"tag":257,"props":936,"children":937},{"style":281},[938],{"type":53,"value":513},{"type":47,"tag":257,"props":940,"children":941},{"class":259,"line":456},[942],{"type":47,"tag":257,"props":943,"children":944},{"style":281},[945],{"type":53,"value":946},"  }\n",{"type":47,"tag":257,"props":948,"children":949},{"class":259,"line":481},[950],{"type":47,"tag":257,"props":951,"children":952},{"style":281},[953],{"type":53,"value":513},{"type":47,"tag":55,"props":955,"children":956},{},[957,962,964,970,972,978,980,986],{"type":47,"tag":240,"props":958,"children":959},{},[960],{"type":53,"value":961},"Runtime resource-based policies",{"type":53,"value":963}," (API-only): For fine-grained control over which principals can invoke your runtime — beyond what IAM roles and JWT auth provide — use ",{"type":47,"tag":103,"props":965,"children":967},{"className":966},[],[968],{"type":53,"value":969},"PutAgentRuntimeResourcePolicy",{"type":53,"value":971}," via boto3. This is not exposed in the CLI or ",{"type":47,"tag":103,"props":973,"children":975},{"className":974},[],[976],{"type":53,"value":977},"agentcore.json",{"type":53,"value":979},". Use the ",{"type":47,"tag":103,"props":981,"children":983},{"className":982},[],[984],{"type":53,"value":985},"awsknowledge",{"type":53,"value":987}," MCP server if available to look up the current API shape.",{"type":47,"tag":214,"props":989,"children":990},{},[],{"type":47,"tag":61,"props":992,"children":994},{"id":993},"shell-access-scope-invokeagentruntimecommand-separately",[995,997,1003],{"type":53,"value":996},"Shell Access: Scope ",{"type":47,"tag":103,"props":998,"children":1000},{"className":999},[],[1001],{"type":53,"value":1002},"InvokeAgentRuntimeCommand",{"type":53,"value":1004}," separately",{"type":47,"tag":55,"props":1006,"children":1007},{},[1008,1010,1015,1017,1027,1029,1035,1037,1042],{"type":53,"value":1009},"If your project uses ",{"type":47,"tag":103,"props":1011,"children":1013},{"className":1012},[],[1014],{"type":53,"value":1002},{"type":53,"value":1016}," (see ",{"type":47,"tag":98,"props":1018,"children":1020},{"href":1019},"..\u002Fagents-build\u002Freferences\u002Fintegrate.md",[1021],{"type":47,"tag":103,"props":1022,"children":1024},{"className":1023},[],[1025],{"type":53,"value":1026},"agents-build\u002Freferences\u002Fintegrate.md",{"type":53,"value":1028},"), audit its IAM permissions separately from ",{"type":47,"tag":103,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":53,"value":1034},"InvokeAgentRuntime",{"type":53,"value":1036},". The two actions have different blast radii: ",{"type":47,"tag":103,"props":1038,"children":1040},{"className":1039},[],[1041],{"type":53,"value":1002},{"type":53,"value":1043}," is arbitrary shell execution inside a live microVM with the runtime's full execution role — callers can read\u002Fwrite the filesystem, reach any network resource the agent can reach, and access the execution role's credentials.",{"type":47,"tag":55,"props":1045,"children":1046},{},[1047],{"type":47,"tag":240,"props":1048,"children":1049},{},[1050],{"type":53,"value":1051},"Check which principals have the permission:",{"type":47,"tag":246,"props":1053,"children":1055},{"className":248,"code":1054,"language":250,"meta":251,"style":251},"# List customer-managed policies in your account, then inspect each for InvokeAgentRuntimeCommand\naws iam list-policies --scope Local \\\n  --query 'Policies[*].[PolicyName, Arn, DefaultVersionId]' \\\n  --output table\n# Then for each policy of interest:\naws iam get-policy-version \\\n  --policy-arn \u003CPOLICY_ARN> \\\n  --version-id \u003CVERSION_ID> \\\n  --query 'PolicyVersion.Document'\n",[1056],{"type":47,"tag":103,"props":1057,"children":1058},{"__ignoreMap":251},[1059,1068,1101,1127,1140,1148,1168,1200,1230],{"type":47,"tag":257,"props":1060,"children":1061},{"class":259,"line":260},[1062],{"type":47,"tag":257,"props":1063,"children":1065},{"style":1064},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1066],{"type":53,"value":1067},"# List customer-managed policies in your account, then inspect each for InvokeAgentRuntimeCommand\n",{"type":47,"tag":257,"props":1069,"children":1070},{"class":259,"line":337},[1071,1075,1080,1085,1090,1095],{"type":47,"tag":257,"props":1072,"children":1073},{"style":264},[1074],{"type":53,"value":8},{"type":47,"tag":257,"props":1076,"children":1077},{"style":270},[1078],{"type":53,"value":1079}," iam",{"type":47,"tag":257,"props":1081,"children":1082},{"style":270},[1083],{"type":53,"value":1084}," list-policies",{"type":47,"tag":257,"props":1086,"children":1087},{"style":270},[1088],{"type":53,"value":1089}," --scope",{"type":47,"tag":257,"props":1091,"children":1092},{"style":270},[1093],{"type":53,"value":1094}," Local",{"type":47,"tag":257,"props":1096,"children":1098},{"style":1097},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[1099],{"type":53,"value":1100}," \\\n",{"type":47,"tag":257,"props":1102,"children":1103},{"class":259,"line":381},[1104,1109,1113,1118,1123],{"type":47,"tag":257,"props":1105,"children":1106},{"style":270},[1107],{"type":53,"value":1108},"  --query",{"type":47,"tag":257,"props":1110,"children":1111},{"style":281},[1112],{"type":53,"value":299},{"type":47,"tag":257,"props":1114,"children":1115},{"style":270},[1116],{"type":53,"value":1117},"Policies[*].[PolicyName, Arn, DefaultVersionId]",{"type":47,"tag":257,"props":1119,"children":1120},{"style":281},[1121],{"type":53,"value":1122},"'",{"type":47,"tag":257,"props":1124,"children":1125},{"style":1097},[1126],{"type":53,"value":1100},{"type":47,"tag":257,"props":1128,"children":1129},{"class":259,"line":407},[1130,1135],{"type":47,"tag":257,"props":1131,"children":1132},{"style":270},[1133],{"type":53,"value":1134},"  --output",{"type":47,"tag":257,"props":1136,"children":1137},{"style":270},[1138],{"type":53,"value":1139}," table\n",{"type":47,"tag":257,"props":1141,"children":1142},{"class":259,"line":429},[1143],{"type":47,"tag":257,"props":1144,"children":1145},{"style":1064},[1146],{"type":53,"value":1147},"# Then for each policy of interest:\n",{"type":47,"tag":257,"props":1149,"children":1150},{"class":259,"line":447},[1151,1155,1159,1164],{"type":47,"tag":257,"props":1152,"children":1153},{"style":264},[1154],{"type":53,"value":8},{"type":47,"tag":257,"props":1156,"children":1157},{"style":270},[1158],{"type":53,"value":1079},{"type":47,"tag":257,"props":1160,"children":1161},{"style":270},[1162],{"type":53,"value":1163}," get-policy-version",{"type":47,"tag":257,"props":1165,"children":1166},{"style":1097},[1167],{"type":53,"value":1100},{"type":47,"tag":257,"props":1169,"children":1170},{"class":259,"line":456},[1171,1176,1181,1186,1191,1196],{"type":47,"tag":257,"props":1172,"children":1173},{"style":270},[1174],{"type":53,"value":1175},"  --policy-arn",{"type":47,"tag":257,"props":1177,"children":1178},{"style":281},[1179],{"type":53,"value":1180}," \u003C",{"type":47,"tag":257,"props":1182,"children":1183},{"style":270},[1184],{"type":53,"value":1185},"POLICY_AR",{"type":47,"tag":257,"props":1187,"children":1188},{"style":1097},[1189],{"type":53,"value":1190},"N",{"type":47,"tag":257,"props":1192,"children":1193},{"style":281},[1194],{"type":53,"value":1195},">",{"type":47,"tag":257,"props":1197,"children":1198},{"style":1097},[1199],{"type":53,"value":1100},{"type":47,"tag":257,"props":1201,"children":1202},{"class":259,"line":481},[1203,1208,1212,1217,1222,1226],{"type":47,"tag":257,"props":1204,"children":1205},{"style":270},[1206],{"type":53,"value":1207},"  --version-id",{"type":47,"tag":257,"props":1209,"children":1210},{"style":281},[1211],{"type":53,"value":1180},{"type":47,"tag":257,"props":1213,"children":1214},{"style":270},[1215],{"type":53,"value":1216},"VERSION_I",{"type":47,"tag":257,"props":1218,"children":1219},{"style":1097},[1220],{"type":53,"value":1221},"D",{"type":47,"tag":257,"props":1223,"children":1224},{"style":281},[1225],{"type":53,"value":1195},{"type":47,"tag":257,"props":1227,"children":1228},{"style":1097},[1229],{"type":53,"value":1100},{"type":47,"tag":257,"props":1231,"children":1232},{"class":259,"line":498},[1233,1237,1241,1246],{"type":47,"tag":257,"props":1234,"children":1235},{"style":270},[1236],{"type":53,"value":1108},{"type":47,"tag":257,"props":1238,"children":1239},{"style":281},[1240],{"type":53,"value":299},{"type":47,"tag":257,"props":1242,"children":1243},{"style":270},[1244],{"type":53,"value":1245},"PolicyVersion.Document",{"type":47,"tag":257,"props":1247,"children":1248},{"style":281},[1249],{"type":53,"value":309},{"type":47,"tag":55,"props":1251,"children":1252},{},[1253,1255,1260,1262,1267],{"type":53,"value":1254},"Alternatively, use the IAM console: ",{"type":47,"tag":240,"props":1256,"children":1257},{},[1258],{"type":53,"value":1259},"IAM → Policies → Filter by type: Customer managed",{"type":53,"value":1261}," → search for ",{"type":47,"tag":103,"props":1263,"children":1265},{"className":1264},[],[1266],{"type":53,"value":1002},{"type":53,"value":1268}," in the policy JSON editor.",{"type":47,"tag":55,"props":1270,"children":1271},{},[1272,1277,1279,1284],{"type":47,"tag":240,"props":1273,"children":1274},{},[1275],{"type":53,"value":1276},"Separate IAM policy for command callers",{"type":53,"value":1278}," — keep this distinct from the policy granting ",{"type":47,"tag":103,"props":1280,"children":1282},{"className":1281},[],[1283],{"type":53,"value":1034},{"type":53,"value":359},{"type":47,"tag":246,"props":1286,"children":1288},{"className":320,"code":1287,"language":322,"meta":251,"style":251},"{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Effect\": \"Allow\",\n    \"Action\": \"bedrock-agentcore:InvokeAgentRuntimeCommand\",\n    \"Resource\": \"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:runtime\u002F\u003CRUNTIME_NAME>-*\"\n  }]\n}\n",[1289],{"type":47,"tag":103,"props":1290,"children":1291},{"__ignoreMap":251},[1292,1299,1336,1361,1396,1432,1464,1472],{"type":47,"tag":257,"props":1293,"children":1294},{"class":259,"line":260},[1295],{"type":47,"tag":257,"props":1296,"children":1297},{"style":281},[1298],{"type":53,"value":334},{"type":47,"tag":257,"props":1300,"children":1301},{"class":259,"line":337},[1302,1306,1311,1315,1319,1323,1328,1332],{"type":47,"tag":257,"props":1303,"children":1304},{"style":281},[1305],{"type":53,"value":343},{"type":47,"tag":257,"props":1307,"children":1308},{"style":346},[1309],{"type":53,"value":1310},"Version",{"type":47,"tag":257,"props":1312,"children":1313},{"style":281},[1314],{"type":53,"value":354},{"type":47,"tag":257,"props":1316,"children":1317},{"style":281},[1318],{"type":53,"value":359},{"type":47,"tag":257,"props":1320,"children":1321},{"style":281},[1322],{"type":53,"value":364},{"type":47,"tag":257,"props":1324,"children":1325},{"style":270},[1326],{"type":53,"value":1327},"2012-10-17",{"type":47,"tag":257,"props":1329,"children":1330},{"style":281},[1331],{"type":53,"value":354},{"type":47,"tag":257,"props":1333,"children":1334},{"style":281},[1335],{"type":53,"value":378},{"type":47,"tag":257,"props":1337,"children":1338},{"class":259,"line":381},[1339,1343,1348,1352,1356],{"type":47,"tag":257,"props":1340,"children":1341},{"style":281},[1342],{"type":53,"value":343},{"type":47,"tag":257,"props":1344,"children":1345},{"style":346},[1346],{"type":53,"value":1347},"Statement",{"type":47,"tag":257,"props":1349,"children":1350},{"style":281},[1351],{"type":53,"value":354},{"type":47,"tag":257,"props":1353,"children":1354},{"style":281},[1355],{"type":53,"value":359},{"type":47,"tag":257,"props":1357,"children":1358},{"style":281},[1359],{"type":53,"value":1360}," [{\n",{"type":47,"tag":257,"props":1362,"children":1363},{"class":259,"line":407},[1364,1368,1372,1376,1380,1384,1388,1392],{"type":47,"tag":257,"props":1365,"children":1366},{"style":281},[1367],{"type":53,"value":413},{"type":47,"tag":257,"props":1369,"children":1370},{"style":264},[1371],{"type":53,"value":349},{"type":47,"tag":257,"props":1373,"children":1374},{"style":281},[1375],{"type":53,"value":354},{"type":47,"tag":257,"props":1377,"children":1378},{"style":281},[1379],{"type":53,"value":359},{"type":47,"tag":257,"props":1381,"children":1382},{"style":281},[1383],{"type":53,"value":364},{"type":47,"tag":257,"props":1385,"children":1386},{"style":270},[1387],{"type":53,"value":369},{"type":47,"tag":257,"props":1389,"children":1390},{"style":281},[1391],{"type":53,"value":354},{"type":47,"tag":257,"props":1393,"children":1394},{"style":281},[1395],{"type":53,"value":378},{"type":47,"tag":257,"props":1397,"children":1398},{"class":259,"line":429},[1399,1403,1407,1411,1415,1419,1424,1428],{"type":47,"tag":257,"props":1400,"children":1401},{"style":281},[1402],{"type":53,"value":413},{"type":47,"tag":257,"props":1404,"children":1405},{"style":264},[1406],{"type":53,"value":391},{"type":47,"tag":257,"props":1408,"children":1409},{"style":281},[1410],{"type":53,"value":354},{"type":47,"tag":257,"props":1412,"children":1413},{"style":281},[1414],{"type":53,"value":359},{"type":47,"tag":257,"props":1416,"children":1417},{"style":281},[1418],{"type":53,"value":364},{"type":47,"tag":257,"props":1420,"children":1421},{"style":270},[1422],{"type":53,"value":1423},"bedrock-agentcore:InvokeAgentRuntimeCommand",{"type":47,"tag":257,"props":1425,"children":1426},{"style":281},[1427],{"type":53,"value":354},{"type":47,"tag":257,"props":1429,"children":1430},{"style":281},[1431],{"type":53,"value":378},{"type":47,"tag":257,"props":1433,"children":1434},{"class":259,"line":447},[1435,1439,1443,1447,1451,1455,1460],{"type":47,"tag":257,"props":1436,"children":1437},{"style":281},[1438],{"type":53,"value":413},{"type":47,"tag":257,"props":1440,"children":1441},{"style":264},[1442],{"type":53,"value":466},{"type":47,"tag":257,"props":1444,"children":1445},{"style":281},[1446],{"type":53,"value":354},{"type":47,"tag":257,"props":1448,"children":1449},{"style":281},[1450],{"type":53,"value":359},{"type":47,"tag":257,"props":1452,"children":1453},{"style":281},[1454],{"type":53,"value":364},{"type":47,"tag":257,"props":1456,"children":1457},{"style":270},[1458],{"type":53,"value":1459},"arn:aws:bedrock-agentcore:\u003CREGION>:\u003CYOUR_ACCOUNT_ID>:runtime\u002F\u003CRUNTIME_NAME>-*",{"type":47,"tag":257,"props":1461,"children":1462},{"style":281},[1463],{"type":53,"value":444},{"type":47,"tag":257,"props":1465,"children":1466},{"class":259,"line":456},[1467],{"type":47,"tag":257,"props":1468,"children":1469},{"style":281},[1470],{"type":53,"value":1471},"  }]\n",{"type":47,"tag":257,"props":1473,"children":1474},{"class":259,"line":481},[1475],{"type":47,"tag":257,"props":1476,"children":1477},{"style":281},[1478],{"type":53,"value":513},{"type":47,"tag":55,"props":1480,"children":1481},{},[1482,1487,1489,1494],{"type":47,"tag":240,"props":1483,"children":1484},{},[1485],{"type":53,"value":1486},"Enable CloudTrail alerting.",{"type":53,"value":1488}," Create an EventBridge rule to notify your security team when ",{"type":47,"tag":103,"props":1490,"children":1492},{"className":1491},[],[1493],{"type":53,"value":1002},{"type":53,"value":1495}," is called:",{"type":47,"tag":246,"props":1497,"children":1499},{"className":248,"code":1498,"language":250,"meta":251,"style":251},"aws events put-rule \\\n  --name AgentCoreCommandExecution \\\n  --event-pattern '{\"source\":[\"aws.bedrock-agentcore\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"eventName\":[\"InvokeAgentRuntimeCommand\"]}}' \\\n  --state ENABLED\n",[1500],{"type":47,"tag":103,"props":1501,"children":1502},{"__ignoreMap":251},[1503,1524,1541,1566],{"type":47,"tag":257,"props":1504,"children":1505},{"class":259,"line":260},[1506,1510,1515,1520],{"type":47,"tag":257,"props":1507,"children":1508},{"style":264},[1509],{"type":53,"value":8},{"type":47,"tag":257,"props":1511,"children":1512},{"style":270},[1513],{"type":53,"value":1514}," events",{"type":47,"tag":257,"props":1516,"children":1517},{"style":270},[1518],{"type":53,"value":1519}," put-rule",{"type":47,"tag":257,"props":1521,"children":1522},{"style":1097},[1523],{"type":53,"value":1100},{"type":47,"tag":257,"props":1525,"children":1526},{"class":259,"line":337},[1527,1532,1537],{"type":47,"tag":257,"props":1528,"children":1529},{"style":270},[1530],{"type":53,"value":1531},"  --name",{"type":47,"tag":257,"props":1533,"children":1534},{"style":270},[1535],{"type":53,"value":1536}," AgentCoreCommandExecution",{"type":47,"tag":257,"props":1538,"children":1539},{"style":1097},[1540],{"type":53,"value":1100},{"type":47,"tag":257,"props":1542,"children":1543},{"class":259,"line":381},[1544,1549,1553,1558,1562],{"type":47,"tag":257,"props":1545,"children":1546},{"style":270},[1547],{"type":53,"value":1548},"  --event-pattern",{"type":47,"tag":257,"props":1550,"children":1551},{"style":281},[1552],{"type":53,"value":299},{"type":47,"tag":257,"props":1554,"children":1555},{"style":270},[1556],{"type":53,"value":1557},"{\"source\":[\"aws.bedrock-agentcore\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"eventName\":[\"InvokeAgentRuntimeCommand\"]}}",{"type":47,"tag":257,"props":1559,"children":1560},{"style":281},[1561],{"type":53,"value":1122},{"type":47,"tag":257,"props":1563,"children":1564},{"style":1097},[1565],{"type":53,"value":1100},{"type":47,"tag":257,"props":1567,"children":1568},{"class":259,"line":407},[1569,1574],{"type":47,"tag":257,"props":1570,"children":1571},{"style":270},[1572],{"type":53,"value":1573},"  --state",{"type":47,"tag":257,"props":1575,"children":1576},{"style":270},[1577],{"type":53,"value":1578}," ENABLED\n",{"type":47,"tag":55,"props":1580,"children":1581},{},[1582,1587,1589,1595,1597,1603,1604,1610,1612,1618],{"type":47,"tag":240,"props":1583,"children":1584},{},[1585],{"type":53,"value":1586},"If commands are constructed from user input anywhere in calling code:",{"type":53,"value":1588}," validate before passing — reject strings containing ",{"type":47,"tag":103,"props":1590,"children":1592},{"className":1591},[],[1593],{"type":53,"value":1594},"&&",{"type":53,"value":1596},", ",{"type":47,"tag":103,"props":1598,"children":1600},{"className":1599},[],[1601],{"type":53,"value":1602},";",{"type":53,"value":1596},{"type":47,"tag":103,"props":1605,"children":1607},{"className":1606},[],[1608],{"type":53,"value":1609},"$(...)",{"type":53,"value":1611},", backticks, ",{"type":47,"tag":103,"props":1613,"children":1615},{"className":1614},[],[1616],{"type":53,"value":1617},"|",{"type":53,"value":1619},", or other shell metacharacters.",{"type":47,"tag":214,"props":1621,"children":1622},{},[],{"type":47,"tag":61,"props":1624,"children":1626},{"id":1625},"inbound-auth-control-who-can-call-your-agent",[1627],{"type":53,"value":1628},"Inbound auth: Control who can call your agent",{"type":47,"tag":55,"props":1630,"children":1631},{},[1632],{"type":53,"value":1633},"By default, agents use AWS IAM (SigV4) for inbound auth. For production, verify this is configured correctly.",{"type":47,"tag":55,"props":1635,"children":1636},{},[1637],{"type":47,"tag":240,"props":1638,"children":1639},{},[1640],{"type":53,"value":1641},"Check current auth config:",{"type":47,"tag":246,"props":1643,"children":1645},{"className":248,"code":1644,"language":250,"meta":251,"style":251},"agentcore status --runtime \u003CAgentName> --json | jq '.runtimes[0].authorizerConfig'\n",[1646],{"type":47,"tag":103,"props":1647,"children":1648},{"__ignoreMap":251},[1649],{"type":47,"tag":257,"props":1650,"children":1651},{"class":259,"line":260},[1652,1656,1660,1665,1669,1674,1679,1683,1687,1691,1695,1699,1704],{"type":47,"tag":257,"props":1653,"children":1654},{"style":264},[1655],{"type":53,"value":267},{"type":47,"tag":257,"props":1657,"children":1658},{"style":270},[1659],{"type":53,"value":273},{"type":47,"tag":257,"props":1661,"children":1662},{"style":270},[1663],{"type":53,"value":1664}," --runtime",{"type":47,"tag":257,"props":1666,"children":1667},{"style":281},[1668],{"type":53,"value":1180},{"type":47,"tag":257,"props":1670,"children":1671},{"style":270},[1672],{"type":53,"value":1673},"AgentNam",{"type":47,"tag":257,"props":1675,"children":1676},{"style":1097},[1677],{"type":53,"value":1678},"e",{"type":47,"tag":257,"props":1680,"children":1681},{"style":281},[1682],{"type":53,"value":1195},{"type":47,"tag":257,"props":1684,"children":1685},{"style":270},[1686],{"type":53,"value":278},{"type":47,"tag":257,"props":1688,"children":1689},{"style":281},[1690],{"type":53,"value":284},{"type":47,"tag":257,"props":1692,"children":1693},{"style":264},[1694],{"type":53,"value":289},{"type":47,"tag":257,"props":1696,"children":1697},{"style":281},[1698],{"type":53,"value":299},{"type":47,"tag":257,"props":1700,"children":1701},{"style":270},[1702],{"type":53,"value":1703},".runtimes[0].authorizerConfig",{"type":47,"tag":257,"props":1705,"children":1706},{"style":281},[1707],{"type":53,"value":309},{"type":47,"tag":55,"props":1709,"children":1710},{},[1711],{"type":47,"tag":240,"props":1712,"children":1713},{},[1714],{"type":53,"value":1715},"Options:",{"type":47,"tag":55,"props":1717,"children":1718},{},[1719,1725],{"type":47,"tag":103,"props":1720,"children":1722},{"className":1721},[],[1723],{"type":53,"value":1724},"AWS_IAM",{"type":53,"value":1726}," (default) — callers must sign requests with SigV4. Good for internal services and AWS-native clients.",{"type":47,"tag":55,"props":1728,"children":1729},{},[1730,1736],{"type":47,"tag":103,"props":1731,"children":1733},{"className":1732},[],[1734],{"type":53,"value":1735},"CUSTOM_JWT",{"type":53,"value":1737}," — callers present a JWT from your identity provider. Good for web\u002Fmobile apps and external clients.",{"type":47,"tag":246,"props":1739,"children":1741},{"className":248,"code":1740,"language":250,"meta":251,"style":251},"agentcore add agent \\\n  --name MyAgent \\\n  --authorizer-type CUSTOM_JWT \\\n  --discovery-url https:\u002F\u002Fyour-idp.example.com\u002F.well-known\u002Fopenid-configuration \\\n  --allowed-audience my-api \\\n  --allowed-clients my-client-id\n",[1742],{"type":47,"tag":103,"props":1743,"children":1744},{"__ignoreMap":251},[1745,1766,1782,1799,1816,1833],{"type":47,"tag":257,"props":1746,"children":1747},{"class":259,"line":260},[1748,1752,1757,1762],{"type":47,"tag":257,"props":1749,"children":1750},{"style":264},[1751],{"type":53,"value":267},{"type":47,"tag":257,"props":1753,"children":1754},{"style":270},[1755],{"type":53,"value":1756}," add",{"type":47,"tag":257,"props":1758,"children":1759},{"style":270},[1760],{"type":53,"value":1761}," agent",{"type":47,"tag":257,"props":1763,"children":1764},{"style":1097},[1765],{"type":53,"value":1100},{"type":47,"tag":257,"props":1767,"children":1768},{"class":259,"line":337},[1769,1773,1778],{"type":47,"tag":257,"props":1770,"children":1771},{"style":270},[1772],{"type":53,"value":1531},{"type":47,"tag":257,"props":1774,"children":1775},{"style":270},[1776],{"type":53,"value":1777}," MyAgent",{"type":47,"tag":257,"props":1779,"children":1780},{"style":1097},[1781],{"type":53,"value":1100},{"type":47,"tag":257,"props":1783,"children":1784},{"class":259,"line":381},[1785,1790,1795],{"type":47,"tag":257,"props":1786,"children":1787},{"style":270},[1788],{"type":53,"value":1789},"  --authorizer-type",{"type":47,"tag":257,"props":1791,"children":1792},{"style":270},[1793],{"type":53,"value":1794}," CUSTOM_JWT",{"type":47,"tag":257,"props":1796,"children":1797},{"style":1097},[1798],{"type":53,"value":1100},{"type":47,"tag":257,"props":1800,"children":1801},{"class":259,"line":407},[1802,1807,1812],{"type":47,"tag":257,"props":1803,"children":1804},{"style":270},[1805],{"type":53,"value":1806},"  --discovery-url",{"type":47,"tag":257,"props":1808,"children":1809},{"style":270},[1810],{"type":53,"value":1811}," https:\u002F\u002Fyour-idp.example.com\u002F.well-known\u002Fopenid-configuration",{"type":47,"tag":257,"props":1813,"children":1814},{"style":1097},[1815],{"type":53,"value":1100},{"type":47,"tag":257,"props":1817,"children":1818},{"class":259,"line":429},[1819,1824,1829],{"type":47,"tag":257,"props":1820,"children":1821},{"style":270},[1822],{"type":53,"value":1823},"  --allowed-audience",{"type":47,"tag":257,"props":1825,"children":1826},{"style":270},[1827],{"type":53,"value":1828}," my-api",{"type":47,"tag":257,"props":1830,"children":1831},{"style":1097},[1832],{"type":53,"value":1100},{"type":47,"tag":257,"props":1834,"children":1835},{"class":259,"line":447},[1836,1841],{"type":47,"tag":257,"props":1837,"children":1838},{"style":270},[1839],{"type":53,"value":1840},"  --allowed-clients",{"type":47,"tag":257,"props":1842,"children":1843},{"style":270},[1844],{"type":53,"value":1845}," my-client-id\n",{"type":47,"tag":1847,"props":1848,"children":1849},"blockquote",{},[1850],{"type":47,"tag":55,"props":1851,"children":1852},{},[1853,1858,1860,1866],{"type":47,"tag":257,"props":1854,"children":1855},{},[1856],{"type":53,"value":1857},"!WARNING",{"type":53,"value":1859},"\nNever use ",{"type":47,"tag":103,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":53,"value":1865},"--authorizer-type NONE",{"type":53,"value":1867}," in production. It allows unauthenticated access\nto your agent — anyone with the endpoint URL can invoke it. Always use AWS_IAM or\nCUSTOM_JWT. If you see NONE in production, change it immediately.",{"type":47,"tag":138,"props":1869,"children":1871},{"id":1870},"choosing-allowedclients-vs-allowedaudience",[1872,1874,1880,1882],{"type":53,"value":1873},"Choosing ",{"type":47,"tag":103,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":53,"value":1879},"allowedClients",{"type":53,"value":1881}," vs ",{"type":47,"tag":103,"props":1883,"children":1885},{"className":1884},[],[1886],{"type":53,"value":1887},"allowedAudience",{"type":47,"tag":55,"props":1889,"children":1890},{},[1891],{"type":53,"value":1892},"This is the most common JWT misconfiguration. The right choice depends on what's inside the token your IdP issues.",{"type":47,"tag":55,"props":1894,"children":1895},{},[1896,1901,1903,1909],{"type":47,"tag":240,"props":1897,"children":1898},{},[1899],{"type":53,"value":1900},"Decode a sample token",{"type":53,"value":1902}," (at your IdP or with ",{"type":47,"tag":103,"props":1904,"children":1906},{"className":1905},[],[1907],{"type":53,"value":1908},"jwt.io",{"type":53,"value":1910},") and look at the payload:",{"type":47,"tag":68,"props":1912,"children":1913},{},[1914,1945,1965],{"type":47,"tag":72,"props":1915,"children":1916},{},[1917,1919,1925,1927,1933,1935,1943],{"type":53,"value":1918},"Token has a ",{"type":47,"tag":103,"props":1920,"children":1922},{"className":1921},[],[1923],{"type":53,"value":1924},"client_id",{"type":53,"value":1926}," claim, no ",{"type":47,"tag":103,"props":1928,"children":1930},{"className":1929},[],[1931],{"type":53,"value":1932},"aud",{"type":53,"value":1934}," claim → configure ",{"type":47,"tag":240,"props":1936,"children":1937},{},[1938],{"type":47,"tag":103,"props":1939,"children":1941},{"className":1940},[],[1942],{"type":53,"value":1879},{"type":53,"value":1944}," on the runtime",{"type":47,"tag":72,"props":1946,"children":1947},{},[1948,1950,1955,1956,1964],{"type":53,"value":1949},"Token has an ",{"type":47,"tag":103,"props":1951,"children":1953},{"className":1952},[],[1954],{"type":53,"value":1932},{"type":53,"value":1934},{"type":47,"tag":240,"props":1957,"children":1958},{},[1959],{"type":47,"tag":103,"props":1960,"children":1962},{"className":1961},[],[1963],{"type":53,"value":1887},{"type":53,"value":1944},{"type":47,"tag":72,"props":1966,"children":1967},{},[1968,1970,1975,1977,1982],{"type":53,"value":1969},"Token has both → use ",{"type":47,"tag":103,"props":1971,"children":1973},{"className":1972},[],[1974],{"type":53,"value":1887},{"type":53,"value":1976},". The ",{"type":47,"tag":103,"props":1978,"children":1980},{"className":1979},[],[1981],{"type":53,"value":1932},{"type":53,"value":1983}," claim is the standard OIDC audience field; use that as the primary check.",{"type":47,"tag":55,"props":1985,"children":1986},{},[1987],{"type":53,"value":1988},"If you pick the wrong one, invocations return 403 even with a valid token — the runtime is validating against a claim the token doesn't have.",{"type":47,"tag":138,"props":1990,"children":1992},{"id":1991},"issuer-discovery-url-prefix-requirement",[1993],{"type":53,"value":1994},"Issuer ↔ discovery URL prefix requirement",{"type":47,"tag":55,"props":1996,"children":1997},{},[1998,2000,2006],{"type":53,"value":1999},"AgentCore enforces the OIDC discovery spec (RFC 8414 §3): the ",{"type":47,"tag":103,"props":2001,"children":2003},{"className":2002},[],[2004],{"type":53,"value":2005},"issuer",{"type":53,"value":2007}," value in the discovery document must be a URL prefix of the discovery endpoint.",{"type":47,"tag":55,"props":2009,"children":2010},{},[2011,2013,2019,2021,2026,2028,2034,2036,2042],{"type":53,"value":2012},"That means if your discovery URL is ",{"type":47,"tag":103,"props":2014,"children":2016},{"className":2015},[],[2017],{"type":53,"value":2018},"https:\u002F\u002Fqa.example.com\u002F.well-known\u002Fopenid-configuration",{"type":53,"value":2020},", the ",{"type":47,"tag":103,"props":2022,"children":2024},{"className":2023},[],[2025],{"type":53,"value":2005},{"type":53,"value":2027}," field in that document must start with ",{"type":47,"tag":103,"props":2029,"children":2031},{"className":2030},[],[2032],{"type":53,"value":2033},"https:\u002F\u002Fqa.example.com",{"type":53,"value":2035},". If the document advertises an issuer like ",{"type":47,"tag":103,"props":2037,"children":2039},{"className":2038},[],[2040],{"type":53,"value":2041},"https:\u002F\u002Fexample.com",{"type":53,"value":2043}," (no subdomain), validation fails.",{"type":47,"tag":55,"props":2045,"children":2046},{},[2047],{"type":53,"value":2048},"Some enterprise IdPs (PingFederate, Paylocity, some Keycloak setups) host the discovery endpoint on an environment-specific subdomain while advertising a production-level issuer. This pattern is incompatible with the RFC 8414 prefix rule.",{"type":47,"tag":55,"props":2050,"children":2051},{},[2052],{"type":53,"value":2053},"Fix options:",{"type":47,"tag":2055,"props":2056,"children":2057},"ol",{},[2058,2068],{"type":47,"tag":72,"props":2059,"children":2060},{},[2061,2066],{"type":47,"tag":240,"props":2062,"children":2063},{},[2064],{"type":53,"value":2065},"Align the IdP's discovery endpoint with its issuer",{"type":53,"value":2067}," — serve discovery from the same origin as the issuer.",{"type":47,"tag":72,"props":2069,"children":2070},{},[2071,2076],{"type":47,"tag":240,"props":2072,"children":2073},{},[2074],{"type":53,"value":2075},"Point the runtime at the actual discovery URL domain",{"type":53,"value":2077}," — configure the runtime's discovery URL with the subdomain that matches the token's issuer.",{"type":47,"tag":138,"props":2079,"children":2081},{"id":2080},"debugging-jwt-auth-failures",[2082],{"type":53,"value":2083},"Debugging JWT auth failures",{"type":47,"tag":55,"props":2085,"children":2086},{},[2087],{"type":53,"value":2088},"When invocations fail with 403, narrow down which check is failing.",{"type":47,"tag":55,"props":2090,"children":2091},{},[2092,2101],{"type":47,"tag":240,"props":2093,"children":2094},{},[2095],{"type":47,"tag":103,"props":2096,"children":2098},{"className":2097},[],[2099],{"type":53,"value":2100},"Authorization method mismatch",{"type":53,"value":2102}," — the runtime's auth type and the request's auth type don't match. Two cases:",{"type":47,"tag":68,"props":2104,"children":2105},{},[2106,2125],{"type":47,"tag":72,"props":2107,"children":2108},{},[2109,2111,2116,2118,2123],{"type":53,"value":2110},"The runtime is configured for ",{"type":47,"tag":103,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":53,"value":1724},{"type":53,"value":2117}," (or no authorizer) but the caller is sending a Bearer token → reconfigure the runtime for ",{"type":47,"tag":103,"props":2119,"children":2121},{"className":2120},[],[2122],{"type":53,"value":1735},{"type":53,"value":2124},", or have the caller use SigV4.",{"type":47,"tag":72,"props":2126,"children":2127},{},[2128,2129,2134,2136,2142,2143,2149,2151,2157],{"type":53,"value":2110},{"type":47,"tag":103,"props":2130,"children":2132},{"className":2131},[],[2133],{"type":53,"value":1735},{"type":53,"value":2135}," but the caller's request is being SigV4-signed → likely the SDK or environment is injecting SigV4 headers alongside the Bearer token. Check for ",{"type":47,"tag":103,"props":2137,"children":2139},{"className":2138},[],[2140],{"type":53,"value":2141},"X-Amz-Date",{"type":53,"value":1596},{"type":47,"tag":103,"props":2144,"children":2146},{"className":2145},[],[2147],{"type":53,"value":2148},"X-Amz-Security-Token",{"type":53,"value":2150},", or ",{"type":47,"tag":103,"props":2152,"children":2154},{"className":2153},[],[2155],{"type":53,"value":2156},"Authorization: AWS4-HMAC-SHA256",{"type":53,"value":2158}," in the outbound request. Remove the SigV4 path and send only the Bearer token.",{"type":47,"tag":55,"props":2160,"children":2161},{},[2162,2171],{"type":47,"tag":240,"props":2163,"children":2164},{},[2165],{"type":47,"tag":103,"props":2166,"children":2168},{"className":2167},[],[2169],{"type":53,"value":2170},"Invalid inbound token",{"type":53,"value":2172}," (or similar) — the token was rejected by the JWT validator. Walk through these in order:",{"type":47,"tag":2055,"props":2174,"children":2175},{},[2176,2194,2213,2231,2249],{"type":47,"tag":72,"props":2177,"children":2178},{},[2179,2184,2186,2192],{"type":47,"tag":240,"props":2180,"children":2181},{},[2182],{"type":53,"value":2183},"Issuer ↔ discovery URL prefix",{"type":53,"value":2185}," (above) — verify the token's ",{"type":47,"tag":103,"props":2187,"children":2189},{"className":2188},[],[2190],{"type":53,"value":2191},"iss",{"type":53,"value":2193}," claim matches the discovery URL's origin",{"type":47,"tag":72,"props":2195,"children":2196},{},[2197,2211],{"type":47,"tag":240,"props":2198,"children":2199},{},[2200,2205,2206],{"type":47,"tag":103,"props":2201,"children":2203},{"className":2202},[],[2204],{"type":53,"value":1879},{"type":53,"value":1881},{"type":47,"tag":103,"props":2207,"children":2209},{"className":2208},[],[2210],{"type":53,"value":1887},{"type":53,"value":2212}," — is the runtime configured for the right claim for your token format?",{"type":47,"tag":72,"props":2214,"children":2215},{},[2216,2221,2223,2229],{"type":47,"tag":240,"props":2217,"children":2218},{},[2219],{"type":53,"value":2220},"JWKS reachability",{"type":53,"value":2222}," — can AgentCore reach the ",{"type":47,"tag":103,"props":2224,"children":2226},{"className":2225},[],[2227],{"type":53,"value":2228},"jwks_uri",{"type":53,"value":2230}," listed in the discovery document? It must be publicly reachable.",{"type":47,"tag":72,"props":2232,"children":2233},{},[2234,2239,2241,2247],{"type":47,"tag":240,"props":2235,"children":2236},{},[2237],{"type":53,"value":2238},"Token expired",{"type":53,"value":2240}," — decode the token, check ",{"type":47,"tag":103,"props":2242,"children":2244},{"className":2243},[],[2245],{"type":53,"value":2246},"exp",{"type":53,"value":2248}," against now",{"type":47,"tag":72,"props":2250,"children":2251},{},[2252,2257],{"type":47,"tag":240,"props":2253,"children":2254},{},[2255],{"type":53,"value":2256},"Signing algorithm support",{"type":53,"value":2258}," — some IdPs sign with algorithms (PS256, ES384, etc.) that aren't universally supported. Check your IdP's supported algorithms and switch to RS256 if compatibility is the issue.",{"type":47,"tag":55,"props":2260,"children":2261},{},[2262],{"type":53,"value":2263},"Only after ruling all of those out should you treat it as a service-side issue.",{"type":47,"tag":214,"props":2265,"children":2266},{},[],{"type":47,"tag":61,"props":2268,"children":2270},{"id":2269},"error-handling-fail-gracefully",[2271],{"type":53,"value":2272},"Error handling: Fail gracefully",{"type":47,"tag":55,"props":2274,"children":2275},{},[2276],{"type":53,"value":2277},"Check that your agent code handles errors without exposing internal details:",{"type":47,"tag":246,"props":2279,"children":2283},{"className":2280,"code":2281,"language":2282,"meta":251,"style":251},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from bedrock_agentcore.runtime import BedrockAgentCoreApp\n\napp = BedrockAgentCoreApp()\n\n@app.entrypoint\ndef invoke(payload, context):\n    try:\n        # your agent logic\n        return {\"response\": result}\n    except Exception as e:\n        # Log the full error internally\n        app.logger.error(f\"Agent error: {e}\", exc_info=True)\n        # Return a safe message to the caller\n        return {\"error\": \"An error occurred. Please try again.\"}\n\nif __name__ == \"__main__\":\n    app.run()\n","python",[2284],{"type":47,"tag":103,"props":2285,"children":2286},{"__ignoreMap":251},[2287,2295,2304,2312,2319,2327,2335,2343,2351,2359,2367,2376,2385,2394,2403,2411,2420],{"type":47,"tag":257,"props":2288,"children":2289},{"class":259,"line":260},[2290],{"type":47,"tag":257,"props":2291,"children":2292},{},[2293],{"type":53,"value":2294},"from bedrock_agentcore.runtime import BedrockAgentCoreApp\n",{"type":47,"tag":257,"props":2296,"children":2297},{"class":259,"line":337},[2298],{"type":47,"tag":257,"props":2299,"children":2301},{"emptyLinePlaceholder":2300},true,[2302],{"type":53,"value":2303},"\n",{"type":47,"tag":257,"props":2305,"children":2306},{"class":259,"line":381},[2307],{"type":47,"tag":257,"props":2308,"children":2309},{},[2310],{"type":53,"value":2311},"app = BedrockAgentCoreApp()\n",{"type":47,"tag":257,"props":2313,"children":2314},{"class":259,"line":407},[2315],{"type":47,"tag":257,"props":2316,"children":2317},{"emptyLinePlaceholder":2300},[2318],{"type":53,"value":2303},{"type":47,"tag":257,"props":2320,"children":2321},{"class":259,"line":429},[2322],{"type":47,"tag":257,"props":2323,"children":2324},{},[2325],{"type":53,"value":2326},"@app.entrypoint\n",{"type":47,"tag":257,"props":2328,"children":2329},{"class":259,"line":447},[2330],{"type":47,"tag":257,"props":2331,"children":2332},{},[2333],{"type":53,"value":2334},"def invoke(payload, context):\n",{"type":47,"tag":257,"props":2336,"children":2337},{"class":259,"line":456},[2338],{"type":47,"tag":257,"props":2339,"children":2340},{},[2341],{"type":53,"value":2342},"    try:\n",{"type":47,"tag":257,"props":2344,"children":2345},{"class":259,"line":481},[2346],{"type":47,"tag":257,"props":2347,"children":2348},{},[2349],{"type":53,"value":2350},"        # your agent logic\n",{"type":47,"tag":257,"props":2352,"children":2353},{"class":259,"line":498},[2354],{"type":47,"tag":257,"props":2355,"children":2356},{},[2357],{"type":53,"value":2358},"        return {\"response\": result}\n",{"type":47,"tag":257,"props":2360,"children":2361},{"class":259,"line":507},[2362],{"type":47,"tag":257,"props":2363,"children":2364},{},[2365],{"type":53,"value":2366},"    except Exception as e:\n",{"type":47,"tag":257,"props":2368,"children":2370},{"class":259,"line":2369},11,[2371],{"type":47,"tag":257,"props":2372,"children":2373},{},[2374],{"type":53,"value":2375},"        # Log the full error internally\n",{"type":47,"tag":257,"props":2377,"children":2379},{"class":259,"line":2378},12,[2380],{"type":47,"tag":257,"props":2381,"children":2382},{},[2383],{"type":53,"value":2384},"        app.logger.error(f\"Agent error: {e}\", exc_info=True)\n",{"type":47,"tag":257,"props":2386,"children":2388},{"class":259,"line":2387},13,[2389],{"type":47,"tag":257,"props":2390,"children":2391},{},[2392],{"type":53,"value":2393},"        # Return a safe message to the caller\n",{"type":47,"tag":257,"props":2395,"children":2397},{"class":259,"line":2396},14,[2398],{"type":47,"tag":257,"props":2399,"children":2400},{},[2401],{"type":53,"value":2402},"        return {\"error\": \"An error occurred. Please try again.\"}\n",{"type":47,"tag":257,"props":2404,"children":2406},{"class":259,"line":2405},15,[2407],{"type":47,"tag":257,"props":2408,"children":2409},{"emptyLinePlaceholder":2300},[2410],{"type":53,"value":2303},{"type":47,"tag":257,"props":2412,"children":2414},{"class":259,"line":2413},16,[2415],{"type":47,"tag":257,"props":2416,"children":2417},{},[2418],{"type":53,"value":2419},"if __name__ == \"__main__\":\n",{"type":47,"tag":257,"props":2421,"children":2423},{"class":259,"line":2422},17,[2424],{"type":47,"tag":257,"props":2425,"children":2426},{},[2427],{"type":53,"value":2428},"    app.run()\n",{"type":47,"tag":55,"props":2430,"children":2431},{},[2432,2437,2439,2445],{"type":47,"tag":240,"props":2433,"children":2434},{},[2435],{"type":53,"value":2436},"Check for:",{"type":53,"value":2438}," bare ",{"type":47,"tag":103,"props":2440,"children":2442},{"className":2441},[],[2443],{"type":53,"value":2444},"except",{"type":53,"value":2446}," blocks that swallow errors silently, error messages that expose stack traces or internal details to callers, missing error handling in tool call code.",{"type":47,"tag":214,"props":2448,"children":2449},{},[],{"type":47,"tag":61,"props":2451,"children":2453},{"id":2452},"input-validation-and-rate-limiting",[2454],{"type":53,"value":2455},"Input validation and rate limiting",{"type":47,"tag":55,"props":2457,"children":2458},{},[2459],{"type":53,"value":2460},"Agent entrypoints receive arbitrary payloads from callers. Validate inputs before processing:",{"type":47,"tag":246,"props":2462,"children":2464},{"className":2280,"code":2463,"language":2282,"meta":251,"style":251},"@app.entrypoint\ndef invoke(payload, context):\n    prompt = payload.get(\"prompt\", \"\")\n\n    # Validate input\n    if not prompt or not isinstance(prompt, str):\n        return {\"error\": \"Missing or invalid 'prompt' field\"}\n    if len(prompt) > 10000:\n        return {\"error\": \"Prompt exceeds maximum length (10,000 characters)\"}\n\n    # Sanitize — strip control characters, excessive whitespace\n    prompt = \" \".join(prompt.split())\n\n    # Proceed with validated input\n    result = agent(prompt)\n    return {\"response\": str(result)}\n",[2465],{"type":47,"tag":103,"props":2466,"children":2467},{"__ignoreMap":251},[2468,2475,2482,2490,2497,2505,2513,2521,2529,2537,2544,2552,2560,2567,2575,2583],{"type":47,"tag":257,"props":2469,"children":2470},{"class":259,"line":260},[2471],{"type":47,"tag":257,"props":2472,"children":2473},{},[2474],{"type":53,"value":2326},{"type":47,"tag":257,"props":2476,"children":2477},{"class":259,"line":337},[2478],{"type":47,"tag":257,"props":2479,"children":2480},{},[2481],{"type":53,"value":2334},{"type":47,"tag":257,"props":2483,"children":2484},{"class":259,"line":381},[2485],{"type":47,"tag":257,"props":2486,"children":2487},{},[2488],{"type":53,"value":2489},"    prompt = payload.get(\"prompt\", \"\")\n",{"type":47,"tag":257,"props":2491,"children":2492},{"class":259,"line":407},[2493],{"type":47,"tag":257,"props":2494,"children":2495},{"emptyLinePlaceholder":2300},[2496],{"type":53,"value":2303},{"type":47,"tag":257,"props":2498,"children":2499},{"class":259,"line":429},[2500],{"type":47,"tag":257,"props":2501,"children":2502},{},[2503],{"type":53,"value":2504},"    # Validate input\n",{"type":47,"tag":257,"props":2506,"children":2507},{"class":259,"line":447},[2508],{"type":47,"tag":257,"props":2509,"children":2510},{},[2511],{"type":53,"value":2512},"    if not prompt or not isinstance(prompt, str):\n",{"type":47,"tag":257,"props":2514,"children":2515},{"class":259,"line":456},[2516],{"type":47,"tag":257,"props":2517,"children":2518},{},[2519],{"type":53,"value":2520},"        return {\"error\": \"Missing or invalid 'prompt' field\"}\n",{"type":47,"tag":257,"props":2522,"children":2523},{"class":259,"line":481},[2524],{"type":47,"tag":257,"props":2525,"children":2526},{},[2527],{"type":53,"value":2528},"    if len(prompt) > 10000:\n",{"type":47,"tag":257,"props":2530,"children":2531},{"class":259,"line":498},[2532],{"type":47,"tag":257,"props":2533,"children":2534},{},[2535],{"type":53,"value":2536},"        return {\"error\": \"Prompt exceeds maximum length (10,000 characters)\"}\n",{"type":47,"tag":257,"props":2538,"children":2539},{"class":259,"line":507},[2540],{"type":47,"tag":257,"props":2541,"children":2542},{"emptyLinePlaceholder":2300},[2543],{"type":53,"value":2303},{"type":47,"tag":257,"props":2545,"children":2546},{"class":259,"line":2369},[2547],{"type":47,"tag":257,"props":2548,"children":2549},{},[2550],{"type":53,"value":2551},"    # Sanitize — strip control characters, excessive whitespace\n",{"type":47,"tag":257,"props":2553,"children":2554},{"class":259,"line":2378},[2555],{"type":47,"tag":257,"props":2556,"children":2557},{},[2558],{"type":53,"value":2559},"    prompt = \" \".join(prompt.split())\n",{"type":47,"tag":257,"props":2561,"children":2562},{"class":259,"line":2387},[2563],{"type":47,"tag":257,"props":2564,"children":2565},{"emptyLinePlaceholder":2300},[2566],{"type":53,"value":2303},{"type":47,"tag":257,"props":2568,"children":2569},{"class":259,"line":2396},[2570],{"type":47,"tag":257,"props":2571,"children":2572},{},[2573],{"type":53,"value":2574},"    # Proceed with validated input\n",{"type":47,"tag":257,"props":2576,"children":2577},{"class":259,"line":2405},[2578],{"type":47,"tag":257,"props":2579,"children":2580},{},[2581],{"type":53,"value":2582},"    result = agent(prompt)\n",{"type":47,"tag":257,"props":2584,"children":2585},{"class":259,"line":2413},[2586],{"type":47,"tag":257,"props":2587,"children":2588},{},[2589],{"type":53,"value":2590},"    return {\"response\": str(result)}\n",{"type":47,"tag":55,"props":2592,"children":2593},{},[2594],{"type":47,"tag":240,"props":2595,"children":2596},{},[2597],{"type":53,"value":2598},"What to validate:",{"type":47,"tag":68,"props":2600,"children":2601},{},[2602,2607,2612,2617],{"type":47,"tag":72,"props":2603,"children":2604},{},[2605],{"type":53,"value":2606},"Required fields are present and have the expected type",{"type":47,"tag":72,"props":2608,"children":2609},{},[2610],{"type":53,"value":2611},"String inputs don't exceed reasonable length limits (prevents token-bombing the model)",{"type":47,"tag":72,"props":2613,"children":2614},{},[2615],{"type":53,"value":2616},"Numeric inputs are within expected ranges",{"type":47,"tag":72,"props":2618,"children":2619},{},[2620],{"type":53,"value":2621},"User-provided IDs (actor_id, session_id) match expected formats",{"type":47,"tag":55,"props":2623,"children":2624},{},[2625,2630,2632,2640],{"type":47,"tag":240,"props":2626,"children":2627},{},[2628],{"type":53,"value":2629},"Rate limiting:",{"type":53,"value":2631}," AgentCore Runtime has built-in invocation rate limits (default 25 TPS per agent — see ",{"type":47,"tag":98,"props":2633,"children":2634},{"href":100},[2635],{"type":47,"tag":103,"props":2636,"children":2638},{"className":2637},[],[2639],{"type":53,"value":100},{"type":53,"value":2641},"). For application-level rate limiting (per-user, per-tenant), implement it in your calling application or API Gateway layer, not in the agent code itself. The agent should assume it's already been rate-limited by the time a request reaches it.",{"type":47,"tag":214,"props":2643,"children":2644},{},[],{"type":47,"tag":61,"props":2646,"children":2648},{"id":2647},"secrets-no-credentials-in-code-no-secrets-in-runtime-env-vars",[2649],{"type":53,"value":2650},"Secrets: No credentials in code, no secrets in runtime env vars",{"type":47,"tag":55,"props":2652,"children":2653},{},[2654],{"type":53,"value":2655},"Two failure modes to check for:",{"type":47,"tag":138,"props":2657,"children":2659},{"id":2658},"_1-hardcoded-secrets-in-agent-code",[2660],{"type":53,"value":2661},"1. Hardcoded secrets in agent code",{"type":47,"tag":246,"props":2663,"children":2665},{"className":248,"code":2664,"language":250,"meta":251,"style":251},"# Search for common secret patterns in agent code\ngrep -r \"sk-\\|api_key\\s*=\\s*['\\\"]\" app\u002F --include=\"*.py\"\ngrep -r \"password\\s*=\\s*['\\\"]\" app\u002F --include=\"*.py\"\n",[2666],{"type":47,"tag":103,"props":2667,"children":2668},{"__ignoreMap":251},[2669,2677,2735],{"type":47,"tag":257,"props":2670,"children":2671},{"class":259,"line":260},[2672],{"type":47,"tag":257,"props":2673,"children":2674},{"style":1064},[2675],{"type":53,"value":2676},"# Search for common secret patterns in agent code\n",{"type":47,"tag":257,"props":2678,"children":2679},{"class":259,"line":337},[2680,2685,2689,2693,2698,2703,2708,2712,2717,2722,2726,2731],{"type":47,"tag":257,"props":2681,"children":2682},{"style":264},[2683],{"type":53,"value":2684},"grep",{"type":47,"tag":257,"props":2686,"children":2687},{"style":270},[2688],{"type":53,"value":294},{"type":47,"tag":257,"props":2690,"children":2691},{"style":281},[2692],{"type":53,"value":364},{"type":47,"tag":257,"props":2694,"children":2695},{"style":270},[2696],{"type":53,"value":2697},"sk-\\|api_key\\s*=\\s*['",{"type":47,"tag":257,"props":2699,"children":2700},{"style":1097},[2701],{"type":53,"value":2702},"\\\"",{"type":47,"tag":257,"props":2704,"children":2705},{"style":270},[2706],{"type":53,"value":2707},"]",{"type":47,"tag":257,"props":2709,"children":2710},{"style":281},[2711],{"type":53,"value":354},{"type":47,"tag":257,"props":2713,"children":2714},{"style":270},[2715],{"type":53,"value":2716}," app\u002F",{"type":47,"tag":257,"props":2718,"children":2719},{"style":270},[2720],{"type":53,"value":2721}," --include=",{"type":47,"tag":257,"props":2723,"children":2724},{"style":281},[2725],{"type":53,"value":354},{"type":47,"tag":257,"props":2727,"children":2728},{"style":270},[2729],{"type":53,"value":2730},"*.py",{"type":47,"tag":257,"props":2732,"children":2733},{"style":281},[2734],{"type":53,"value":444},{"type":47,"tag":257,"props":2736,"children":2737},{"class":259,"line":381},[2738,2742,2746,2750,2755,2759,2763,2767,2771,2775,2779,2783],{"type":47,"tag":257,"props":2739,"children":2740},{"style":264},[2741],{"type":53,"value":2684},{"type":47,"tag":257,"props":2743,"children":2744},{"style":270},[2745],{"type":53,"value":294},{"type":47,"tag":257,"props":2747,"children":2748},{"style":281},[2749],{"type":53,"value":364},{"type":47,"tag":257,"props":2751,"children":2752},{"style":270},[2753],{"type":53,"value":2754},"password\\s*=\\s*['",{"type":47,"tag":257,"props":2756,"children":2757},{"style":1097},[2758],{"type":53,"value":2702},{"type":47,"tag":257,"props":2760,"children":2761},{"style":270},[2762],{"type":53,"value":2707},{"type":47,"tag":257,"props":2764,"children":2765},{"style":281},[2766],{"type":53,"value":354},{"type":47,"tag":257,"props":2768,"children":2769},{"style":270},[2770],{"type":53,"value":2716},{"type":47,"tag":257,"props":2772,"children":2773},{"style":270},[2774],{"type":53,"value":2721},{"type":47,"tag":257,"props":2776,"children":2777},{"style":281},[2778],{"type":53,"value":354},{"type":47,"tag":257,"props":2780,"children":2781},{"style":270},[2782],{"type":53,"value":2730},{"type":47,"tag":257,"props":2784,"children":2785},{"style":281},[2786],{"type":53,"value":444},{"type":47,"tag":138,"props":2788,"children":2790},{"id":2789},"_2-secrets-pulled-from-runtime-environment-variables",[2791],{"type":53,"value":2792},"2. Secrets pulled from runtime environment variables",{"type":47,"tag":55,"props":2794,"children":2795},{},[2796,2798,2803,2805,2811],{"type":53,"value":2797},"AgentCore Runtime environment variables are ",{"type":47,"tag":240,"props":2799,"children":2800},{},[2801],{"type":53,"value":2802},"not",{"type":53,"value":2804}," vault-backed. Anything a developer stuffs into the runtime's env (via CDK, boto3 ",{"type":47,"tag":103,"props":2806,"children":2808},{"className":2807},[],[2809],{"type":53,"value":2810},"UpdateAgentRuntime",{"type":53,"value":2812},", or similar) is a plaintext config value, not a secret. Audit for the pattern:",{"type":47,"tag":246,"props":2814,"children":2816},{"className":248,"code":2815,"language":250,"meta":251,"style":251},"# Flag any os.getenv \u002F os.environ call whose name implies a secret\ngrep -rE \"os\\.(getenv|environ).*(TOKEN|SECRET|KEY|PASSWORD|CREDENTIAL)\" app\u002F --include=\"*.py\"\n",[2817],{"type":47,"tag":103,"props":2818,"children":2819},{"__ignoreMap":251},[2820,2828],{"type":47,"tag":257,"props":2821,"children":2822},{"class":259,"line":260},[2823],{"type":47,"tag":257,"props":2824,"children":2825},{"style":1064},[2826],{"type":53,"value":2827},"# Flag any os.getenv \u002F os.environ call whose name implies a secret\n",{"type":47,"tag":257,"props":2829,"children":2830},{"class":259,"line":337},[2831,2835,2840,2844,2849,2853,2857,2861,2865,2869],{"type":47,"tag":257,"props":2832,"children":2833},{"style":264},[2834],{"type":53,"value":2684},{"type":47,"tag":257,"props":2836,"children":2837},{"style":270},[2838],{"type":53,"value":2839}," -rE",{"type":47,"tag":257,"props":2841,"children":2842},{"style":281},[2843],{"type":53,"value":364},{"type":47,"tag":257,"props":2845,"children":2846},{"style":270},[2847],{"type":53,"value":2848},"os\\.(getenv|environ).*(TOKEN|SECRET|KEY|PASSWORD|CREDENTIAL)",{"type":47,"tag":257,"props":2850,"children":2851},{"style":281},[2852],{"type":53,"value":354},{"type":47,"tag":257,"props":2854,"children":2855},{"style":270},[2856],{"type":53,"value":2716},{"type":47,"tag":257,"props":2858,"children":2859},{"style":270},[2860],{"type":53,"value":2721},{"type":47,"tag":257,"props":2862,"children":2863},{"style":281},[2864],{"type":53,"value":354},{"type":47,"tag":257,"props":2866,"children":2867},{"style":270},[2868],{"type":53,"value":2730},{"type":47,"tag":257,"props":2870,"children":2871},{"style":281},[2872],{"type":53,"value":444},{"type":47,"tag":55,"props":2874,"children":2875},{},[2876,2878,2884,2885,2891,2892,2898],{"type":53,"value":2877},"Non-secret identifiers injected by the platform are fine and should not match an allowlist (e.g., ",{"type":47,"tag":103,"props":2879,"children":2881},{"className":2880},[],[2882],{"type":53,"value":2883},"MEMORY_*_ID",{"type":53,"value":1596},{"type":47,"tag":103,"props":2886,"children":2888},{"className":2887},[],[2889],{"type":53,"value":2890},"AGENTCORE_GATEWAY_*_URL",{"type":53,"value":1596},{"type":47,"tag":103,"props":2893,"children":2895},{"className":2894},[],[2896],{"type":53,"value":2897},"AWS_REGION",{"type":53,"value":2899},", downstream agent ARNs). Review hits and confirm none are secrets.",{"type":47,"tag":55,"props":2901,"children":2902},{},[2903,2908,2910,2916],{"type":47,"tag":240,"props":2904,"children":2905},{},[2906],{"type":53,"value":2907},"Correct pattern:",{"type":53,"value":2909}," Register each outbound credential with ",{"type":47,"tag":103,"props":2911,"children":2913},{"className":2912},[],[2914],{"type":53,"value":2915},"agentcore add credential",{"type":53,"value":2917},", then fetch it in code via the integrated credential providers:",{"type":47,"tag":246,"props":2919,"children":2921},{"className":2280,"code":2920,"language":2282,"meta":251,"style":251},"from bedrock_agentcore.identity.auth import requires_api_key, requires_access_token\n\n@requires_api_key(provider_name=\"MyAPI\")\ndef call_api(payload: dict, *, api_key: str) -> dict:\n    ...\n\n@requires_access_token(provider_name=\"MyOAuthProvider\", scopes=[\"read\"], auth_flow=\"M2M\")\nasync def call_downstream(data: dict, *, access_token: str) -> dict:\n    ...\n",[2922],{"type":47,"tag":103,"props":2923,"children":2924},{"__ignoreMap":251},[2925,2933,2940,2948,2956,2964,2971,2979,2987],{"type":47,"tag":257,"props":2926,"children":2927},{"class":259,"line":260},[2928],{"type":47,"tag":257,"props":2929,"children":2930},{},[2931],{"type":53,"value":2932},"from bedrock_agentcore.identity.auth import requires_api_key, requires_access_token\n",{"type":47,"tag":257,"props":2934,"children":2935},{"class":259,"line":337},[2936],{"type":47,"tag":257,"props":2937,"children":2938},{"emptyLinePlaceholder":2300},[2939],{"type":53,"value":2303},{"type":47,"tag":257,"props":2941,"children":2942},{"class":259,"line":381},[2943],{"type":47,"tag":257,"props":2944,"children":2945},{},[2946],{"type":53,"value":2947},"@requires_api_key(provider_name=\"MyAPI\")\n",{"type":47,"tag":257,"props":2949,"children":2950},{"class":259,"line":407},[2951],{"type":47,"tag":257,"props":2952,"children":2953},{},[2954],{"type":53,"value":2955},"def call_api(payload: dict, *, api_key: str) -> dict:\n",{"type":47,"tag":257,"props":2957,"children":2958},{"class":259,"line":429},[2959],{"type":47,"tag":257,"props":2960,"children":2961},{},[2962],{"type":53,"value":2963},"    ...\n",{"type":47,"tag":257,"props":2965,"children":2966},{"class":259,"line":447},[2967],{"type":47,"tag":257,"props":2968,"children":2969},{"emptyLinePlaceholder":2300},[2970],{"type":53,"value":2303},{"type":47,"tag":257,"props":2972,"children":2973},{"class":259,"line":456},[2974],{"type":47,"tag":257,"props":2975,"children":2976},{},[2977],{"type":53,"value":2978},"@requires_access_token(provider_name=\"MyOAuthProvider\", scopes=[\"read\"], auth_flow=\"M2M\")\n",{"type":47,"tag":257,"props":2980,"children":2981},{"class":259,"line":481},[2982],{"type":47,"tag":257,"props":2983,"children":2984},{},[2985],{"type":53,"value":2986},"async def call_downstream(data: dict, *, access_token: str) -> dict:\n",{"type":47,"tag":257,"props":2988,"children":2989},{"class":259,"line":498},[2990],{"type":47,"tag":257,"props":2991,"children":2992},{},[2993],{"type":53,"value":2963},{"type":47,"tag":55,"props":2995,"children":2996},{},[2997],{"type":53,"value":2998},"The decorator fetches from Secrets Manager at call time and handles caching\u002Frefresh. Credentials registered this way are encrypted at rest and rotated without a redeploy.",{"type":47,"tag":55,"props":3000,"children":3001},{},[3002,3007,3009,3015,3017,3023,3025,3029],{"type":47,"tag":240,"props":3003,"children":3004},{},[3005],{"type":53,"value":3006},"Local dev:",{"type":53,"value":3008}," ",{"type":47,"tag":103,"props":3010,"children":3012},{"className":3011},[],[3013],{"type":53,"value":3014},"agentcore\u002F.env.local",{"type":53,"value":3016}," (gitignored) is read by ",{"type":47,"tag":103,"props":3018,"children":3020},{"className":3019},[],[3021],{"type":53,"value":3022},"agentcore dev",{"type":53,"value":3024}," so the decorator resolves locally. This file is ",{"type":47,"tag":240,"props":3026,"children":3027},{},[3028],{"type":53,"value":2802},{"type":53,"value":3030}," uploaded to runtime on deploy — production credentials live in the credential provider.",{"type":47,"tag":214,"props":3032,"children":3033},{},[],{"type":47,"tag":61,"props":3035,"children":3037},{"id":3036},"tool-surface-prefer-gateway-targets-over-direct-http-in-agent-code",[3038],{"type":53,"value":3039},"Tool surface: Prefer Gateway targets over direct HTTP in agent code",{"type":47,"tag":55,"props":3041,"children":3042},{},[3043],{"type":53,"value":3044},"A related audit — for every external service the agent calls, ask whether it should be a Gateway target instead of a direct HTTP call buried in agent code. Gateway's credential providers inject auth at the edge (so the agent process never sees the secret), the tool catalog is policy-enforceable, and a leaked traceback\u002Flog line from agent code can't exfiltrate credentials that never reached it.",{"type":47,"tag":246,"props":3046,"children":3048},{"className":248,"code":3047,"language":250,"meta":251,"style":251},"# Find direct outbound HTTP calls in agent code\ngrep -rEn 'httpx\\.|requests\\.|aiohttp\\.' app\u002F --include=\"*.py\"\n",[3049],{"type":47,"tag":103,"props":3050,"children":3051},{"__ignoreMap":251},[3052,3060],{"type":47,"tag":257,"props":3053,"children":3054},{"class":259,"line":260},[3055],{"type":47,"tag":257,"props":3056,"children":3057},{"style":1064},[3058],{"type":53,"value":3059},"# Find direct outbound HTTP calls in agent code\n",{"type":47,"tag":257,"props":3061,"children":3062},{"class":259,"line":337},[3063,3067,3072,3076,3081,3085,3089,3093,3097,3101],{"type":47,"tag":257,"props":3064,"children":3065},{"style":264},[3066],{"type":53,"value":2684},{"type":47,"tag":257,"props":3068,"children":3069},{"style":270},[3070],{"type":53,"value":3071}," -rEn",{"type":47,"tag":257,"props":3073,"children":3074},{"style":281},[3075],{"type":53,"value":299},{"type":47,"tag":257,"props":3077,"children":3078},{"style":270},[3079],{"type":53,"value":3080},"httpx\\.|requests\\.|aiohttp\\.",{"type":47,"tag":257,"props":3082,"children":3083},{"style":281},[3084],{"type":53,"value":1122},{"type":47,"tag":257,"props":3086,"children":3087},{"style":270},[3088],{"type":53,"value":2716},{"type":47,"tag":257,"props":3090,"children":3091},{"style":270},[3092],{"type":53,"value":2721},{"type":47,"tag":257,"props":3094,"children":3095},{"style":281},[3096],{"type":53,"value":354},{"type":47,"tag":257,"props":3098,"children":3099},{"style":270},[3100],{"type":53,"value":2730},{"type":47,"tag":257,"props":3102,"children":3103},{"style":281},[3104],{"type":53,"value":444},{"type":47,"tag":55,"props":3106,"children":3107},{},[3108],{"type":53,"value":3109},"For each hit, decide:",{"type":47,"tag":3111,"props":3112,"children":3113},"table",{},[3114,3132],{"type":47,"tag":3115,"props":3116,"children":3117},"thead",{},[3118],{"type":47,"tag":3119,"props":3120,"children":3121},"tr",{},[3122,3128],{"type":47,"tag":3123,"props":3124,"children":3125},"th",{},[3126],{"type":53,"value":3127},"Hit looks like",{"type":47,"tag":3123,"props":3129,"children":3130},{},[3131],{"type":53,"value":391},{"type":47,"tag":3133,"props":3134,"children":3135},"tbody",{},[3136,3178,3207,3249,3278,3299],{"type":47,"tag":3119,"props":3137,"children":3138},{},[3139,3145],{"type":47,"tag":3140,"props":3141,"children":3142},"td",{},[3143],{"type":53,"value":3144},"Calls an external REST API the agent treats as a tool",{"type":47,"tag":3140,"props":3146,"children":3147},{},[3148,3150,3156,3158,3164,3166,3176],{"type":53,"value":3149},"Front as a Gateway target (",{"type":47,"tag":103,"props":3151,"children":3153},{"className":3152},[],[3154],{"type":53,"value":3155},"agentcore add gateway-target --type open-api-schema",{"type":53,"value":3157}," or ",{"type":47,"tag":103,"props":3159,"children":3161},{"className":3160},[],[3162],{"type":53,"value":3163},"api-gateway",{"type":53,"value":3165},"). Load ",{"type":47,"tag":98,"props":3167,"children":3169},{"href":3168},"..\u002Fagents-connect\u002FSKILL.md",[3170],{"type":47,"tag":103,"props":3171,"children":3173},{"className":3172},[],[3174],{"type":53,"value":3175},"agents-connect\u002FSKILL.md",{"type":53,"value":3177}," Path C.",{"type":47,"tag":3119,"props":3179,"children":3180},{},[3181,3186],{"type":47,"tag":3140,"props":3182,"children":3183},{},[3184],{"type":53,"value":3185},"Calls an MCP server directly",{"type":47,"tag":3140,"props":3187,"children":3188},{},[3189,3190,3196,3197,3205],{"type":53,"value":3149},{"type":47,"tag":103,"props":3191,"children":3193},{"className":3192},[],[3194],{"type":53,"value":3195},"--type mcp-server",{"type":53,"value":3165},{"type":47,"tag":98,"props":3198,"children":3199},{"href":3168},[3200],{"type":47,"tag":103,"props":3201,"children":3203},{"className":3202},[],[3204],{"type":53,"value":3175},{"type":53,"value":3206}," Path A.",{"type":47,"tag":3119,"props":3208,"children":3209},{},[3210,3221],{"type":47,"tag":3140,"props":3211,"children":3212},{},[3213,3215],{"type":53,"value":3214},"Calls an AWS service (S3, DynamoDB, etc.) — not appropriate to match this row, should be ",{"type":47,"tag":103,"props":3216,"children":3218},{"className":3217},[],[3219],{"type":53,"value":3220},"boto3",{"type":47,"tag":3140,"props":3222,"children":3223},{},[3224,3226,3232,3234,3240,3242,3247],{"type":53,"value":3225},"Migrate from ",{"type":47,"tag":103,"props":3227,"children":3229},{"className":3228},[],[3230],{"type":53,"value":3231},"requests",{"type":53,"value":3233},"\u002F",{"type":47,"tag":103,"props":3235,"children":3237},{"className":3236},[],[3238],{"type":53,"value":3239},"httpx",{"type":53,"value":3241}," to the ",{"type":47,"tag":103,"props":3243,"children":3245},{"className":3244},[],[3246],{"type":53,"value":3220},{"type":53,"value":3248}," client, using the runtime's execution role for IAM. No credential needed.",{"type":47,"tag":3119,"props":3250,"children":3251},{},[3252,3257],{"type":47,"tag":3140,"props":3253,"children":3254},{},[3255],{"type":53,"value":3256},"Calls a streaming service (SSE-with-live-output, WebSocket, WebRTC)",{"type":47,"tag":3140,"props":3258,"children":3259},{},[3260,3262,3268,3270,3276],{"type":53,"value":3261},"OK to keep direct — Gateway doesn't front these yet. Confirm any auth uses ",{"type":47,"tag":103,"props":3263,"children":3265},{"className":3264},[],[3266],{"type":53,"value":3267},"@requires_*",{"type":53,"value":3269},", not ",{"type":47,"tag":103,"props":3271,"children":3273},{"className":3272},[],[3274],{"type":53,"value":3275},"os.getenv",{"type":53,"value":3277},".",{"type":47,"tag":3119,"props":3279,"children":3280},{},[3281,3286],{"type":47,"tag":3140,"props":3282,"children":3283},{},[3284],{"type":53,"value":3285},"Calls another agent via A2A",{"type":47,"tag":3140,"props":3287,"children":3288},{},[3289,3291,3297],{"type":53,"value":3290},"OK to keep direct — A2A is HTTP-by-design. Confirm it uses ",{"type":47,"tag":103,"props":3292,"children":3294},{"className":3293},[],[3295],{"type":53,"value":3296},"@requires_access_token",{"type":53,"value":3298}," for the bearer token.",{"type":47,"tag":3119,"props":3300,"children":3301},{},[3302,3307],{"type":47,"tag":3140,"props":3303,"children":3304},{},[3305],{"type":53,"value":3306},"Calls a measured latency hot path and the team chose it",{"type":47,"tag":3140,"props":3308,"children":3309},{},[3310,3312,3317],{"type":53,"value":3311},"OK, but confirm measurement exists and auth uses ",{"type":47,"tag":103,"props":3313,"children":3315},{"className":3314},[],[3316],{"type":53,"value":3267},{"type":53,"value":3277},{"type":47,"tag":55,"props":3319,"children":3320},{},[3321],{"type":53,"value":3322},"If the hit fits none of the \"OK to keep direct\" rows, open a ticket to convert it to a Gateway target. Gateway targets can be added without a code change in the agent for most framework integrations (MCP tool discovery handles binding).",{"type":47,"tag":214,"props":3324,"children":3325},{},[],{"type":47,"tag":61,"props":3327,"children":3329},{"id":3328},"observability-verify-tracing-is-enabled",[3330],{"type":53,"value":3331},"Observability: Verify tracing is enabled",{"type":47,"tag":55,"props":3333,"children":3334},{},[3335],{"type":53,"value":3336},"AgentCore enables X-Ray tracing and CloudWatch logging automatically. Verify:",{"type":47,"tag":246,"props":3338,"children":3340},{"className":248,"code":3339,"language":250,"meta":251,"style":251},"agentcore status --runtime \u003CAgentName> --json | jq '.runtimes[0].observabilityConfig'\n",[3341],{"type":47,"tag":103,"props":3342,"children":3343},{"__ignoreMap":251},[3344],{"type":47,"tag":257,"props":3345,"children":3346},{"class":259,"line":260},[3347,3351,3355,3359,3363,3367,3371,3375,3379,3383,3387,3391,3396],{"type":47,"tag":257,"props":3348,"children":3349},{"style":264},[3350],{"type":53,"value":267},{"type":47,"tag":257,"props":3352,"children":3353},{"style":270},[3354],{"type":53,"value":273},{"type":47,"tag":257,"props":3356,"children":3357},{"style":270},[3358],{"type":53,"value":1664},{"type":47,"tag":257,"props":3360,"children":3361},{"style":281},[3362],{"type":53,"value":1180},{"type":47,"tag":257,"props":3364,"children":3365},{"style":270},[3366],{"type":53,"value":1673},{"type":47,"tag":257,"props":3368,"children":3369},{"style":1097},[3370],{"type":53,"value":1678},{"type":47,"tag":257,"props":3372,"children":3373},{"style":281},[3374],{"type":53,"value":1195},{"type":47,"tag":257,"props":3376,"children":3377},{"style":270},[3378],{"type":53,"value":278},{"type":47,"tag":257,"props":3380,"children":3381},{"style":281},[3382],{"type":53,"value":284},{"type":47,"tag":257,"props":3384,"children":3385},{"style":264},[3386],{"type":53,"value":289},{"type":47,"tag":257,"props":3388,"children":3389},{"style":281},[3390],{"type":53,"value":299},{"type":47,"tag":257,"props":3392,"children":3393},{"style":270},[3394],{"type":53,"value":3395},".runtimes[0].observabilityConfig",{"type":47,"tag":257,"props":3397,"children":3398},{"style":281},[3399],{"type":53,"value":309},{"type":47,"tag":55,"props":3401,"children":3402},{},[3403,3408],{"type":47,"tag":240,"props":3404,"children":3405},{},[3406],{"type":53,"value":3407},"CloudWatch dashboard:",{"type":53,"value":3409}," AWS Console → CloudWatch → GenAI Observability → Bedrock AgentCore",{"type":47,"tag":55,"props":3411,"children":3412},{},[3413,3418],{"type":47,"tag":240,"props":3414,"children":3415},{},[3416],{"type":53,"value":3417},"Log retention:",{"type":53,"value":3419}," By default, logs are retained indefinitely. Set a retention policy for cost control:",{"type":47,"tag":246,"props":3421,"children":3423},{"className":248,"code":3422,"language":250,"meta":251,"style":251},"aws logs put-retention-policy \\\n  --log-group-name \u002Faws\u002Fbedrock-agentcore\u002Fruntimes\u002F\u003CAGENT_ID>-DEFAULT \\\n  --retention-in-days 30\n",[3424],{"type":47,"tag":103,"props":3425,"children":3426},{"__ignoreMap":251},[3427,3448,3488],{"type":47,"tag":257,"props":3428,"children":3429},{"class":259,"line":260},[3430,3434,3439,3444],{"type":47,"tag":257,"props":3431,"children":3432},{"style":264},[3433],{"type":53,"value":8},{"type":47,"tag":257,"props":3435,"children":3436},{"style":270},[3437],{"type":53,"value":3438}," logs",{"type":47,"tag":257,"props":3440,"children":3441},{"style":270},[3442],{"type":53,"value":3443}," put-retention-policy",{"type":47,"tag":257,"props":3445,"children":3446},{"style":1097},[3447],{"type":53,"value":1100},{"type":47,"tag":257,"props":3449,"children":3450},{"class":259,"line":337},[3451,3456,3461,3466,3471,3475,3479,3484],{"type":47,"tag":257,"props":3452,"children":3453},{"style":270},[3454],{"type":53,"value":3455},"  --log-group-name",{"type":47,"tag":257,"props":3457,"children":3458},{"style":270},[3459],{"type":53,"value":3460}," \u002Faws\u002Fbedrock-agentcore\u002Fruntimes\u002F",{"type":47,"tag":257,"props":3462,"children":3463},{"style":281},[3464],{"type":53,"value":3465},"\u003C",{"type":47,"tag":257,"props":3467,"children":3468},{"style":270},[3469],{"type":53,"value":3470},"AGENT_I",{"type":47,"tag":257,"props":3472,"children":3473},{"style":1097},[3474],{"type":53,"value":1221},{"type":47,"tag":257,"props":3476,"children":3477},{"style":281},[3478],{"type":53,"value":1195},{"type":47,"tag":257,"props":3480,"children":3481},{"style":270},[3482],{"type":53,"value":3483},"-DEFAULT",{"type":47,"tag":257,"props":3485,"children":3486},{"style":1097},[3487],{"type":53,"value":1100},{"type":47,"tag":257,"props":3489,"children":3490},{"class":259,"line":381},[3491,3496],{"type":47,"tag":257,"props":3492,"children":3493},{"style":270},[3494],{"type":53,"value":3495},"  --retention-in-days",{"type":47,"tag":257,"props":3497,"children":3498},{"style":852},[3499],{"type":53,"value":3500}," 30\n",{"type":47,"tag":214,"props":3502,"children":3503},{},[],{"type":47,"tag":61,"props":3505,"children":3507},{"id":3506},"evaluation-baseline-know-your-quality-before-launch",[3508],{"type":53,"value":3509},"Evaluation baseline: Know your quality before launch",{"type":47,"tag":55,"props":3511,"children":3512},{},[3513],{"type":53,"value":3514},"Before going to production, establish a quality baseline so you can detect regressions:",{"type":47,"tag":246,"props":3516,"children":3518},{"className":248,"code":3517,"language":250,"meta":251,"style":251},"# Run a baseline eval\nagentcore run eval \\\n  --evaluator \"Builtin.Helpfulness\" \\\n  --evaluator \"Builtin.GoalSuccessRate\"\n\n# Set up continuous monitoring\nagentcore add online-eval \\\n  --name production_monitor \\\n  --runtime \u003CAgentName> \\\n  --evaluator \"Builtin.Helpfulness\" \\\n  --sampling-rate 5\nagentcore deploy -y\n",[3519],{"type":47,"tag":103,"props":3520,"children":3521},{"__ignoreMap":251},[3522,3530,3551,3576,3596,3603,3611,3631,3647,3675,3698,3711],{"type":47,"tag":257,"props":3523,"children":3524},{"class":259,"line":260},[3525],{"type":47,"tag":257,"props":3526,"children":3527},{"style":1064},[3528],{"type":53,"value":3529},"# Run a baseline eval\n",{"type":47,"tag":257,"props":3531,"children":3532},{"class":259,"line":337},[3533,3537,3542,3547],{"type":47,"tag":257,"props":3534,"children":3535},{"style":264},[3536],{"type":53,"value":267},{"type":47,"tag":257,"props":3538,"children":3539},{"style":270},[3540],{"type":53,"value":3541}," run",{"type":47,"tag":257,"props":3543,"children":3544},{"style":270},[3545],{"type":53,"value":3546}," eval",{"type":47,"tag":257,"props":3548,"children":3549},{"style":1097},[3550],{"type":53,"value":1100},{"type":47,"tag":257,"props":3552,"children":3553},{"class":259,"line":381},[3554,3559,3563,3568,3572],{"type":47,"tag":257,"props":3555,"children":3556},{"style":270},[3557],{"type":53,"value":3558},"  --evaluator",{"type":47,"tag":257,"props":3560,"children":3561},{"style":281},[3562],{"type":53,"value":364},{"type":47,"tag":257,"props":3564,"children":3565},{"style":270},[3566],{"type":53,"value":3567},"Builtin.Helpfulness",{"type":47,"tag":257,"props":3569,"children":3570},{"style":281},[3571],{"type":53,"value":354},{"type":47,"tag":257,"props":3573,"children":3574},{"style":1097},[3575],{"type":53,"value":1100},{"type":47,"tag":257,"props":3577,"children":3578},{"class":259,"line":407},[3579,3583,3587,3592],{"type":47,"tag":257,"props":3580,"children":3581},{"style":270},[3582],{"type":53,"value":3558},{"type":47,"tag":257,"props":3584,"children":3585},{"style":281},[3586],{"type":53,"value":364},{"type":47,"tag":257,"props":3588,"children":3589},{"style":270},[3590],{"type":53,"value":3591},"Builtin.GoalSuccessRate",{"type":47,"tag":257,"props":3593,"children":3594},{"style":281},[3595],{"type":53,"value":444},{"type":47,"tag":257,"props":3597,"children":3598},{"class":259,"line":429},[3599],{"type":47,"tag":257,"props":3600,"children":3601},{"emptyLinePlaceholder":2300},[3602],{"type":53,"value":2303},{"type":47,"tag":257,"props":3604,"children":3605},{"class":259,"line":447},[3606],{"type":47,"tag":257,"props":3607,"children":3608},{"style":1064},[3609],{"type":53,"value":3610},"# Set up continuous monitoring\n",{"type":47,"tag":257,"props":3612,"children":3613},{"class":259,"line":456},[3614,3618,3622,3627],{"type":47,"tag":257,"props":3615,"children":3616},{"style":264},[3617],{"type":53,"value":267},{"type":47,"tag":257,"props":3619,"children":3620},{"style":270},[3621],{"type":53,"value":1756},{"type":47,"tag":257,"props":3623,"children":3624},{"style":270},[3625],{"type":53,"value":3626}," online-eval",{"type":47,"tag":257,"props":3628,"children":3629},{"style":1097},[3630],{"type":53,"value":1100},{"type":47,"tag":257,"props":3632,"children":3633},{"class":259,"line":481},[3634,3638,3643],{"type":47,"tag":257,"props":3635,"children":3636},{"style":270},[3637],{"type":53,"value":1531},{"type":47,"tag":257,"props":3639,"children":3640},{"style":270},[3641],{"type":53,"value":3642}," production_monitor",{"type":47,"tag":257,"props":3644,"children":3645},{"style":1097},[3646],{"type":53,"value":1100},{"type":47,"tag":257,"props":3648,"children":3649},{"class":259,"line":498},[3650,3655,3659,3663,3667,3671],{"type":47,"tag":257,"props":3651,"children":3652},{"style":270},[3653],{"type":53,"value":3654},"  --runtime",{"type":47,"tag":257,"props":3656,"children":3657},{"style":281},[3658],{"type":53,"value":1180},{"type":47,"tag":257,"props":3660,"children":3661},{"style":270},[3662],{"type":53,"value":1673},{"type":47,"tag":257,"props":3664,"children":3665},{"style":1097},[3666],{"type":53,"value":1678},{"type":47,"tag":257,"props":3668,"children":3669},{"style":281},[3670],{"type":53,"value":1195},{"type":47,"tag":257,"props":3672,"children":3673},{"style":1097},[3674],{"type":53,"value":1100},{"type":47,"tag":257,"props":3676,"children":3677},{"class":259,"line":507},[3678,3682,3686,3690,3694],{"type":47,"tag":257,"props":3679,"children":3680},{"style":270},[3681],{"type":53,"value":3558},{"type":47,"tag":257,"props":3683,"children":3684},{"style":281},[3685],{"type":53,"value":364},{"type":47,"tag":257,"props":3687,"children":3688},{"style":270},[3689],{"type":53,"value":3567},{"type":47,"tag":257,"props":3691,"children":3692},{"style":281},[3693],{"type":53,"value":354},{"type":47,"tag":257,"props":3695,"children":3696},{"style":1097},[3697],{"type":53,"value":1100},{"type":47,"tag":257,"props":3699,"children":3700},{"class":259,"line":2369},[3701,3706],{"type":47,"tag":257,"props":3702,"children":3703},{"style":270},[3704],{"type":53,"value":3705},"  --sampling-rate",{"type":47,"tag":257,"props":3707,"children":3708},{"style":852},[3709],{"type":53,"value":3710}," 5\n",{"type":47,"tag":257,"props":3712,"children":3713},{"class":259,"line":2378},[3714,3718,3723],{"type":47,"tag":257,"props":3715,"children":3716},{"style":264},[3717],{"type":53,"value":267},{"type":47,"tag":257,"props":3719,"children":3720},{"style":270},[3721],{"type":53,"value":3722}," deploy",{"type":47,"tag":257,"props":3724,"children":3725},{"style":270},[3726],{"type":53,"value":3727}," -y\n",{"type":47,"tag":55,"props":3729,"children":3730},{},[3731],{"type":53,"value":3732},"Record the baseline scores. If scores drop significantly after a change, investigate before continuing.",{"type":47,"tag":214,"props":3734,"children":3735},{},[],{"type":47,"tag":61,"props":3737,"children":3739},{"id":3738},"network-vpc-for-private-resources",[3740],{"type":53,"value":3741},"Network: VPC for private resources",{"type":47,"tag":55,"props":3743,"children":3744},{},[3745],{"type":53,"value":3746},"If your agent accesses private AWS resources (RDS, internal APIs), configure VPC:",{"type":47,"tag":246,"props":3748,"children":3750},{"className":248,"code":3749,"language":250,"meta":251,"style":251},"agentcore add agent \\\n  --name MyAgent \\\n  --network-mode VPC \\\n  --subnets subnet-abc,subnet-def \\\n  --security-groups sg-123\n",[3751],{"type":47,"tag":103,"props":3752,"children":3753},{"__ignoreMap":251},[3754,3773,3788,3805,3822],{"type":47,"tag":257,"props":3755,"children":3756},{"class":259,"line":260},[3757,3761,3765,3769],{"type":47,"tag":257,"props":3758,"children":3759},{"style":264},[3760],{"type":53,"value":267},{"type":47,"tag":257,"props":3762,"children":3763},{"style":270},[3764],{"type":53,"value":1756},{"type":47,"tag":257,"props":3766,"children":3767},{"style":270},[3768],{"type":53,"value":1761},{"type":47,"tag":257,"props":3770,"children":3771},{"style":1097},[3772],{"type":53,"value":1100},{"type":47,"tag":257,"props":3774,"children":3775},{"class":259,"line":337},[3776,3780,3784],{"type":47,"tag":257,"props":3777,"children":3778},{"style":270},[3779],{"type":53,"value":1531},{"type":47,"tag":257,"props":3781,"children":3782},{"style":270},[3783],{"type":53,"value":1777},{"type":47,"tag":257,"props":3785,"children":3786},{"style":1097},[3787],{"type":53,"value":1100},{"type":47,"tag":257,"props":3789,"children":3790},{"class":259,"line":381},[3791,3796,3801],{"type":47,"tag":257,"props":3792,"children":3793},{"style":270},[3794],{"type":53,"value":3795},"  --network-mode",{"type":47,"tag":257,"props":3797,"children":3798},{"style":270},[3799],{"type":53,"value":3800}," VPC",{"type":47,"tag":257,"props":3802,"children":3803},{"style":1097},[3804],{"type":53,"value":1100},{"type":47,"tag":257,"props":3806,"children":3807},{"class":259,"line":407},[3808,3813,3818],{"type":47,"tag":257,"props":3809,"children":3810},{"style":270},[3811],{"type":53,"value":3812},"  --subnets",{"type":47,"tag":257,"props":3814,"children":3815},{"style":270},[3816],{"type":53,"value":3817}," subnet-abc,subnet-def",{"type":47,"tag":257,"props":3819,"children":3820},{"style":1097},[3821],{"type":53,"value":1100},{"type":47,"tag":257,"props":3823,"children":3824},{"class":259,"line":429},[3825,3830],{"type":47,"tag":257,"props":3826,"children":3827},{"style":270},[3828],{"type":53,"value":3829},"  --security-groups",{"type":47,"tag":257,"props":3831,"children":3832},{"style":270},[3833],{"type":53,"value":3834}," sg-123\n",{"type":47,"tag":55,"props":3836,"children":3837},{},[3838,3840,3846,3848,3858],{"type":53,"value":3839},"See ",{"type":47,"tag":103,"props":3841,"children":3843},{"className":3842},[],[3844],{"type":53,"value":3845},"agents-build",{"type":53,"value":3847}," (loads ",{"type":47,"tag":98,"props":3849,"children":3851},{"href":3850},"..\u002Fagents-build\u002Freferences\u002Fvpc.md",[3852],{"type":47,"tag":103,"props":3853,"children":3855},{"className":3854},[],[3856],{"type":53,"value":3857},"references\u002Fvpc.md",{"type":53,"value":3859},") for full VPC configuration guidance.",{"type":47,"tag":214,"props":3861,"children":3862},{},[],{"type":47,"tag":61,"props":3864,"children":3866},{"id":3865},"initialization-time-optimize-cold-start-performance",[3867],{"type":53,"value":3868},"Initialization time: Optimize cold start performance",{"type":47,"tag":55,"props":3870,"children":3871},{},[3872],{"type":53,"value":3873},"Slow agent initialization causes timeouts, 424 errors, and poor user experience — especially on first invocation after a period of inactivity. Everything the agent does before it's ready to handle a request adds to the time users wait.",{"type":47,"tag":138,"props":3875,"children":3877},{"id":3876},"where-cold-start-time-actually-goes",[3878],{"type":53,"value":3879},"Where cold start time actually goes",{"type":47,"tag":55,"props":3881,"children":3882},{},[3883],{"type":53,"value":3884},"A typical cold start for a new environment takes around 20–30 seconds. The breakdown, roughly:",{"type":47,"tag":68,"props":3886,"children":3887},{},[3888,3898,3908],{"type":47,"tag":72,"props":3889,"children":3890},{},[3891,3896],{"type":47,"tag":240,"props":3892,"children":3893},{},[3894],{"type":53,"value":3895},"Container image pull",{"type":53,"value":3897}," — dominates for Container builds. A 100 MB image takes a few seconds; a 500 MB image can take 15+ seconds.",{"type":47,"tag":72,"props":3899,"children":3900},{},[3901,3906],{"type":47,"tag":240,"props":3902,"children":3903},{},[3904],{"type":53,"value":3905},"Application startup",{"type":53,"value":3907}," — your code's import time, framework init, module-level setup. Usually 5–10 seconds, can be much more if you're loading models or opening connections at import.",{"type":47,"tag":72,"props":3909,"children":3910},{},[3911,3916],{"type":47,"tag":240,"props":3912,"children":3913},{},[3914],{"type":53,"value":3915},"Platform overhead",{"type":53,"value":3917}," (microVM boot, network attach, container start) — sub-second to a couple of seconds.",{"type":47,"tag":55,"props":3919,"children":3920},{},[3921],{"type":53,"value":3922},"The two you control are image size and application startup. Optimizing either one directly reduces time to first response.",{"type":47,"tag":138,"props":3924,"children":3926},{"id":3925},"session-reuse-is-the-highest-leverage-optimization",[3927],{"type":53,"value":3928},"Session reuse is the highest-leverage optimization",{"type":47,"tag":55,"props":3930,"children":3931},{},[3932],{"type":53,"value":3933},"Same-session requests route to an existing initialized environment — no cold start. The first request per session pays the cold-start cost; every subsequent request on that session is fast.",{"type":47,"tag":55,"props":3935,"children":3936},{},[3937],{"type":53,"value":3938},"Concrete patterns:",{"type":47,"tag":68,"props":3940,"children":3941},{},[3942,3960,3976],{"type":47,"tag":72,"props":3943,"children":3944},{},[3945,3950,3952,3958],{"type":47,"tag":240,"props":3946,"children":3947},{},[3948],{"type":53,"value":3949},"Multi-turn conversations:",{"type":53,"value":3951}," reuse the same ",{"type":47,"tag":103,"props":3953,"children":3955},{"className":3954},[],[3956],{"type":53,"value":3957},"session_id",{"type":53,"value":3959}," across turns. Don't generate a new UUID per turn.",{"type":47,"tag":72,"props":3961,"children":3962},{},[3963,3968,3969,3974],{"type":47,"tag":240,"props":3964,"children":3965},{},[3966],{"type":53,"value":3967},"Batch processing:",{"type":53,"value":3951},{"type":47,"tag":103,"props":3970,"children":3972},{"className":3971},[],[3973],{"type":53,"value":3957},{"type":53,"value":3975}," across items in the batch.",{"type":47,"tag":72,"props":3977,"children":3978},{},[3979,3984],{"type":47,"tag":240,"props":3980,"children":3981},{},[3982],{"type":53,"value":3983},"User-facing apps:",{"type":53,"value":3985}," scope a session to a user interaction (e.g., one session per chat conversation), not one session per message.",{"type":47,"tag":55,"props":3987,"children":3988},{},[3989,3991,3996,3998,4004,4006,4012],{"type":53,"value":3990},"Cross-SDK note: if you're using MCP, pass ",{"type":47,"tag":240,"props":3992,"children":3993},{},[3994],{"type":53,"value":3995},"one",{"type":53,"value":3997}," session identifier, not both ",{"type":47,"tag":103,"props":3999,"children":4001},{"className":4000},[],[4002],{"type":53,"value":4003},"runtimeSessionId",{"type":53,"value":4005}," and ",{"type":47,"tag":103,"props":4007,"children":4009},{"className":4008},[],[4010],{"type":53,"value":4011},"mcpSessionId",{"type":53,"value":4013}," at once. Sending both can cause the platform to bind two separate environments to the same logical session, doubling cold-start cost.",{"type":47,"tag":138,"props":4015,"children":4017},{"id":4016},"package-size-budget",[4018],{"type":53,"value":4019},"Package size budget",{"type":47,"tag":55,"props":4021,"children":4022},{},[4023],{"type":53,"value":4024},"Every MB of deployment package adds to cold-start time.",{"type":47,"tag":68,"props":4026,"children":4027},{},[4028,4038,4055,4103],{"type":47,"tag":72,"props":4029,"children":4030},{},[4031,4036],{"type":47,"tag":240,"props":4032,"children":4033},{},[4034],{"type":53,"value":4035},"Target:",{"type":53,"value":4037}," under 200 MB. Aim for under 100 MB if you can.",{"type":47,"tag":72,"props":4039,"children":4040},{},[4041,4046,4048,4054],{"type":47,"tag":240,"props":4042,"children":4043},{},[4044],{"type":53,"value":4045},"For Container builds:",{"type":53,"value":4047}," multi-stage Dockerfiles, slim or distroless base images, remove build tools and test files, add a ",{"type":47,"tag":103,"props":4049,"children":4051},{"className":4050},[],[4052],{"type":53,"value":4053},".dockerignore",{"type":53,"value":3277},{"type":47,"tag":72,"props":4056,"children":4057},{},[4058,4063,4065,4071,4073,4079,4081,4087,4088,4094,4095,4101],{"type":47,"tag":240,"props":4059,"children":4060},{},[4061],{"type":53,"value":4062},"For CodeZip builds:",{"type":53,"value":4064}," prune dev dependencies from ",{"type":47,"tag":103,"props":4066,"children":4068},{"className":4067},[],[4069],{"type":53,"value":4070},"pyproject.toml",{"type":53,"value":4072}," \u002F ",{"type":47,"tag":103,"props":4074,"children":4076},{"className":4075},[],[4077],{"type":53,"value":4078},"requirements.txt",{"type":53,"value":4080},". Don't ship ",{"type":47,"tag":103,"props":4082,"children":4084},{"className":4083},[],[4085],{"type":53,"value":4086},"tests\u002F",{"type":53,"value":1596},{"type":47,"tag":103,"props":4089,"children":4091},{"className":4090},[],[4092],{"type":53,"value":4093},"docs\u002F",{"type":53,"value":1596},{"type":47,"tag":103,"props":4096,"children":4098},{"className":4097},[],[4099],{"type":53,"value":4100},".git\u002F",{"type":53,"value":4102},", local caches.",{"type":47,"tag":72,"props":4104,"children":4105},{},[4106,4111,4112,4118,4120,4126],{"type":47,"tag":240,"props":4107,"children":4108},{},[4109],{"type":53,"value":4110},"Audit regularly:",{"type":53,"value":3008},{"type":47,"tag":103,"props":4113,"children":4115},{"className":4114},[],[4116],{"type":53,"value":4117},"pip list",{"type":53,"value":4119}," (Python) or ",{"type":47,"tag":103,"props":4121,"children":4123},{"className":4122},[],[4124],{"type":53,"value":4125},"npm ls",{"type":53,"value":4127}," (Node) will show you what's actually installed. Remove anything you're not using.",{"type":47,"tag":138,"props":4129,"children":4131},{"id":4130},"defer-heavy-initialization",[4132],{"type":53,"value":4133},"Defer heavy initialization",{"type":47,"tag":55,"props":4135,"children":4136},{},[4137],{"type":53,"value":4138},"Don't load large models, connect to databases, or initialize MCP clients at module import time. Every second spent in module import is a second the agent can't respond to requests.",{"type":47,"tag":246,"props":4140,"children":4142},{"className":2280,"code":4141,"language":2282,"meta":251,"style":251},"# ❌ Slow — runs at import time, before the agent can handle requests\nimport heavy_library\nclient = heavy_library.Client(config)\n\n# ✅ Fast — defers until first request\n_client = None\ndef get_client():\n    global _client\n    if _client is None:\n        import heavy_library\n        _client = heavy_library.Client(config)\n    return _client\n",[4143],{"type":47,"tag":103,"props":4144,"children":4145},{"__ignoreMap":251},[4146,4154,4162,4170,4177,4185,4193,4201,4209,4217,4225,4233],{"type":47,"tag":257,"props":4147,"children":4148},{"class":259,"line":260},[4149],{"type":47,"tag":257,"props":4150,"children":4151},{},[4152],{"type":53,"value":4153},"# ❌ Slow — runs at import time, before the agent can handle requests\n",{"type":47,"tag":257,"props":4155,"children":4156},{"class":259,"line":337},[4157],{"type":47,"tag":257,"props":4158,"children":4159},{},[4160],{"type":53,"value":4161},"import heavy_library\n",{"type":47,"tag":257,"props":4163,"children":4164},{"class":259,"line":381},[4165],{"type":47,"tag":257,"props":4166,"children":4167},{},[4168],{"type":53,"value":4169},"client = heavy_library.Client(config)\n",{"type":47,"tag":257,"props":4171,"children":4172},{"class":259,"line":407},[4173],{"type":47,"tag":257,"props":4174,"children":4175},{"emptyLinePlaceholder":2300},[4176],{"type":53,"value":2303},{"type":47,"tag":257,"props":4178,"children":4179},{"class":259,"line":429},[4180],{"type":47,"tag":257,"props":4181,"children":4182},{},[4183],{"type":53,"value":4184},"# ✅ Fast — defers until first request\n",{"type":47,"tag":257,"props":4186,"children":4187},{"class":259,"line":447},[4188],{"type":47,"tag":257,"props":4189,"children":4190},{},[4191],{"type":53,"value":4192},"_client = None\n",{"type":47,"tag":257,"props":4194,"children":4195},{"class":259,"line":456},[4196],{"type":47,"tag":257,"props":4197,"children":4198},{},[4199],{"type":53,"value":4200},"def get_client():\n",{"type":47,"tag":257,"props":4202,"children":4203},{"class":259,"line":481},[4204],{"type":47,"tag":257,"props":4205,"children":4206},{},[4207],{"type":53,"value":4208},"    global _client\n",{"type":47,"tag":257,"props":4210,"children":4211},{"class":259,"line":498},[4212],{"type":47,"tag":257,"props":4213,"children":4214},{},[4215],{"type":53,"value":4216},"    if _client is None:\n",{"type":47,"tag":257,"props":4218,"children":4219},{"class":259,"line":507},[4220],{"type":47,"tag":257,"props":4221,"children":4222},{},[4223],{"type":53,"value":4224},"        import heavy_library\n",{"type":47,"tag":257,"props":4226,"children":4227},{"class":259,"line":2369},[4228],{"type":47,"tag":257,"props":4229,"children":4230},{},[4231],{"type":53,"value":4232},"        _client = heavy_library.Client(config)\n",{"type":47,"tag":257,"props":4234,"children":4235},{"class":259,"line":2378},[4236],{"type":47,"tag":257,"props":4237,"children":4238},{},[4239],{"type":53,"value":4240},"    return _client\n",{"type":47,"tag":138,"props":4242,"children":4244},{"id":4243},"choose-deployment-type-based-on-traffic-pattern-not-by-default",[4245],{"type":53,"value":4246},"Choose deployment type based on traffic pattern, not by default",{"type":47,"tag":55,"props":4248,"children":4249},{},[4250],{"type":53,"value":4251},"The skill previously recommended CodeZip over Container when possible. That's an oversimplification. Here's the real trade-off:",{"type":47,"tag":68,"props":4253,"children":4254},{},[4255,4265],{"type":47,"tag":72,"props":4256,"children":4257},{},[4258,4263],{"type":47,"tag":240,"props":4259,"children":4260},{},[4261],{"type":53,"value":4262},"CodeZip:",{"type":53,"value":4264}," simpler to iterate on, smaller surface area. Cold start includes code download + extract — a ~95 MB package adds around 1.3 seconds of platform download before application startup even begins.",{"type":47,"tag":72,"props":4266,"children":4267},{},[4268,4273],{"type":47,"tag":240,"props":4269,"children":4270},{},[4271],{"type":53,"value":4272},"Container:",{"type":53,"value":4274}," you control the full image, needed for custom system dependencies. Larger images cost more per cold start, but you can optimize aggressively with multi-stage builds.",{"type":47,"tag":55,"props":4276,"children":4277},{},[4278],{"type":53,"value":4279},"Neither wins universally. Both benefit the same way from session reuse and from keeping the package small. If your traffic pattern has lots of bursty cold sessions, invest in shrinking whichever deployment artifact you're using. If your traffic pattern reuses sessions, the deployment type matters much less.",{"type":47,"tag":138,"props":4281,"children":4283},{"id":4282},"for-lambda-targets-behind-gateway",[4284],{"type":53,"value":4285},"For Lambda targets behind Gateway",{"type":47,"tag":55,"props":4287,"children":4288},{},[4289],{"type":53,"value":4290},"Use provisioned concurrency on the Lambda function to eliminate Lambda cold starts. This is separate from Runtime initialization — it's the Lambda itself that adds latency on first invocation of a cold Lambda.",{"type":47,"tag":214,"props":4292,"children":4293},{},[],{"type":47,"tag":61,"props":4295,"children":4297},{"id":4296},"session-lifecycle-management",[4298],{"type":53,"value":4299},"Session lifecycle management",{"type":47,"tag":55,"props":4301,"children":4302},{},[4303,4305,4311],{"type":53,"value":4304},"Session management is tightly linked to cost, performance, and the ",{"type":47,"tag":103,"props":4306,"children":4308},{"className":4307},[],[4309],{"type":53,"value":4310},"maxVms",{"type":53,"value":4312}," quota. Getting this right is often the difference between a smooth production launch and a quota-blocked one.",{"type":47,"tag":138,"props":4314,"children":4316},{"id":4315},"the-default-lifecycle",[4317],{"type":53,"value":4318},"The default lifecycle",{"type":47,"tag":55,"props":4320,"children":4321},{},[4322],{"type":53,"value":4323},"When a request arrives with a new session ID, the runtime initializes a fresh environment for it. That environment stays alive until one of:",{"type":47,"tag":2055,"props":4325,"children":4326},{},[4327,4344,4362],{"type":47,"tag":72,"props":4328,"children":4329},{},[4330,4335,4337,4343],{"type":47,"tag":240,"props":4331,"children":4332},{},[4333],{"type":53,"value":4334},"The session is explicitly stopped",{"type":53,"value":4336}," via ",{"type":47,"tag":103,"props":4338,"children":4340},{"className":4339},[],[4341],{"type":53,"value":4342},"StopRuntimeSession",{"type":53,"value":3277},{"type":47,"tag":72,"props":4345,"children":4346},{},[4347,4352,4354,4360],{"type":47,"tag":240,"props":4348,"children":4349},{},[4350],{"type":53,"value":4351},"The idle timeout expires.",{"type":53,"value":4353}," The runtime reclaims environments that haven't received a request for ",{"type":47,"tag":103,"props":4355,"children":4357},{"className":4356},[],[4358],{"type":53,"value":4359},"idleRuntimeSessionTimeout",{"type":53,"value":4361}," (default 900 seconds).",{"type":47,"tag":72,"props":4363,"children":4364},{},[4365,4370,4372,4378],{"type":47,"tag":240,"props":4366,"children":4367},{},[4368],{"type":53,"value":4369},"The maximum lifetime is reached",{"type":53,"value":4371}," (",{"type":47,"tag":103,"props":4373,"children":4375},{"className":4374},[],[4376],{"type":53,"value":4377},"maxLifetime",{"type":53,"value":4379},", default 8 hours).",{"type":47,"tag":55,"props":4381,"children":4382},{},[4383,4385,4390,4392,4397],{"type":53,"value":4384},"Idle environments count against your ",{"type":47,"tag":103,"props":4386,"children":4388},{"className":4387},[],[4389],{"type":53,"value":4310},{"type":53,"value":4391}," quota until they're reclaimed, even though they're not serving traffic. This is the #1 cause of unexpected ",{"type":47,"tag":103,"props":4393,"children":4395},{"className":4394},[],[4396],{"type":53,"value":4310},{"type":53,"value":4398}," errors.",{"type":47,"tag":138,"props":4400,"children":4402},{"id":4401},"pick-timeouts-by-workload-shape",[4403],{"type":53,"value":4404},"Pick timeouts by workload shape",{"type":47,"tag":55,"props":4406,"children":4407},{},[4408],{"type":53,"value":4409},"Don't leave defaults for production. Pick values that match how your workload actually uses sessions:",{"type":47,"tag":3111,"props":4411,"children":4412},{},[4413,4445],{"type":47,"tag":3115,"props":4414,"children":4415},{},[4416],{"type":47,"tag":3119,"props":4417,"children":4418},{},[4419,4424,4432,4440],{"type":47,"tag":3123,"props":4420,"children":4421},{},[4422],{"type":53,"value":4423},"Workload",{"type":47,"tag":3123,"props":4425,"children":4426},{},[4427],{"type":47,"tag":103,"props":4428,"children":4430},{"className":4429},[],[4431],{"type":53,"value":4359},{"type":47,"tag":3123,"props":4433,"children":4434},{},[4435],{"type":47,"tag":103,"props":4436,"children":4438},{"className":4437},[],[4439],{"type":53,"value":4377},{"type":47,"tag":3123,"props":4441,"children":4442},{},[4443],{"type":53,"value":4444},"Reasoning",{"type":47,"tag":3133,"props":4446,"children":4447},{},[4448,4471,4494,4517],{"type":47,"tag":3119,"props":4449,"children":4450},{},[4451,4456,4461,4466],{"type":47,"tag":3140,"props":4452,"children":4453},{},[4454],{"type":53,"value":4455},"Interactive chat \u002F support agent",{"type":47,"tag":3140,"props":4457,"children":4458},{},[4459],{"type":53,"value":4460},"600–900s (default)",{"type":47,"tag":3140,"props":4462,"children":4463},{},[4464],{"type":53,"value":4465},"3600–7200s",{"type":47,"tag":3140,"props":4467,"children":4468},{},[4469],{"type":53,"value":4470},"Users pause to read\u002Fthink. Reclaim fast after they leave.",{"type":47,"tag":3119,"props":4472,"children":4473},{},[4474,4479,4484,4489],{"type":47,"tag":3140,"props":4475,"children":4476},{},[4477],{"type":53,"value":4478},"Request\u002Freply API with no follow-up",{"type":47,"tag":3140,"props":4480,"children":4481},{},[4482],{"type":53,"value":4483},"60–120s",{"type":47,"tag":3140,"props":4485,"children":4486},{},[4487],{"type":53,"value":4488},"1800s",{"type":47,"tag":3140,"props":4490,"children":4491},{},[4492],{"type":53,"value":4493},"Each call is self-contained — release the VM quickly.",{"type":47,"tag":3119,"props":4495,"children":4496},{},[4497,4502,4507,4512],{"type":47,"tag":3140,"props":4498,"children":4499},{},[4500],{"type":53,"value":4501},"Batch processing, one session per job",{"type":47,"tag":3140,"props":4503,"children":4504},{},[4505],{"type":53,"value":4506},"120s",{"type":47,"tag":3140,"props":4508,"children":4509},{},[4510],{"type":53,"value":4511},"match job length + buffer",{"type":47,"tag":3140,"props":4513,"children":4514},{},[4515],{"type":53,"value":4516},"Idle gap between items in the batch is small; reclaim aggressively between jobs.",{"type":47,"tag":3119,"props":4518,"children":4519},{},[4520,4532,4537,4542],{"type":47,"tag":3140,"props":4521,"children":4522},{},[4523,4525,4531],{"type":53,"value":4524},"Background \u002F long-running tasks (use ",{"type":47,"tag":103,"props":4526,"children":4528},{"className":4527},[],[4529],{"type":53,"value":4530},"add_async_task",{"type":53,"value":109},{"type":47,"tag":3140,"props":4533,"children":4534},{},[4535],{"type":53,"value":4536},"120–300s",{"type":47,"tag":3140,"props":4538,"children":4539},{},[4540],{"type":53,"value":4541},"up to 28800s (8h)",{"type":47,"tag":3140,"props":4543,"children":4544},{},[4545],{"type":53,"value":4546},"Async task API keeps the VM alive during tracked work; idle timeout applies between tasks.",{"type":47,"tag":55,"props":4548,"children":4549},{},[4550],{"type":47,"tag":240,"props":4551,"children":4552},{},[4553],{"type":53,"value":4554},"Trade-offs at a glance:",{"type":47,"tag":68,"props":4556,"children":4557},{},[4558,4582,4605,4621],{"type":47,"tag":72,"props":4559,"children":4560},{},[4561,4566,4568,4573,4575,4580],{"type":47,"tag":240,"props":4562,"children":4563},{},[4564],{"type":53,"value":4565},"Low idle timeout",{"type":53,"value":4567}," = more headroom under ",{"type":47,"tag":103,"props":4569,"children":4571},{"className":4570},[],[4572],{"type":53,"value":4310},{"type":53,"value":4574},", lower cost. ",{"type":47,"tag":240,"props":4576,"children":4577},{},[4578],{"type":53,"value":4579},"Risk:",{"type":53,"value":4581}," reclaim mid-conversation causing next turn to cold-start.",{"type":47,"tag":72,"props":4583,"children":4584},{},[4585,4590,4592,4596,4598,4603],{"type":47,"tag":240,"props":4586,"children":4587},{},[4588],{"type":53,"value":4589},"High idle timeout",{"type":53,"value":4591}," = warm turns, lower latency. ",{"type":47,"tag":240,"props":4593,"children":4594},{},[4595],{"type":53,"value":4579},{"type":53,"value":4597}," idle VMs consume quota; ",{"type":47,"tag":103,"props":4599,"children":4601},{"className":4600},[],[4602],{"type":53,"value":4310},{"type":53,"value":4604}," errors on bursts.",{"type":47,"tag":72,"props":4606,"children":4607},{},[4608,4613,4615,4619],{"type":47,"tag":240,"props":4609,"children":4610},{},[4611],{"type":53,"value":4612},"Low max lifetime",{"type":53,"value":4614}," = predictable recycle, bounds memory leaks \u002F stale state. ",{"type":47,"tag":240,"props":4616,"children":4617},{},[4618],{"type":53,"value":4579},{"type":53,"value":4620}," active long sessions get killed mid-flow.",{"type":47,"tag":72,"props":4622,"children":4623},{},[4624,4629,4631,4635],{"type":47,"tag":240,"props":4625,"children":4626},{},[4627],{"type":53,"value":4628},"High max lifetime",{"type":53,"value":4630}," = sticky sessions, big warm-state savings. ",{"type":47,"tag":240,"props":4632,"children":4633},{},[4634],{"type":53,"value":4579},{"type":53,"value":4636}," drift, stale in-memory state, harder rollouts.",{"type":47,"tag":138,"props":4638,"children":4639},{"id":18},[4640],{"type":53,"value":4641},"Best practices",{"type":47,"tag":55,"props":4643,"children":4644},{},[4645,4657],{"type":47,"tag":240,"props":4646,"children":4647},{},[4648,4650,4655],{"type":53,"value":4649},"Call ",{"type":47,"tag":103,"props":4651,"children":4653},{"className":4652},[],[4654],{"type":53,"value":4342},{"type":53,"value":4656}," when the work is done.",{"type":53,"value":4658}," If your agent finishes a task and doesn't expect more requests on that session, explicitly stop it. This releases the environment immediately instead of waiting for idle timeout.",{"type":47,"tag":246,"props":4660,"children":4662},{"className":2280,"code":4661,"language":2282,"meta":251,"style":251},"# After your invocation logic completes and you know the session is done:\nclient.stop_runtime_session(\n    agentRuntimeArn=runtime_arn,\n    runtimeSessionId=session_id,\n)\n",[4663],{"type":47,"tag":103,"props":4664,"children":4665},{"__ignoreMap":251},[4666,4674,4682,4690,4698],{"type":47,"tag":257,"props":4667,"children":4668},{"class":259,"line":260},[4669],{"type":47,"tag":257,"props":4670,"children":4671},{},[4672],{"type":53,"value":4673},"# After your invocation logic completes and you know the session is done:\n",{"type":47,"tag":257,"props":4675,"children":4676},{"class":259,"line":337},[4677],{"type":47,"tag":257,"props":4678,"children":4679},{},[4680],{"type":53,"value":4681},"client.stop_runtime_session(\n",{"type":47,"tag":257,"props":4683,"children":4684},{"class":259,"line":381},[4685],{"type":47,"tag":257,"props":4686,"children":4687},{},[4688],{"type":53,"value":4689},"    agentRuntimeArn=runtime_arn,\n",{"type":47,"tag":257,"props":4691,"children":4692},{"class":259,"line":407},[4693],{"type":47,"tag":257,"props":4694,"children":4695},{},[4696],{"type":53,"value":4697},"    runtimeSessionId=session_id,\n",{"type":47,"tag":257,"props":4699,"children":4700},{"class":259,"line":429},[4701],{"type":47,"tag":257,"props":4702,"children":4703},{},[4704],{"type":53,"value":4705},")\n",{"type":47,"tag":55,"props":4707,"children":4708},{},[4709,4714],{"type":47,"tag":240,"props":4710,"children":4711},{},[4712],{"type":53,"value":4713},"Reuse session IDs for related work.",{"type":53,"value":4715}," A new session ID for every HTTP request means a new environment for every HTTP request. For multi-turn conversations, batch jobs, or user-facing interactions, use one session ID per conversation\u002Fbatch\u002Fuser-interaction and route all related requests to it.",{"type":47,"tag":55,"props":4717,"children":4718},{},[4719,4731],{"type":47,"tag":240,"props":4720,"children":4721},{},[4722,4724,4729],{"type":53,"value":4723},"Tune ",{"type":47,"tag":103,"props":4725,"children":4727},{"className":4726},[],[4728],{"type":53,"value":4359},{"type":53,"value":4730}," to your workload.",{"type":53,"value":4732}," The default 900 seconds is appropriate for interactive workloads where you expect quick follow-up requests. For request-reply workloads where sessions are short-lived, lower it.",{"type":47,"tag":55,"props":4734,"children":4735},{},[4736,4738,4743],{"type":53,"value":4737},"Edit the runtime's entry in ",{"type":47,"tag":103,"props":4739,"children":4741},{"className":4740},[],[4742],{"type":53,"value":181},{"type":53,"value":359},{"type":47,"tag":246,"props":4745,"children":4747},{"className":320,"code":4746,"language":322,"meta":251,"style":251},"{\n  \"runtimes\": [\n    {\n      \"name\": \"MyAgent\",\n      \"lifecycleConfiguration\": {\n        \"idleRuntimeSessionTimeout\": 120,\n        \"maxLifetime\": 3600\n      }\n    }\n  ]\n}\n",[4748],{"type":47,"tag":103,"props":4749,"children":4750},{"__ignoreMap":251},[4751,4758,4782,4790,4828,4852,4881,4905,4913,4921,4928],{"type":47,"tag":257,"props":4752,"children":4753},{"class":259,"line":260},[4754],{"type":47,"tag":257,"props":4755,"children":4756},{"style":281},[4757],{"type":53,"value":334},{"type":47,"tag":257,"props":4759,"children":4760},{"class":259,"line":337},[4761,4765,4770,4774,4778],{"type":47,"tag":257,"props":4762,"children":4763},{"style":281},[4764],{"type":53,"value":343},{"type":47,"tag":257,"props":4766,"children":4767},{"style":346},[4768],{"type":53,"value":4769},"runtimes",{"type":47,"tag":257,"props":4771,"children":4772},{"style":281},[4773],{"type":53,"value":354},{"type":47,"tag":257,"props":4775,"children":4776},{"style":281},[4777],{"type":53,"value":359},{"type":47,"tag":257,"props":4779,"children":4780},{"style":281},[4781],{"type":53,"value":404},{"type":47,"tag":257,"props":4783,"children":4784},{"class":259,"line":381},[4785],{"type":47,"tag":257,"props":4786,"children":4787},{"style":281},[4788],{"type":53,"value":4789},"    {\n",{"type":47,"tag":257,"props":4791,"children":4792},{"class":259,"line":407},[4793,4798,4803,4807,4811,4815,4820,4824],{"type":47,"tag":257,"props":4794,"children":4795},{"style":281},[4796],{"type":53,"value":4797},"      \"",{"type":47,"tag":257,"props":4799,"children":4800},{"style":264},[4801],{"type":53,"value":4802},"name",{"type":47,"tag":257,"props":4804,"children":4805},{"style":281},[4806],{"type":53,"value":354},{"type":47,"tag":257,"props":4808,"children":4809},{"style":281},[4810],{"type":53,"value":359},{"type":47,"tag":257,"props":4812,"children":4813},{"style":281},[4814],{"type":53,"value":364},{"type":47,"tag":257,"props":4816,"children":4817},{"style":270},[4818],{"type":53,"value":4819},"MyAgent",{"type":47,"tag":257,"props":4821,"children":4822},{"style":281},[4823],{"type":53,"value":354},{"type":47,"tag":257,"props":4825,"children":4826},{"style":281},[4827],{"type":53,"value":378},{"type":47,"tag":257,"props":4829,"children":4830},{"class":259,"line":429},[4831,4835,4840,4844,4848],{"type":47,"tag":257,"props":4832,"children":4833},{"style":281},[4834],{"type":53,"value":4797},{"type":47,"tag":257,"props":4836,"children":4837},{"style":264},[4838],{"type":53,"value":4839},"lifecycleConfiguration",{"type":47,"tag":257,"props":4841,"children":4842},{"style":281},[4843],{"type":53,"value":354},{"type":47,"tag":257,"props":4845,"children":4846},{"style":281},[4847],{"type":53,"value":359},{"type":47,"tag":257,"props":4849,"children":4850},{"style":281},[4851],{"type":53,"value":821},{"type":47,"tag":257,"props":4853,"children":4854},{"class":259,"line":447},[4855,4860,4864,4868,4872,4877],{"type":47,"tag":257,"props":4856,"children":4857},{"style":281},[4858],{"type":53,"value":4859},"        \"",{"type":47,"tag":257,"props":4861,"children":4862},{"style":852},[4863],{"type":53,"value":4359},{"type":47,"tag":257,"props":4865,"children":4866},{"style":281},[4867],{"type":53,"value":354},{"type":47,"tag":257,"props":4869,"children":4870},{"style":281},[4871],{"type":53,"value":359},{"type":47,"tag":257,"props":4873,"children":4874},{"style":852},[4875],{"type":53,"value":4876}," 120",{"type":47,"tag":257,"props":4878,"children":4879},{"style":281},[4880],{"type":53,"value":378},{"type":47,"tag":257,"props":4882,"children":4883},{"class":259,"line":456},[4884,4888,4892,4896,4900],{"type":47,"tag":257,"props":4885,"children":4886},{"style":281},[4887],{"type":53,"value":4859},{"type":47,"tag":257,"props":4889,"children":4890},{"style":852},[4891],{"type":53,"value":4377},{"type":47,"tag":257,"props":4893,"children":4894},{"style":281},[4895],{"type":53,"value":354},{"type":47,"tag":257,"props":4897,"children":4898},{"style":281},[4899],{"type":53,"value":359},{"type":47,"tag":257,"props":4901,"children":4902},{"style":852},[4903],{"type":53,"value":4904}," 3600\n",{"type":47,"tag":257,"props":4906,"children":4907},{"class":259,"line":481},[4908],{"type":47,"tag":257,"props":4909,"children":4910},{"style":281},[4911],{"type":53,"value":4912},"      }\n",{"type":47,"tag":257,"props":4914,"children":4915},{"class":259,"line":498},[4916],{"type":47,"tag":257,"props":4917,"children":4918},{"style":281},[4919],{"type":53,"value":4920},"    }\n",{"type":47,"tag":257,"props":4922,"children":4923},{"class":259,"line":507},[4924],{"type":47,"tag":257,"props":4925,"children":4926},{"style":281},[4927],{"type":53,"value":504},{"type":47,"tag":257,"props":4929,"children":4930},{"class":259,"line":2369},[4931],{"type":47,"tag":257,"props":4932,"children":4933},{"style":281},[4934],{"type":53,"value":513},{"type":47,"tag":55,"props":4936,"children":4937},{},[4938,4940,4946,4948,4953],{"type":53,"value":4939},"Then ",{"type":47,"tag":103,"props":4941,"children":4943},{"className":4942},[],[4944],{"type":53,"value":4945},"agentcore deploy",{"type":53,"value":4947}," to apply. The CLI and CDK handle the underlying ",{"type":47,"tag":103,"props":4949,"children":4951},{"className":4950},[],[4952],{"type":53,"value":2810},{"type":53,"value":4954}," call for you.",{"type":47,"tag":55,"props":4956,"children":4957},{},[4958,4960,4966,4968,4973,4975,4981,4983,4989],{"type":53,"value":4959},"If you prefer the CLI, ",{"type":47,"tag":103,"props":4961,"children":4963},{"className":4962},[],[4964],{"type":53,"value":4965},"agentcore add agent ... --idle-timeout 120 --max-lifetime 3600",{"type":53,"value":4967}," writes the same fields into ",{"type":47,"tag":103,"props":4969,"children":4971},{"className":4970},[],[4972],{"type":53,"value":977},{"type":53,"value":4974},". The file is the source of truth — every field in it has IDE autocomplete via the ",{"type":47,"tag":103,"props":4976,"children":4978},{"className":4977},[],[4979],{"type":53,"value":4980},"$schema",{"type":53,"value":4982}," URL at the top of the file (",{"type":47,"tag":103,"props":4984,"children":4986},{"className":4985},[],[4987],{"type":53,"value":4988},"https:\u002F\u002Fschema.agentcore.aws.dev\u002Fv1\u002Fagentcore.json",{"type":53,"value":4990},").",{"type":47,"tag":55,"props":4992,"children":4993},{},[4994,4996,5001],{"type":53,"value":4995},"Lower timeout = faster VM reclamation = more headroom under ",{"type":47,"tag":103,"props":4997,"children":4999},{"className":4998},[],[5000],{"type":53,"value":4310},{"type":53,"value":5002},". Too low = environments get reclaimed mid-conversation, causing the next turn to cold-start.",{"type":47,"tag":55,"props":5004,"children":5005},{},[5006,5024],{"type":47,"tag":240,"props":5007,"children":5008},{},[5009,5011,5016,5017,5022],{"type":53,"value":5010},"Don't pass both ",{"type":47,"tag":103,"props":5012,"children":5014},{"className":5013},[],[5015],{"type":53,"value":4003},{"type":53,"value":4005},{"type":47,"tag":103,"props":5018,"children":5020},{"className":5019},[],[5021],{"type":53,"value":4011},{"type":53,"value":5023}," together.",{"type":53,"value":5025}," For MCP agents, use one. Passing both can bind two separate VMs to the same logical session.",{"type":47,"tag":138,"props":5027,"children":5029},{"id":5028},"diagnosing-maxvms-problems",[5030,5032,5037],{"type":53,"value":5031},"Diagnosing ",{"type":47,"tag":103,"props":5033,"children":5035},{"className":5034},[],[5036],{"type":53,"value":4310},{"type":53,"value":5038}," problems",{"type":47,"tag":55,"props":5040,"children":5041},{},[5042,5044,5050],{"type":53,"value":5043},"If you hit ",{"type":47,"tag":103,"props":5045,"children":5047},{"className":5046},[],[5048],{"type":53,"value":5049},"ServiceQuotaExceededException: maxVms limit exceeded",{"type":53,"value":5051},", don't request a quota increase first. CloudWatch's concurrent-sessions metric is not the same as live VM count — idle environments count against the quota until reclaimed.",{"type":47,"tag":55,"props":5053,"children":5054},{},[5055],{"type":53,"value":5056},"Work through this order:",{"type":47,"tag":2055,"props":5058,"children":5059},{},[5060,5072,5077,5089],{"type":47,"tag":72,"props":5061,"children":5062},{},[5063,5065,5070],{"type":53,"value":5064},"Add ",{"type":47,"tag":103,"props":5066,"children":5068},{"className":5067},[],[5069],{"type":53,"value":4342},{"type":53,"value":5071}," after each logical request completes",{"type":47,"tag":72,"props":5073,"children":5074},{},[5075],{"type":53,"value":5076},"Audit session-ID generation — are you creating a new ID per request that should reuse one?",{"type":47,"tag":72,"props":5078,"children":5079},{},[5080,5082,5087],{"type":53,"value":5081},"Lower ",{"type":47,"tag":103,"props":5083,"children":5085},{"className":5084},[],[5086],{"type":53,"value":4359},{"type":53,"value":5088}," if your sessions are short-lived",{"type":47,"tag":72,"props":5090,"children":5091},{},[5092],{"type":53,"value":5093},"Only then, if you've done all of the above and still hit the limit, request an increase",{"type":47,"tag":55,"props":5095,"children":5096},{},[5097,5098,5106],{"type":53,"value":3839},{"type":47,"tag":98,"props":5099,"children":5100},{"href":100},[5101],{"type":47,"tag":103,"props":5102,"children":5104},{"className":5103},[],[5105],{"type":53,"value":100},{"type":53,"value":5107}," for the increase-request workflow (via the Service Quotas console) and the justification template.",{"type":47,"tag":214,"props":5109,"children":5110},{},[],{"type":47,"tag":61,"props":5112,"children":5114},{"id":5113},"long-running-background-tasks",[5115],{"type":53,"value":5116},"Long-running background tasks",{"type":47,"tag":55,"props":5118,"children":5119},{},[5120,5122,5128,5130,5135],{"type":53,"value":5121},"If your agent fires off work that outlives the ",{"type":47,"tag":103,"props":5123,"children":5125},{"className":5124},[],[5126],{"type":53,"value":5127},"\u002Finvocations",{"type":53,"value":5129}," response — background processing, async jobs, long tool chains — a fire-and-forget pattern isn't enough. The environment can be reclaimed at ",{"type":47,"tag":103,"props":5131,"children":5133},{"className":5132},[],[5134],{"type":53,"value":4359},{"type":53,"value":5136}," even while your background task is still running, because the runtime considers the session idle once the invocation response is sent.",{"type":47,"tag":138,"props":5138,"children":5140},{"id":5139},"use-the-sdks-async-task-api-to-signal-still-busy",[5141],{"type":53,"value":5142},"Use the SDK's async task API to signal \"still busy\"",{"type":47,"tag":55,"props":5144,"children":5145},{},[5146],{"type":53,"value":5147},"The bedrock-agentcore SDK provides task registration that keeps the environment alive while tracked work runs. In Python:",{"type":47,"tag":246,"props":5149,"children":5151},{"className":2280,"code":5150,"language":2282,"meta":251,"style":251},"from bedrock_agentcore.runtime import BedrockAgentCoreApp\n\napp = BedrockAgentCoreApp()\n\n@app.entrypoint\ndef invoke(payload, context):\n    # Register the task BEFORE starting it\n    task_id = app.add_async_task(\"background_work\")\n\n    # Kick off the work (in a thread, asyncio, etc.)\n    start_background_work(task_id, payload)\n\n    # Return the invocation response — the task is still tracked\n    return {\"status\": \"processing\", \"taskId\": task_id}\n\n\ndef start_background_work(task_id, payload):\n    try:\n        # Long-running work here\n        do_the_work(payload)\n    finally:\n        # Mark the task complete when done — this releases the \"busy\" signal\n        app.complete_async_task(task_id)\n\nif __name__ == \"__main__\":\n    app.run()\n",[5152],{"type":47,"tag":103,"props":5153,"children":5154},{"__ignoreMap":251},[5155,5162,5169,5176,5183,5190,5197,5205,5213,5220,5228,5236,5243,5251,5259,5266,5273,5281,5289,5298,5307,5316,5325,5334,5342,5350],{"type":47,"tag":257,"props":5156,"children":5157},{"class":259,"line":260},[5158],{"type":47,"tag":257,"props":5159,"children":5160},{},[5161],{"type":53,"value":2294},{"type":47,"tag":257,"props":5163,"children":5164},{"class":259,"line":337},[5165],{"type":47,"tag":257,"props":5166,"children":5167},{"emptyLinePlaceholder":2300},[5168],{"type":53,"value":2303},{"type":47,"tag":257,"props":5170,"children":5171},{"class":259,"line":381},[5172],{"type":47,"tag":257,"props":5173,"children":5174},{},[5175],{"type":53,"value":2311},{"type":47,"tag":257,"props":5177,"children":5178},{"class":259,"line":407},[5179],{"type":47,"tag":257,"props":5180,"children":5181},{"emptyLinePlaceholder":2300},[5182],{"type":53,"value":2303},{"type":47,"tag":257,"props":5184,"children":5185},{"class":259,"line":429},[5186],{"type":47,"tag":257,"props":5187,"children":5188},{},[5189],{"type":53,"value":2326},{"type":47,"tag":257,"props":5191,"children":5192},{"class":259,"line":447},[5193],{"type":47,"tag":257,"props":5194,"children":5195},{},[5196],{"type":53,"value":2334},{"type":47,"tag":257,"props":5198,"children":5199},{"class":259,"line":456},[5200],{"type":47,"tag":257,"props":5201,"children":5202},{},[5203],{"type":53,"value":5204},"    # Register the task BEFORE starting it\n",{"type":47,"tag":257,"props":5206,"children":5207},{"class":259,"line":481},[5208],{"type":47,"tag":257,"props":5209,"children":5210},{},[5211],{"type":53,"value":5212},"    task_id = app.add_async_task(\"background_work\")\n",{"type":47,"tag":257,"props":5214,"children":5215},{"class":259,"line":498},[5216],{"type":47,"tag":257,"props":5217,"children":5218},{"emptyLinePlaceholder":2300},[5219],{"type":53,"value":2303},{"type":47,"tag":257,"props":5221,"children":5222},{"class":259,"line":507},[5223],{"type":47,"tag":257,"props":5224,"children":5225},{},[5226],{"type":53,"value":5227},"    # Kick off the work (in a thread, asyncio, etc.)\n",{"type":47,"tag":257,"props":5229,"children":5230},{"class":259,"line":2369},[5231],{"type":47,"tag":257,"props":5232,"children":5233},{},[5234],{"type":53,"value":5235},"    start_background_work(task_id, payload)\n",{"type":47,"tag":257,"props":5237,"children":5238},{"class":259,"line":2378},[5239],{"type":47,"tag":257,"props":5240,"children":5241},{"emptyLinePlaceholder":2300},[5242],{"type":53,"value":2303},{"type":47,"tag":257,"props":5244,"children":5245},{"class":259,"line":2387},[5246],{"type":47,"tag":257,"props":5247,"children":5248},{},[5249],{"type":53,"value":5250},"    # Return the invocation response — the task is still tracked\n",{"type":47,"tag":257,"props":5252,"children":5253},{"class":259,"line":2396},[5254],{"type":47,"tag":257,"props":5255,"children":5256},{},[5257],{"type":53,"value":5258},"    return {\"status\": \"processing\", \"taskId\": task_id}\n",{"type":47,"tag":257,"props":5260,"children":5261},{"class":259,"line":2405},[5262],{"type":47,"tag":257,"props":5263,"children":5264},{"emptyLinePlaceholder":2300},[5265],{"type":53,"value":2303},{"type":47,"tag":257,"props":5267,"children":5268},{"class":259,"line":2413},[5269],{"type":47,"tag":257,"props":5270,"children":5271},{"emptyLinePlaceholder":2300},[5272],{"type":53,"value":2303},{"type":47,"tag":257,"props":5274,"children":5275},{"class":259,"line":2422},[5276],{"type":47,"tag":257,"props":5277,"children":5278},{},[5279],{"type":53,"value":5280},"def start_background_work(task_id, payload):\n",{"type":47,"tag":257,"props":5282,"children":5284},{"class":259,"line":5283},18,[5285],{"type":47,"tag":257,"props":5286,"children":5287},{},[5288],{"type":53,"value":2342},{"type":47,"tag":257,"props":5290,"children":5292},{"class":259,"line":5291},19,[5293],{"type":47,"tag":257,"props":5294,"children":5295},{},[5296],{"type":53,"value":5297},"        # Long-running work here\n",{"type":47,"tag":257,"props":5299,"children":5301},{"class":259,"line":5300},20,[5302],{"type":47,"tag":257,"props":5303,"children":5304},{},[5305],{"type":53,"value":5306},"        do_the_work(payload)\n",{"type":47,"tag":257,"props":5308,"children":5310},{"class":259,"line":5309},21,[5311],{"type":47,"tag":257,"props":5312,"children":5313},{},[5314],{"type":53,"value":5315},"    finally:\n",{"type":47,"tag":257,"props":5317,"children":5319},{"class":259,"line":5318},22,[5320],{"type":47,"tag":257,"props":5321,"children":5322},{},[5323],{"type":53,"value":5324},"        # Mark the task complete when done — this releases the \"busy\" signal\n",{"type":47,"tag":257,"props":5326,"children":5328},{"class":259,"line":5327},23,[5329],{"type":47,"tag":257,"props":5330,"children":5331},{},[5332],{"type":53,"value":5333},"        app.complete_async_task(task_id)\n",{"type":47,"tag":257,"props":5335,"children":5337},{"class":259,"line":5336},24,[5338],{"type":47,"tag":257,"props":5339,"children":5340},{"emptyLinePlaceholder":2300},[5341],{"type":53,"value":2303},{"type":47,"tag":257,"props":5343,"children":5345},{"class":259,"line":5344},25,[5346],{"type":47,"tag":257,"props":5347,"children":5348},{},[5349],{"type":53,"value":2419},{"type":47,"tag":257,"props":5351,"children":5353},{"class":259,"line":5352},26,[5354],{"type":47,"tag":257,"props":5355,"children":5356},{},[5357],{"type":53,"value":2428},{"type":47,"tag":55,"props":5359,"children":5360},{},[5361,5363,5368,5370,5375],{"type":53,"value":5362},"While at least one registered task is active, the runtime sees the environment as busy and doesn't reclaim it at ",{"type":47,"tag":103,"props":5364,"children":5366},{"className":5365},[],[5367],{"type":53,"value":4359},{"type":53,"value":5369},". ",{"type":47,"tag":103,"props":5371,"children":5373},{"className":5372},[],[5374],{"type":53,"value":4377},{"type":53,"value":5376}," (default 8 hours) still applies as a hard ceiling.",{"type":47,"tag":55,"props":5378,"children":5379},{},[5380],{"type":53,"value":5381},"Check the bedrock-agentcore SDK docs for your language for the equivalent API — the TypeScript SDK has an analogous pattern.",{"type":47,"tag":138,"props":5383,"children":5385},{"id":5384},"alternatives-when-async-task-api-isnt-an-option",[5386],{"type":53,"value":5387},"Alternatives when async task API isn't an option",{"type":47,"tag":68,"props":5389,"children":5390},{},[5391,5414,5436],{"type":47,"tag":72,"props":5392,"children":5393},{},[5394,5406,5408,5413],{"type":47,"tag":240,"props":5395,"children":5396},{},[5397,5399,5404],{"type":53,"value":5398},"Increase ",{"type":47,"tag":103,"props":5400,"children":5402},{"className":5401},[],[5403],{"type":53,"value":4359},{"type":53,"value":5405}," to match your expected task duration.",{"type":53,"value":5407}," If you know tasks run up to 10 minutes, set the timeout to 12 minutes. Keep it well under ",{"type":47,"tag":103,"props":5409,"children":5411},{"className":5410},[],[5412],{"type":53,"value":4377},{"type":53,"value":3277},{"type":47,"tag":72,"props":5415,"children":5416},{},[5417,5422,5424,5434],{"type":47,"tag":240,"props":5418,"children":5419},{},[5420],{"type":53,"value":5421},"Keep the HTTP connection open",{"type":53,"value":5423}," with a streaming response and emit periodic heartbeat events. Useful when you want the caller to wait for the result rather than polling. See the SSE keepalive pattern in ",{"type":47,"tag":98,"props":5425,"children":5427},{"href":5426},"..\u002Fagents-debug\u002FSKILL.md",[5428],{"type":47,"tag":103,"props":5429,"children":5431},{"className":5430},[],[5432],{"type":53,"value":5433},"agents-debug\u002FSKILL.md",{"type":53,"value":5435}," (\"Connection drops mid-stream\" section).",{"type":47,"tag":72,"props":5437,"children":5438},{},[5439,5444],{"type":47,"tag":240,"props":5440,"children":5441},{},[5442],{"type":53,"value":5443},"Split long work across multiple invocations",{"type":53,"value":5445}," on the same session. Each invocation resets the idle clock.",{"type":47,"tag":214,"props":5447,"children":5448},{},[],{"type":47,"tag":61,"props":5450,"children":5452},{"id":5451},"quotas-and-limits",[5453],{"type":53,"value":5454},"Quotas and limits",{"type":47,"tag":55,"props":5456,"children":5457},{},[5458,5460,5466,5468,5476],{"type":53,"value":5459},"If you're hitting throttling, ",{"type":47,"tag":103,"props":5461,"children":5463},{"className":5462},[],[5464],{"type":53,"value":5465},"ServiceQuotaExceededException",{"type":53,"value":5467},", or any other quota-related error — or you're about to launch and want to make sure quotas won't block you — load ",{"type":47,"tag":98,"props":5469,"children":5470},{"href":100},[5471],{"type":47,"tag":103,"props":5472,"children":5474},{"className":5473},[],[5475],{"type":53,"value":100},{"type":53,"value":3277},{"type":47,"tag":55,"props":5478,"children":5479},{},[5480],{"type":53,"value":5481},"That reference covers:",{"type":47,"tag":68,"props":5483,"children":5484},{},[5485,5490,5495,5500],{"type":47,"tag":72,"props":5486,"children":5487},{},[5488],{"type":53,"value":5489},"Which quota each error maps to",{"type":47,"tag":72,"props":5491,"children":5492},{},[5493],{"type":53,"value":5494},"Mitigations to try before requesting an increase (critical — most \"quota\" errors are actually session-lifecycle issues)",{"type":47,"tag":72,"props":5496,"children":5497},{},[5498],{"type":53,"value":5499},"How to request an increase through the Service Quotas console (the edge case where a direct Support case is needed is rare)",{"type":47,"tag":72,"props":5501,"children":5502},{},[5503],{"type":53,"value":5504},"A copy-paste justification template with everything a reviewer needs to approve",{"type":47,"tag":214,"props":5506,"children":5507},{},[],{"type":47,"tag":61,"props":5509,"children":5511},{"id":5510},"production-checklist-summary",[5512],{"type":53,"value":5513},"Production checklist summary",{"type":47,"tag":55,"props":5515,"children":5516},{},[5517],{"type":53,"value":5518},"Generate a checklist specific to the project:",{"type":47,"tag":246,"props":5520,"children":5524},{"className":5521,"code":5523,"language":53},[5522],"language-text","Production Readiness Checklist for \u003CAgentName>\n\nIAM\n[ ] Execution role Bedrock access scoped to specific model ARNs\n[ ] ECR access scoped to specific repository\n[ ] Trust policy scoped to your account ID\n\nAuthentication\n[ ] Inbound auth is AWS_IAM or CUSTOM_JWT (not NONE)\n[ ] If CUSTOM_JWT: discovery URL, audience, and client IDs configured\n\nShell Access (if using InvokeAgentRuntimeCommand)\n[ ] InvokeAgentRuntimeCommand permission granted only to identities that need it\n[ ] Separate IAM policy from InvokeAgentRuntime policy\n[ ] CloudTrail \u002F EventBridge alert configured for InvokeAgentRuntimeCommand calls\n[ ] If commands constructed from user input: shell injection validation implemented\n\nCode quality\n[ ] Error handling wraps all agent logic\n[ ] Input validation on payload fields (type, length, format)\n[ ] No secrets hardcoded in agent code\n[ ] Credentials registered via agentcore add credential\n\nObservability\n[ ] X-Ray tracing enabled (auto-configured)\n[ ] CloudWatch log retention policy set\n[ ] Eval baseline established\n\nPerformance\n[ ] Agent initialization time measured and optimized\n[ ] Deployment package size under 200 MB (target under 100 MB)\n[ ] Dependencies audited — no unused packages\n[ ] Heavy initialization deferred to request time\n[ ] Session reuse strategy chosen for multi-turn \u002F batch workloads\n[ ] `StopRuntimeSession` called after work completes where applicable\n[ ] `idleRuntimeSessionTimeout` tuned to workload (default 900s)\n[ ] For long-running background tasks: `add_async_task` \u002F `complete_async_task` used\n\nResources\n[ ] Memory strategies appropriate for use case (if using memory)\n[ ] Gateway auth configured (if using gateway)\n[ ] Policy engine attached (if restricting tool access)\n\nTesting\n[ ] Agent tested with production-representative inputs\n[ ] Error cases tested (tool failures, model errors)\n[ ] Memory cross-session tested (if using LTM)\n",[5525],{"type":47,"tag":103,"props":5526,"children":5527},{"__ignoreMap":251},[5528],{"type":53,"value":5523},{"type":47,"tag":61,"props":5530,"children":5532},{"id":5531},"output",[5533],{"type":53,"value":5534},"Output",{"type":47,"tag":68,"props":5536,"children":5537},{},[5538,5543,5548],{"type":47,"tag":72,"props":5539,"children":5540},{},[5541],{"type":53,"value":5542},"Checklist with specific findings for the project",{"type":47,"tag":72,"props":5544,"children":5545},{},[5546],{"type":53,"value":5547},"Specific commands to fix any issues found",{"type":47,"tag":72,"props":5549,"children":5550},{},[5551],{"type":53,"value":5552},"Recommended IAM policy for the detected model and resources",{"type":47,"tag":5554,"props":5555,"children":5556},"style",{},[5557],{"type":53,"value":5558},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5560,"total":5720},[5561,5575,5590,5605,5620,5630,5637,5653,5670,5683,5695,5710],{"slug":3845,"name":3845,"fn":5562,"description":5563,"org":5564,"tags":5565,"stars":24,"repoUrl":25,"updatedAt":5574},"add capabilities to existing agent projects","Use when adding capabilities to an existing agent project — memory, app integration, VPC, multi-agent, migration, model changes, browser, code interpreter, or resource removal. Triggers on: \"add memory\", \"remember across sessions\", \"call agent from app\", \"invoke agent from code\", \"auth to call agent\", \"streaming responses\", \"VPC\", \"VPC connectivity\", \"VPC error\", \"can't reach from VPC\", \"multi-agent\", \"A2A\", \"A2A auth\", \"orchestrator not delegating\", \"specialist not called\", \"migrate Bedrock Agent\", \"after import\", \"migration issue\", \"framework for migration\", \"change model\", \"browser tool\", \"code interpreter\", \"delete agent\", \"tear down\", \"agentcore remove\", \"cross-account memory\", \"resource-based policy on memory\", \"pay for x402 content\", \"402 Payment Required\", \"microtransactions\", \"paid API or tool\". Not for connecting to external APIs via Gateway — use agents-connect. Not for scaffolding a new project — use agents-get-started. Not for CLI\u002Fdev server errors — use agents-debug. Strands vs LangGraph in a migration context routes here.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5566,5567,5570,5571],{"name":20,"slug":21,"type":15},{"name":5568,"slug":5569,"type":15},"Automation","automation",{"name":23,"slug":8,"type":15},{"name":5572,"slug":5573,"type":15},"Engineering","engineering","2026-07-12T08:42:53.812877",{"slug":5576,"name":5576,"fn":5577,"description":5578,"org":5579,"tags":5580,"stars":24,"repoUrl":25,"updatedAt":5589},"agents-connect","connect agents to external services","Use when connecting your agent to external APIs, tools, or services via Gateway, or restricting tool access with Cedar policies. Handles gateway setup, target types, outbound auth (OAuth, API key, IAM), credentials, and Cedar policy authoring. Triggers on: \"connect to API\", \"add gateway\", \"connect to MCP server\", \"Lambda tools\", \"OpenAPI\", \"gateway target\", \"Cedar policy\", \"restrict tools\", \"policy engine\", \"gateway auth error\", \"store API key\", \"outbound credential\", \"env var API key\", \"API key None after deploy\", \"credential not available after deploy\", \"should this be a gateway target\", \"give my agent tools\", \"add tools to agent\". Not for inbound auth (who can call your agent) — use agents-harden. Not for debugging agent behavior — use agents-debug. Not for VPC networking errors (agent can't reach APIs due to VPC) — use agents-build. Not for creating or hosting a new MCP server project — use agents-get-started.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5581,5582,5585,5588],{"name":20,"slug":21,"type":15},{"name":5583,"slug":5584,"type":15},"API Development","api-development",{"name":5586,"slug":5587,"type":15},"Authentication","authentication",{"name":23,"slug":8,"type":15},"2026-07-16T06:00:38.866147",{"slug":5591,"name":5591,"fn":5592,"description":5593,"org":5594,"tags":5595,"stars":24,"repoUrl":25,"updatedAt":5604},"agents-debug","debug agent and environment issues","Use when your agent or environment is broken — wrong answers, errors, timeouts, tool failures, or CLI issues. Reads traces and logs to diagnose root causes. Also checks prerequisites when the CLI itself isn't working. Triggers on: \"agent not working\", \"wrong answer\", \"agent error\", \"tool call failing\", \"debug agent\", \"check logs\", \"read traces\", \"broken\", \"500 error\", \"424 error\", \"model access denied\", \"command not found\", \"stuck in DELETING\", \"maxVms exceeded\", \"cold start diagnosis\", \"cold start slow\", \"agentcore create error\", \"create failed\", \"exit code 7\", \"connection refused local dev\". Not for deploy failures — use agents-deploy. Not for performance tuning without errors — use agents-optimize. Not for VPC configuration — use agents-build. Not for observability setup or missing logs — use agents-optimize.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5596,5597,5598,5601],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5599,"slug":5600,"type":15},"Debugging","debugging",{"name":5602,"slug":5603,"type":15},"Observability","observability","2026-07-16T06:00:44.679093",{"slug":5606,"name":5606,"fn":5607,"description":5608,"org":5609,"tags":5610,"stars":24,"repoUrl":25,"updatedAt":5619},"agents-deploy","deploy AI agents to AWS","Use when deploying your agent to AWS, or when a deploy has failed. Handles pre-flight validation, CDK\u002FIAM\u002Fquota error diagnosis, version management, rollback, and canary deployments. Triggers on: \"deploy my agent\", \"agentcore deploy\", \"deploy failed\", \"CDK error\", \"rollback\", \"canary deploy\", \"pin version\", \"redeploy\", \"deploy stuck\". Not for production hardening — use agents-harden. Not for adding capabilities before deploy — use agents-build or agents-connect. Not for VPC configuration errors — use agents-build.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5611,5612,5613,5616],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5614,"slug":5615,"type":15},"CI\u002FCD","ci-cd",{"name":5617,"slug":5618,"type":15},"Deployment","deployment","2026-07-12T08:42:55.059577",{"slug":5621,"name":5621,"fn":5622,"description":5623,"org":5624,"tags":5625,"stars":24,"repoUrl":25,"updatedAt":5629},"agents-get-started","scaffold and deploy new agent projects","Use when a developer wants to create a new agent project or get started with AgentCore. Handles framework selection, project scaffolding, first deploy, and first invocation. Triggers on: \"build an agent\", \"create an agent\", \"get started\", \"new project\", \"agentcore create\", \"which framework\", \"Strands vs LangGraph\", \"hello world agent\", \"first agent\", \"create MCP server\", \"host MCP server\", \"agentcore dev\", \"dev server\", \"what port\", \"local development\". Not for adding capabilities to existing projects — use agents-build or agents-connect. Strands vs LangGraph in a migration context routes to agents-build, not here. Connecting to an existing MCP server routes to agents-connect, not here.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5626,5627,5628],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5617,"slug":5618,"type":15},"2026-07-12T08:42:51.963247",{"slug":4,"name":4,"fn":5,"description":6,"org":5631,"tags":5632,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5633,5634,5635,5636],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":5638,"name":5638,"fn":5639,"description":5640,"org":5641,"tags":5642,"stars":24,"repoUrl":25,"updatedAt":5652},"agents-optimize","optimize agent quality and performance","Use when measuring or improving agent quality and performance — set up evaluators, online monitoring, CI\u002FCD quality gates, observability, or cost optimization. Triggers on: \"evaluate my agent\", \"add evaluator\", \"measure quality\", \"quality gate\", \"run evals\", \"agent too slow\", \"why is it slow\", \"reduce latency\", \"set up observability\", \"CloudWatch dashboard\", \"how much does my agent cost\", \"cost optimization\", \"logs not showing up\", \"logs missing\", \"spans not found\", \"eval failing\", \"eval error\", \"dev traces\", \"local traces\", \"agentcore dev traces\", \"traces to CloudWatch\". Not for debugging errors or crashes — use agents-debug. Slow but correct routes here; broken routes to debug.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5643,5644,5645,5648,5649],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5646,"slug":5647,"type":15},"Evals","evals",{"name":5602,"slug":5603,"type":15},{"name":5650,"slug":5651,"type":15},"Performance","performance","2026-07-12T08:42:56.488105",{"slug":5654,"name":5654,"fn":5655,"description":5656,"org":5657,"tags":5658,"stars":24,"repoUrl":25,"updatedAt":5669},"amazon-aurora-mysql","manage Amazon Aurora MySQL clusters","Amazon Aurora MySQL — creates, modifies, and advises on Aurora MySQL clusters specifically (MySQL-compatible engine, Aurora serverless, parallel query). Trigger for Aurora MySQL cluster operations, ACU sizing, I\u002FO-Optimized storage, commitment pricing, or MySQL upgrade planning. Aurora MySQL uses full (VPC-based) configuration — express configuration is PostgreSQL-only. For Aurora PostgreSQL, use amazon-aurora-postgresql instead. Contains safety guardrails and response templates that override defaults.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5659,5660,5663,5666],{"name":23,"slug":8,"type":15},{"name":5661,"slug":5662,"type":15},"Database","database",{"name":5664,"slug":5665,"type":15},"MySQL","mysql",{"name":5667,"slug":5668,"type":15},"Serverless","serverless","2026-07-12T08:43:13.27939",{"slug":5671,"name":5671,"fn":5672,"description":5673,"org":5674,"tags":5675,"stars":24,"repoUrl":25,"updatedAt":5682},"amazon-aurora-postgresql","configure Amazon Aurora PostgreSQL clusters","Amazon Aurora PostgreSQL — creates, modifies, and advises on Aurora PostgreSQL clusters specifically (PostgreSQL-compatible engine, Aurora serverless, express configuration, pgvector, Babelfish). Trigger for Aurora PostgreSQL cluster operations, express-configuration quick-start, ACU sizing, I\u002FO-Optimized storage, commitment pricing, or PostgreSQL upgrade planning. For Aurora MySQL, use amazon-aurora-mysql instead. Contains safety guardrails, express-first routing, and response templates that override defaults.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5676,5677,5678,5681],{"name":23,"slug":8,"type":15},{"name":5661,"slug":5662,"type":15},{"name":5679,"slug":5680,"type":15},"PostgreSQL","postgresql",{"name":5667,"slug":5668,"type":15},"2026-07-16T06:00:34.789624",{"slug":5684,"name":5684,"fn":5685,"description":5686,"org":5687,"tags":5688,"stars":24,"repoUrl":25,"updatedAt":5694},"amazon-bedrock","build generative AI apps with Amazon Bedrock","Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore. Use when invoking models, setting up Knowledge Bases, creating agents, applying guardrails, deploying to AgentCore, migrating\u002Fporting\u002Fconverting a Bedrock Agent (including inline agents) to an AgentCore Harness, troubleshooting Bedrock errors (ThrottlingException, AccessDeniedException), or choosing models (Claude, Llama, Nova, Titan). ALSO USE for prompt caching setup and debugging, quota health checks and throttling diagnosis, cost attribution and tracking, migrating between Claude model generations (4.5 to 4.6 to 4.7), chunking strategies, API selection (Converse vs InvokeModel), guardrail capabilities, and model selection. Also covers AgentCore Payments setup (x402, microtransactions, Payment Manager, Connector, Instrument, Coinbase CDP, Stripe Privy, 402 Payment Required, pay for content, paid endpoint, agent payments). NOT for custom model training, Rekognition, or Comprehend.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5689,5690,5691],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5692,"slug":5693,"type":15},"LLM","llm","2026-07-25T05:30:35.20899",{"slug":5696,"name":5696,"fn":5697,"description":5698,"org":5699,"tags":5700,"stars":24,"repoUrl":25,"updatedAt":5709},"amazon-documentdb","manage Amazon DocumentDB clusters","Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS\u002FVPC\u002Fdriver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration, slow-query diagnosis, major version upgrades (4.0→5.0→8.0), Well-Architected reviews (41-check wa_review.py), cost estimation, and security hardening. Retrieve for every DocumentDB question and when the user asks to set up or migrate MongoDB to AWS — DocumentDB is AWS's MongoDB-compatible managed database. Triggers: JSON document store, document database, MongoDB on AWS, Nested fields, Lambda cannot connect, TLS handshake, VPC port 27017, IAM auth, Secrets Manager, encryption at rest, $graphLookup, flexible schema, COLLSCAN, compound index, DMS migration, CDC cutover, $vectorSearch, RAG, Global Clusters, DR replication, cost sizing, audit, health check, production-readiness.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5701,5702,5703,5706],{"name":23,"slug":8,"type":15},{"name":5661,"slug":5662,"type":15},{"name":5704,"slug":5705,"type":15},"MongoDB","mongodb",{"name":5707,"slug":5708,"type":15},"NoSQL","nosql","2026-07-12T08:43:00.455878",{"slug":5711,"name":5711,"fn":5712,"description":5713,"org":5714,"tags":5715,"stars":24,"repoUrl":25,"updatedAt":5719},"amazon-dynamodb","design and debug DynamoDB data layers","Designs, reviews, and debugs DynamoDB data layers from design axioms — enumerates access patterns, chooses partition\u002Fsort keys and GSIs, decides single-table vs. multi-table, configures Streams, Global Tables, TTL, and zero-ETL integrations to OpenSearch\u002FRedshift\u002FSageMaker Lakehouse, and produces a defensible data-layer design with a monthly cost estimate and optional live validation. Applies whenever a user is designing, reviewing, or refactoring anything backed by DynamoDB — schemas, access patterns, GSIs, single- vs. multi-table choices, Streams consumers, transactional outboxes, Global Tables, zero-ETL pipelines — even when they don't say \"axioms\" or \"design review.\" Also applies when debugging hot partitions, throttling, unbounded Scans, LWW conflicts, or surprise bills on DynamoDB workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5716,5717,5718],{"name":23,"slug":8,"type":15},{"name":5661,"slug":5662,"type":15},{"name":5707,"slug":5708,"type":15},"2026-07-16T06:00:37.690386",115,{"items":5722,"total":5772},[5723,5730,5737,5744,5751,5757,5764],{"slug":3845,"name":3845,"fn":5562,"description":5563,"org":5724,"tags":5725,"stars":24,"repoUrl":25,"updatedAt":5574},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5726,5727,5728,5729],{"name":20,"slug":21,"type":15},{"name":5568,"slug":5569,"type":15},{"name":23,"slug":8,"type":15},{"name":5572,"slug":5573,"type":15},{"slug":5576,"name":5576,"fn":5577,"description":5578,"org":5731,"tags":5732,"stars":24,"repoUrl":25,"updatedAt":5589},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5733,5734,5735,5736],{"name":20,"slug":21,"type":15},{"name":5583,"slug":5584,"type":15},{"name":5586,"slug":5587,"type":15},{"name":23,"slug":8,"type":15},{"slug":5591,"name":5591,"fn":5592,"description":5593,"org":5738,"tags":5739,"stars":24,"repoUrl":25,"updatedAt":5604},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5740,5741,5742,5743],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5599,"slug":5600,"type":15},{"name":5602,"slug":5603,"type":15},{"slug":5606,"name":5606,"fn":5607,"description":5608,"org":5745,"tags":5746,"stars":24,"repoUrl":25,"updatedAt":5619},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5747,5748,5749,5750],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5614,"slug":5615,"type":15},{"name":5617,"slug":5618,"type":15},{"slug":5621,"name":5621,"fn":5622,"description":5623,"org":5752,"tags":5753,"stars":24,"repoUrl":25,"updatedAt":5629},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5754,5755,5756],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5617,"slug":5618,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":5758,"tags":5759,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5760,5761,5762,5763],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":5638,"name":5638,"fn":5639,"description":5640,"org":5765,"tags":5766,"stars":24,"repoUrl":25,"updatedAt":5652},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5767,5768,5769,5770,5771],{"name":20,"slug":21,"type":15},{"name":23,"slug":8,"type":15},{"name":5646,"slug":5647,"type":15},{"name":5602,"slug":5603,"type":15},{"name":5650,"slug":5651,"type":15},114]