By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
When you deploy an agent to production, you need to roll out changes without downtime, handle long-running tasks without timeouts, and choose the right communication protocol for your use case. Bedrock AgentCore gives you versioning, endpoints, and streaming tools to do this, but the details matter.
When you create a Runtime, Version 1 is created automatically. Every change to the container image, protocol settings, or network settings creates a new version. Old versions are never edited, so rollback is always possible.
This immutability is the safety mechanism. You can test Version 2 in staging while Version 1 stays in production. If Version 2 breaks, you point traffic back to Version 1 without rebuilding or redeploying anything.
An endpoint is a stable address with its own ARN that points to one version. You create multiple endpoints and each one can target a different version. The DEFAULT endpoint is created for you and automatically follows the latest version.
To promote a change, you move an endpoint from one version to another. This is zero-downtime because the endpoint ARN stays the same; you're just changing which version it targets.
HTTP is the default. You get normal request/response at /invocations, plus an optional WebSocket endpoint at /ws for two-way communication.
MCP lets you host your own Model Context Protocol server so other agents can discover and call your agent's tools. A2A is the Agent-to-Agent protocol that enables agents to discover and invoke each other directly.
Return Server-Sent Events from /invocations and the client sees partial text as it is generated. For two-way real-time use like voice or live chat, use the WebSocket endpoint instead.
In your entrypoint, yield chunks from an async generator and the Runtime converts them to SSE automatically.
from bedrock_agentcore.runtime import BedrockAgentCoreApp
app = BedrockAgentCoreApp()
@app.entrypoint
async def invoke(payload):
# An async generator => streamed as SSE chunks
async for chunk in my_agent.stream_async(payload["prompt"]):
yield chunk
Say your agent starts a 40-minute research task and replies right away. Without a signal, the Runtime would think it is idle and recycle it after 15 minutes. Your /ping endpoint can answer 'HealthyBusy' to say 'I still have background work running'—the session stays alive up to the 8-hour limit. The SDK handles this for you when you register async tasks.
Pitfall: never set time_of_last_update to the current time on every ping. A timestamp that changes every call looks like constant activity, the idle timeout never fires, and sessions pile up until they hit the max lifetime.
401 or 403 means missing or invalid auth. OAuth gives 401; SigV4 gives 403. 424 RuntimeClientError means your container returned 4xx or 5xx—check CloudWatch logs. 429 ThrottlingException means slow down and retry with backoff. 409 RetryableConflictException means the session is being provisioned or torn down; retry briefly.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.