Skip to Content
Recodocs

AgentCore gateway live

Where a Lambda-free AgentCore Gateway keeps the kit envelope

6 min read

What question this set answers

A gateway provides a common interface for permitted tools. The comparison is about the contract the client sees: a managed gateway and a local route should be evaluated by what they actually return.

A platform engineer puts the kit's synthetic parcel GatewayTool declarations behind one AgentCore Gateway, without a Lambda function or other compute, and compares what a client receives with the kit's local serving route.

The live target is an openApiSchema target from GatewayToolRouter.openapi_target_request. A private tagged S3 bucket is the HTTPS backend, read with the gateway's IAM role (GATEWAY_IAM_ROLE, SigV4 service s3). For each of 60 synthetic shipments and three windows, the bucket stores the text the kit router returns locally. The Python handler never runs in AWS. An id outside that data is expected to hit S3 with no object; the gateway then returns its own error text, not the kit envelope (notebook 4 does not show which layer).

No model chooses a tool. Clients use fixed names and arguments. On 2026-10-21, notebooks 1, 2, 5, 6 and 7 were re-executed and assert their Proof claims. Notebooks 3, 4, 8, 9 and 10 are not validated (0 of 20 claims). Their stored outputs are an older run, evidence of what was printed, not a passing check.

How to run it

From the kit root:

uv venv --python 3.13 .venv-agentcore-gateway-live
uv pip install --python .venv-agentcore-gateway-live/bin/python \
  -e '.[agentcore]' -e packages/strands nbconvert ipykernel pandas ruff
.venv-agentcore-gateway-live/bin/python -m ipykernel install --user \
  --name agentcore-gateway-live --display-name agentcore-gateway-live

AWS calls use only agentcore_live.aws_session() (profile recohut, us-east-1).

From the set directory, replace the notebook name:

cd examples/agentcore-gateway-live
../../.venv-agentcore-gateway-live/bin/jupyter nbconvert --to notebook --execute --inplace \
  --allow-errors --ExecutePreprocessor.timeout=900 \
  --ExecutePreprocessor.kernel_name=agentcore-gateway-live <notebook>.ipynb

From the kit root, before and after execution:

