Runtime is the service that runs your agent in the cloud. You hand it your agent code; it provides the computer, scales it up and down, keeps each user separate, and handles the plumbing. You manage no servers.
New to these words? Read chapter 02 "Key terms" (serverless, container, ARM64, microVM, session).Runtime hosts your agent as a container (a sealed package of your code and everything it needs). It runs serverless: AWS provides and scales the computers, and you pay only for what you use. Each user's run, called a session, happens in its own microVM (a tiny private computer), so one user's data never touches another's. It supports long jobs (up to 8 hours), answers that stream as they are written, images and files (multi-modal), and many agent frameworks.
Add the small web endpoints the AgentCore SDK needs, and list your Python dependencies.
Package your code for ARM64: a code zip the CLI uploads for you (the default), or a container image you push to Amazon ECR (AWS's image store).
Register it as a Runtime. Version 1 and a "DEFAULT" address are created automatically.
Invoke it with a session id (a name for this conversation) and the user's input.
Read logs and traces. New code becomes a new version. Point the address at the version you want.
A session is one continuous run with a user, named by a session id. Reuse the id across turns to keep the conversation going. Each session runs in its own microVM (a tiny private computer).
Working on a request, or running a background task.
Waiting for the next turn, but still holding the conversation.
After 15 minutes idle or 8 hours of compute (both defaults, configurable), an explicit stop, or ill health. The next invocation resumes the session on fresh compute.
| PROTOCOL (how it talks) | PORT | PATH | USE |
|---|---|---|---|
| HTTP | 8080 | /invocations, /ws | normal request and reply, plus live streaming |
| MCP | 8000 | /mcp | when the agent is itself a tool server |
| A2A | 9000 | / (root) | when other agents call this agent |
| AG-UI | 8080 | /invocations (SSE), /ws | driving an interactive user interface |