.venv-agentcore-gateway-live/bin/python scripts/check_agentcore_gateway_live_notebooks.py \
  examples/agentcore-gateway-live/*.ipynb --executed --aws-profile recohut

--aws-profile fails while the gateway is standing, before notebook 10. Notebooks 8 and 9 run only after the Policy set has detached and deleted its engine. Each checks that GetGateway has no policyEngineConfiguration. Notebook 10 stays last and runs only when the coordinator says so. Every browser checkpoint is None.

.runtime/ holds state.json and live-handoff.json. Tracked outputs show suffixes only. Taggable resources carry recohut-kit-agentcore=agentcore-gateway-live. Notebook 10 is intended to delete the resources and .runtime/ after the absence readback passes. The role is checked with GetRole, the workload identity with GetWorkloadIdentity, and untaggable targets by listing them.

Notebooks in order

NotebookWhat it doesRecorded output
01-declarations-to-target-schema.ipynbInline schema, OpenAPI, botocore-validated CreateGatewayTarget, refusals, 240-object read model. Scripted, 0 AWS calls.yes
02-local-serving-baseline.ipynbLoopback MCP server; five fixed cases through Strands and raw JSON-RPC; baseline kept. Scripted, 0 AWS calls, 10 local tool calls.yes
03-create-gateway-live.ipynbRecorded provisioning, then live bucket, role, AWS_IAM gateway, openApiSchema target. 240 S3 PUTs.yes
04-live-tools-list-and-call.ipynbSigV4 raw MCP and Strands; parity with notebook 2. At most 20 gateway MCP requests.yes
05-masking-and-scope-refusal.ipynbKit interceptor: scope refusal, filtered listing, masked results. Scripted, 0 AWS calls.yes
06-semantic-search-and-strands-plugin.ipynbSEMANTIC CreateGateway via Stubber; search plugin, no model. Recorded, 0 AWS calls.yes
07-targets-interceptors-rules-limits.ipynbFurther target requests, a route rule, a rate limit. Lambda shapes are data only. Recorded, 0 AWS calls.yes
08-web-search-connector-live.ipynbWeb-search permission and connector on the same gateway; two queries, third refused. At most 2 queries.yes
09-gateway-resource-policy-live.ipynbIntended route: same-account InvokeGateway policy, same-digest readback, delete, absence. 4 control-plane calls plus 1 STS.older stored output
10-teardown.ipynbIntended teardown: delete targets, gateway, role, bucket; absence readback; zero tagged inventory. Deletes and readbacks only.older stored output

The saved outputs for notebooks 1–8 record 8, 5, 7, 13, 4, 5, 6 and 6 outputs. Notebooks 9 and 10 have stored outputs from an older run. Notebooks 3 and 4 call the teardown "notebook 08"; it is now notebook 10.

What the recorded outputs show

Notebook 1 prints parcels___lookup_shipment (required tracking_id) and parcels___quote_redelivery (required tracking_id, window), fingerprint 4a48b875b548a1cf, botocore valid, target name parcels, config key openApiSchema, and credential GATEWAY_IAM_ROLE for service s3. OpenAPI prints GET lookup_shipment on a tracking_id path and GET quote_redelivery on a tracking_id and window path. Refusals print for plain HTTP (server_url must be an https URL with a host), a non-declared placeholder, and an unsupported method.

Notebook 2 prints server: parcels-local and both names. required equal is False; the other parity columns are True. The five cases have is_error false, false, true, true, true. Strands matches raw JSON-RPC, the served text matches router.dispatch, the checks passed, and the baseline file is local-baseline.json with 5 rows.

The older stored output shows notebook 3 printing recorded: gateway READY, target READY, then baseline tagged resources: 2 | existing handoff: True and stack left by an interrupted attempt (adopt, do not recreate): True. Run suffix b0d1c7fd, region us-east-1. The create cell prints adopted: True, objects stored now: None, created ok: True, error: None, failure teardown: None.

The older stored output shows notebook 4 printing handoff present: True, gateway …48uewj, target parcels, SigV4 for bedrock-agentcore in us-east-1. Unsigned initialize is HTTP 401; signed is 200, server recohut-kit-gw-live-0e389bf6. required equal is True. Strands is_error is false, false, false, true, true. The two success texts begin {"tracking_id":"PX700102". The domain-error text begins {"error":{"code":"not_eligible" and is_error is false. The unknown-id output starts An internal erro; the notebook text gives An internal error occurred. Please retry later. Missing-argument text starts ValidationException - Parameter validation.

Notebook 5 prints the raw depot_contact result for PX700102: pune-east@depots.example.test, +91 98765 43210, and api_key=demo-not-a-real-key-123456. A caller with only parcels.read gets missing_scope for parcels.contacts.read and handler calls while refused: 0. authorize raises GatewayScopeRefused. With no scope the listing is the two parcel tools; with parcels.contacts.read it adds parcels___depot_contact. The masked result is:

{"depot":"PUNE-EAST","contact":"[email]","phone":"[phone]","note":"courier portal api_key=[REDACTED]"}

It also prints one handler call when allowed, no sensitive fragments left, the unscoped lookup still served, and a checks-passed line for refusal, listing and masking.

Notebook 6 prints searchType SEMANTIC and supported version 2025-03-26, botocore validation: valid, and recorded searchType: SEMANTIC. AgentCoreToolSearchPlugin calls x_amz_bedrock_agentcore_search through a recorded client. quote the fee for an evening slot registers only parcels___quote_redelivery. show shipment status registers only parcels___lookup_shipment. The checks-passed line names that SEMANTIC request and that one-tool registration.

Notebook 7 prints built: ['mcpServer', 'apiGateway', 'web search'] and five valid rows (mcpServer, apiGateway, and three connector rows). The rule routes to target parcels. Recorded statuses are rule ACTIVE, rate limit ACTIVE. The interceptor line is valid | not executed: Lambda forbidden, points REQUEST and RESPONSE.

The older stored output shows notebook 8 printing guard ok true, status READY, engine false, and role statements ReadParcelReadModel, InvokeOwnGateway, AuthorizeWithPolicyEngine, InvokeWebSearchConnector. The connector is web-search / WebSearch, target READY suffix …2UD49N. One printed title is Model Context Protocol; hosts include docs.aws.amazon.com and wikipedia.org. Then HostedToolRefused limit_queries and queries sent: 2.

What is not shown or not run

Notebooks 3, 4, 8, 9 and 10 were not re-run on 2026-10-21, because they create, call and delete an IAM role, an S3 bucket and a gateway. At review time no tagged resources and no gateway existed. Named gaps: a tagged count of 2 contradicts the empty inventory; notebook 4's if ready: guard skips silently; notebook 10's absence booleans only drive an if. Do not read those five as passing.

Notebook 6 says live search was not run, and prices search at USD 0.025 per 1,000. Notebook 4 says the two live error strings do not show which layer produced them. Notebook 5 says the deployed gateway has no interceptor, so those cells prove the kit route only. Recorded requests use placeholder account 000000000000. Installed versions are recorded in versions.json, and execution status is authoritative in the verification ledger.

Where it fits in the kit

The saved notebooks' import lines name four kit modules, plus the set helper gateway_live.

recohut_kit.agentcore.identity provides gateway_iam_credential_config (notebooks 1 and 3) and sigv4_auth (notebook 4). recohut_kit.agentcore.gateway_features provides InterceptedGatewayRouter, GatewayScopeRefused, semantic_search_configuration, SEARCH_TOOL_NAME, and the target, rule, rate-limit and Lambda-shape helpers (notebooks 5, 6 and 7). recohut_kit.agentcore.tools provides HostedToolRefused (notebook 8). recohut_kit_strands.agentcore.gateway provides strands_mcp_client, agentcore_tool_search_plugin and last_user_message_intent (notebooks 2, 4 and 6).

Those notebooks say gateway_live.py reuses examples/agentcore/parcel_tools.py read only. The README adds examples/agentcore/data/shipments.json, read only, and a synthetic depot_contact tool in gateway_live.py for notebook 5. The kit owns the declaration subset, the OpenAPI export, the error envelope and the kit-side interceptor (recohut_kit.agentcore.gateway, .gateway_features). AWS owns inbound SigV4 authorization, the gateway's argument validation and the S3 refusal.

How is this page?

Last updated on