AI

AgentCore CLI: Install, Deploy an Agent and Fix Errors

You can build, run and ship an Amazon Bedrock agent from one terminal with the AgentCore CLI, which AWS announced as generally available on 28 October 2026. The happy path is short. What costs you an afternoon is around it: an old Python tool that hijacks the agentcore command, a default model your account may not be allowed to call, and a first deploy that changes account settings.

Original content from computingforgeeks.com - post 179536

You will take a Strands agent from agentcore create to a deployed Runtime with Memory, invoke it, read its logs and traces, then remove it and see what stays behind. I last ran it in October 2026 in eu-west-1 with AgentCore CLI 1.0.1 on Node.js 24, against a test account that had never been CDK bootstrapped.

Review the AgentCore CLI command tree

You get two kinds of commands in 1.0. Project commands act on the folder you are in, while resource commands inspect deployed AgentCore resources by name, ID or ARN. The second group is new, and it matters because you can now look at a Runtime or a Memory from any directory, without the project that created it. So when a colleague asks why their agent is slow, you can read its logs from your own machine. The full tree printed by agentcore --help on the lab machine:

Usage: agentcore [options] [command]

the platform for production AI agents

Options:
  --region <region>  AWS region
  --debug            debug logging (default: false)
  --json             JSON output (default: false)
  -h, --help         display help for command
  -V, --version      display the CLI version

Project:
  create             create a new project
  add                add project resources
  dev                develop and test project agents
  deploy             build and deploy project resources to an AWS target
  invoke             invoke a Runtime, harness, or Gateway
  status             inspect deployed project resources for an AWS target
  logs               stream or search logs for resources in the current project
  traces             inspect traces for resources in the current project
  export             convert project resources into editable code you own
  migrate            migrate an AgentCore CLI v0 project to the current project
                     format, keeping its deployed resources
  remove             remove a resource from the project
  build              build the project's deployable artifacts

Resources:
  harness            manage config-defined agents and their versions
  runtime            inspect hosted agent code, its endpoints, and versions
  gateway            inspect MCP tool gateways and their targets
  identity           manage API key and OAuth credential providers
  memory             inspect agent memory: sessions, events, and records
  eval               evaluate and optimize agents with evaluators and A/B tests
  payment            inspect payment managers, sessions, and instruments

Settings:
  feedback           send feedback about AgentCore to the team
  config             read/write global config values
  update             check for and install CLI updates

If you come from the 0.x line, the biggest change is create. It no longer takes separate flags for the framework, the model provider and Memory. You pick a template instead, and the template decides all three plus the build type, so a script written for the old flags fails on the new CLI. The table compares the two, using the help output of both versions:

Task0.x line1.0
Choose a frameworkcreate --framework Strandscreate --template agent-python-strands
Attach Memorycreate --memory longAndShortTermIncluded in the Strands templates, or agentcore add
Upgrade an old projectNot availableagentcore migrate
Inspect a deployed Runtime by ARNNot availableagentcore runtime, agentcore invoke --runtime <ARN>
Script the outputPer commandGlobal --json, --region and --debug

If you followed an older walkthrough that uses agentcore configure and agentcore launch, you were using the Python starter toolkit, which is a different program with the same command name. Its projects keep their settings in .bedrock_agentcore.yaml, and the npm CLI does not read that file. Every step below uses only the npm CLI.

Before you begin

You need a workstation with the following in place. The CLI drives AWS CDK for deployment, but it installs CDK inside each project, so you do not install CDK yourself.

  1. To run the CLI, install Node.js 20.12 or later.
  2. To build Python agents, install Python 3.10 or later and uv.
  3. To reach your account, configure AWS CLI v2 credentials.
  4. To deploy, use an identity that can create stacks, IAM roles and AgentCore resources.
  5. To call a model, confirm your account can invoke one Bedrock model in your Region.

The lab used Node.js 24, and the Node.js guide for Ubuntu 26.04 covers the NodeSource setup if your distro ships an older release. You need uv because the Python templates run uv sync during create. For credentials, the AWS CLI install guide walks through aws configure, and aws sts get-caller-identity must return your account before you continue. If you work from a scoped user, the IAM users and groups guide shows how to attach policies. Check model access early, because it is the step that failed first in the lab.

AgentCore Runtime, Memory and Gateway are all listed for Europe (Ireland) on the AgentCore supported Regions page. Set the Region once for your shell so the CLI, the AWS CLI and the agent code all agree:

export AWS_REGION=eu-west-1

Every command in this guide reads that variable, so you do not need to pass --region to each one.

Install the AgentCore CLI

The CLI ships as the @aws/agentcore package on npm. Install it globally so the agentcore command lands on your PATH:

npm install -g @aws/agentcore

Newer npm releases print a warning that the protobufjs postinstall script did not run. The lab install worked with that warning in place, and every later step succeeded, so you can leave it. Confirm the version next:

agentcore --version

A bare version number means the npm CLI is the one on your PATH. The first run also prints the telemetry notice and the command to opt out:

1.0.1

The AgentCore CLI collects aggregated, anonymous usage analytics to help improve the tool.
To opt out:   agentcore config telemetry.enabled false
To audit:     agentcore config telemetry.audit true

If you see No such option: --version instead, the Python bedrock-agentcore-starter-toolkit is installed and its own agentcore binary wins. The fix is in the errors section below. Remove the toolkit before you go further, because its deploy and invoke commands look for a different config file and fail on a 1.0 project.

Create an agent project

Run agentcore create --help to list the templates. The current release ships eleven, and the choice decides how much you write yourself:

  1. To get a tool-calling agent with Memory already wired in, use agent-python-strands (or agent-typescript-strands).
  2. To ship your agent as a container instead of a code zip, use agent-python-strands-container. It needs a container engine for dev.
  3. To expose tools to other agents, use mcp-python-fastmcp, a2a-python-strands or agui-python-strands.
  4. To bring your own framework, use agent-python-minimal, or empty for a project with no Runtime at all.

Start with the Python Strands template unless you already know you need another one, because it exercises every part of the deploy path: a Runtime, a Memory resource and a tool. Create the project:

agentcore create --name supportbot --template agent-python-strands

The command installs the CDK app’s npm dependencies, syncs the Python environment with uv and initialises a git repository. It finished in under a minute on the lab machine:

creating project tree
installing CDK dependencies with npm
syncing Python dependencies with uv
initializing git repository
created project 'supportbot' in ./supportbot
next steps:
  cd supportbot
  agentcore dev

You will work with two files. agentcore/agentcore.json declares what gets deployed. In this project it holds one Runtime named agent, built as CodeZip on PYTHON_3_14. It also holds one Memory with four extraction strategies: semantic, user preference, summarization and episodic. app/agent/model/load.py sets the model, and you will most likely edit it first.

Your account may not be allowed to call the template’s default model, global.anthropic.claude-sonnet-5-5. Nothing in create or deploy checks this, so the failure only appears when the agent runs, after you have already waited three minutes for a deploy. Test the model first with one cheap call in the Region your agent will use:

aws bedrock-runtime converse --model-id eu.amazon.nova-2-lite-v1:0 --messages '[{"role":"user","content":[{"text":"Say OK"}]}]' --inference-config maxTokens=10 --query 'output.message.content[0].text' --output text

A text reply means the model works for your account. On the lab account, every Anthropic model returned an access error, while Amazon Nova 2 Lite answered:

OK

How can I assist you today?

To switch the agent to a model your account can use, open the loader from the project root:

cd supportbot
vim app/agent/model/load.py

Change the model_id value. This is the file the lab deployed, copied from the project after the run:

from strands.models.bedrock import BedrockModel


def load_model() -> BedrockModel:
    """Get Bedrock model client using IAM credentials."""
    return BedrockModel(model_id="eu.amazon.nova-2-lite-v1:0")

If your account has Anthropic access, keep the default or pick another Claude inference profile. Either way, the profile must exist in your Region, and aws bedrock list-inference-profiles lists the ones that do.

Run the agent locally

Local runs are free apart from model tokens, so test here before you deploy. The dev command starts the agent under uvicorn with hot reload and a local trace collector. Run it from the project directory in its own terminal:

agentcore dev

Wait for these two lines. They confirm the server is listening on port 8080 on the loopback address only:

[agent] INFO:     Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
[agent] Agent 'agent' is running on port 8080.

In a second terminal, send a prompt that makes the agent use its add_numbers tool. You must name the Runtime with --runtime, even with --local; without it the CLI stops with specify exactly one of --runtime, --harness, --gateway.

agentcore invoke --runtime agent --local --payload '{"prompt": "What is 1234 plus 5678? Use your tool."}'

You get back a server-sent event stream. The first message ends with stopReason set to tool_use, which proves the model called the tool, and the second message carries the answer:

data: {"event": {"messageStart": {"role": "assistant"}}}

data: {"event": {"contentBlockStart": {"start": {"toolUse": {"toolUseId": "tooluse_29PFr8TtmKkHI8gY0VJiqN", "name": "add_numbers", "input": {"a": 1234, "b": 5678}}}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"toolUse": {"input": "{\"a\":1234,\"b\":5678}"}}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockStop": {"contentBlockIndex": 0}}}

data: {"event": {"messageStop": {"stopReason": "tool_use"}}}

data: {"event": {"metadata": {"usage": {"inputTokens": 960, "outputTokens": 37, "totalTokens": 997}, "metrics": {"latencyMs": 523}}}}

data: {"event": {"messageStart": {"role": "assistant"}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "The sum of "}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "1234 and 5678"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " is **6912**."}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": ""}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockStop": {"contentBlockIndex": 0}}}

data: {"event": {"messageStop": {"stopReason": "end_turn"}}}

data: {"event": {"metadata": {"usage": {"inputTokens": 1025, "outputTokens": 18, "totalTokens": 1043}, "metrics": {"latencyMs": 452}}}}

status=200 content-type=text/event-stream; charset=utf-8 runtime-session-id=a1410ca3-2dd1-48f6-bbf1-8615cdc15388 mcp-session-id=- mcp-protocol-version=- trace-id=- trace-parent=- trace-state=- baggage=- complete=true bytes=1354

Read the stream body, not only the last line. When the model call fails, the CLI still reports status=200 and puts the Bedrock error inside a data: event, because the HTTP response had already started before the model answered. So if you wire this into a CI smoke test that checks only the status code, a broken agent passes. Grep the output for "error" as well, and fail the job when it appears. Stop dev with Ctrl+C once your local answer is right.

Deploy the agent to AgentCore Runtime

The deploy command creates the deployment target from your current credentials and Region, synthesizes a CDK app and deploys it as one CloudFormation stack. On an account with no CDK bootstrap in the Region, it bootstraps first. The lab ran the command without a terminal attached (stdin from /dev/null), and it bootstrapped without a prompt, so expect the same from a CI job:

agentcore deploy

The first deploy took 3 minutes 2 seconds in the lab, bootstrap included. The screenshot shows the full output and the two stacks it left in CloudFormation:

agentcore deploy output in eu-west-1 showing Transaction Search enabled, CDK bootstrap and the AgentCore stack created

Two lines in that output change your account, not just your project. The getting started page mentions the bootstrap and that deploy configures CloudWatch observability, but it appears not to say that both are account-wide changes, or that span indexing ends up at 100%. The first, enabling CloudWatch Transaction Search, switches the account’s X-Ray trace destination to CloudWatch Logs and creates the aws/spans and /aws/application-signals/data log groups. In the lab, aws xray get-indexing-rules afterwards showed the Default rule at "DesiredSamplingPercentage": 100.0, modified at the same minute as the deploy. CloudWatch indexes 1% of spans for free, so at 100% you pay CloudWatch rates for indexing the rest.

The second, bootstrapping aws://123456789012/eu-west-1, creates the CDKToolkit stack: an S3 assets bucket, an ECR repository, five IAM roles and a customer managed KMS key. You pay for that key every month whether you deploy again or not, and it stays after you remove the agent.

Neither change is wrong, but you should plan for both before you deploy into a shared account. If your organisation already sends X-Ray traces to a specific destination, or bootstraps CDK with a custom qualifier, the CLI’s defaults can collide with that setup, and you only find out from the deploy log. Deploy to a sandbox account first in that case. Then confirm what was deployed with status:

agentcore status

Both resources should read deployed, with their ARNs. Keep the Memory ID from the second ARN, because the memory commands later need it:

{
  "projectName": "supportbot",
  "target": "default",
  "region": "eu-west-1",
  "resources": [
    {
      "resourceType": "runtime",
      "name": "agent",
      "deploymentState": "deployed",
      "arn": "arn:aws:bedrock-agentcore:eu-west-1:123456789012:runtime/supportbot_default_agent-2m6sTG2zxY"
    },
    {
      "resourceType": "memory",
      "name": "agentMemory",
      "deploymentState": "deployed",
      "arn": "arn:aws:bedrock-agentcore:eu-west-1:123456789012:memory/supportbot_default_agentMemory-6vco9oHIBZ"
    }
  ]
}

Your project stack itself is small. It holds the Runtime, the Memory, two IAM roles and one IAM policy. The code zip uploaded to the bootstrap bucket was 43.6 MB, mostly the Python dependencies.

Invoke the deployed agent

Remote calls use the same invoke command without --local. To make Memory work across calls, pass the same session ID each time. The ID must be at least 33 characters long; a short one fails validation before it reaches the agent.

agentcore invoke --runtime agent --session-id lab-session-0001-aaaaaaaaaaaaaaaaaaaa --user-id alice --payload '{"prompt": "My name is Alice and I run Rocky Linux. What is 1234 plus 5678?"}'

The first call took 10.4 seconds end to end, which includes the microVM cold start. The agent greeted Alice and returned 6912 through the tool. A follow-up call on the same session took 3.3 seconds:

agentcore invoke --runtime agent --session-id lab-session-0001-aaaaaaaaaaaaaaaaaaaa --user-id alice --payload '{"prompt": "Which distro did I say I run?"}'

The answer streams back token by token, and it names Rocky Linux, which came from the earlier turn in the same session:

data: {"event": {"messageStart": {"role": "assistant"}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "You"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " mentioned"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " that"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " you run **"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "Rocky Linux**. It's"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " a powerful"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " and enterprise"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "-grade operating system that's"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " binary"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "-compatible"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " with"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " Red"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " Hat Enterprise"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " Linux ("}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": "RHEL), making"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " it a"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " great choice for servers"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " and production"}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockDelta": {"delta": {"text": " environments."}, "contentBlockIndex": 0}}}

data: {"event": {"contentBlockStop": {"contentBlockIndex": 0}}}

data: {"event": {"messageStop": {"stopReason": "end_turn"}}}

data: {"event": {"metadata": {"usage": {"inputTokens": 1077, "outputTokens": 44, "totalTokens": 1121}, "metrics": {"latencyMs": 542}}}}

status=200 content-type=text/event-stream; charset=utf-8 runtime-session-id=lab-session-0001-aaaaaaaaaaaaaaaaaaaa mcp-session-id=- mcp-protocol-version=- trace-id=- trace-parent=- trace-state=- baggage=- complete=true bytes=2239

Watch what --user-id did not do. The template’s parse.py reads the Memory actor from an actorId field in the payload and falls back to default, so both calls above were stored under actor default, not alice. To keep users apart in Memory, put "actorId": "alice" in the JSON payload.

Check what Memory extracted

Long-term Memory records are extracted in the background, not during the call. In the lab, the two semantic facts appeared 62 seconds after the event was written. Query one namespace at a time, because record list requires either --namespace or --namespace-path:

agentcore memory record list --id supportbot_default_agentMemory-6vco9oHIBZ --namespace /users/default/facts

You see the extracted text, the strategy that produced it and its namespace for each record. The block shows the opening of the response, up to the first record’s timestamps; the metadata and the second record follow in the full output:

{
  "memoryRecordSummaries": [
    {
      "memoryRecordId": "mem-83ae5a43-a44e-4e55-86f3-87278eae092e",
      "content": {
        "text": "Alice runs Rocky Linux."
      },
      "memoryStrategyId": "agentMemory_Semantic-Q53NnEGRzi",
      "namespaces": [
        "/users/default/facts/"
      ],
      "createdAt": "2026-10-29T04:40:48.678Z",
      "timestamp": "2026-10-29T04:39:46.421Z",
      [output truncated]

The second record read The user's name is Alice., and the preferences namespace held one more record for the same fact. If your query returns an empty memoryRecordSummaries list right after an invoke, wait a minute and run it again before you debug the strategy.

Read logs and traces

Your Runtime logs go to CloudWatch, and each line your application writes appears twice, once as OpenTelemetry JSON and once as plain text. Filter them with a CloudWatch Logs pattern so you see your own log calls instead of the telemetry setup noise:

agentcore logs runtime --name agent --since 30m --query '"Invoking with"' --limit 10

Your first two records are the JSON and plain text versions of one log line. They also confirm the actor_id=default behaviour from the previous section:

2026-10-29T04:39:32.388Z  {"timestamp": "2026-10-29T04:39:32.388Z", "level": "INFO", "message": "Invoking with session_id=lab-session-0001-aaaaaaaaaaaaaaaaaaaa and actor_id=default", "logger": "bedrock_agentcore.app", "requestId": "98327d94-344c-48b8-a7fe-2b9d8fb838fd", "sessionId": "lab-session-0001-aaaaaaaaaaaaaaaaaaaa"}
2026-10-29T04:39:32.388Z  2026-10-29 04:39:32,388 INFO [bedrock_agentcore.app] [main.py:50] [trace_id=6ae2cdfe16d4920157d519d5614fd5a7 span_id=f90903d5c7841c34 resource.service.name=supportbot_default_agent.DEFAULT trace_sampled=True] - Invoking with session_id=lab-session-0001-aaaaaaaaaaaaaaaaaaaa and actor_id=default

You can narrow the same command in three ways, and each one helps a different job:

  1. To watch a live test, add --tail and invoke from a second terminal.
  2. To find failures, add --level error.
  3. To read an older window, set --since and --until to ISO 8601 times.

Traces come from the Transaction Search setting that your deploy enabled. List the recent ones:

agentcore traces runtime list --name agent

Each invoke produced one trace. The trace ID matches the trace_id in the log line above, which is how you tie a slow response to its spans:

TRACE ID                          TIMESTAMP             SESSION ID
6ae2ce1128e214614b6958236a2ffa3d  2026-10-29 04:39:46Z  -
6ae2cdfe16d4920157d519d5614fd5a7  2026-10-29 04:39:34Z  -

Expect the session column to stay empty; it did in the lab even though both calls used a session ID. To read the spans themselves, run agentcore traces runtime get <trace-id>, which writes the trace’s records to a JSON file in the current directory.

Migrate a 0.x project

Projects created with the 0.x CLI carry "version": 1 in agentcore.json, and agentcore migrate rewrites them to "version": 2 while keeping any deployed resources. The migrate output calls the target v1, meaning the 1.x CLI, not the config field. To test it, the lab created a Strands project with the 0.x CLI and ran migrate from inside it. You follow the same order on your own project:

  1. To give migrate something to roll back to, commit the project to git. It refuses to run otherwise.
  2. To see the plan without changing files, run agentcore migrate on its own first.
  3. To apply it, run agentcore migrate --yes, then review git diff before you deploy.

The lab project was not under git yet, so it needed the commit first:

git init && git add -A && git commit -m "v0 project"
agentcore migrate --yes

Without --yes, migrate prints the plan and waits for confirmation. With it, the run checks the project, writes a plan file, rewrites the files and reinstalls the CDK app:

Checking the project

Migration plan: legacybot → v1
  Nothing is deployed yet, so only the project files change
  Changes 11 files (agentcore/agentcore.json, agentcore/cdk/…)

Full plan: agentcore/.cli/migrate/plan-20261029T044234Z.md

Recording the migration in agentcore/.cli/migration-state.json
Writing the v1 project files
Installing the v1 CDK app's dependencies (npm install)


Migrated. Review the changes with `git diff`, then run `agentcore deploy`.
Details: agentcore/.cli/migrate/result-20261029T044234Z.md

Afterwards, git status showed agentcore.json and the CDK app modified, with jest.config.js, test/cdk.test.ts, .prettierrc and .npmignore deleted from agentcore/cdk/. Read the plan file before you run agentcore deploy on a project that is already live. Migrate does not touch projects from the Python starter toolkit, which store their settings in .bedrock_agentcore.yaml; recreate those with agentcore create and copy your agent code into app/.

Fix common AgentCore CLI errors

Each error below was hit in the lab, with the exact text the CLI printed. Two problems you might expect did not reproduce. The deploy never failed on a missing CDK bootstrap, because the CLI bootstrapped on its own, and eu-west-1 supported every resource the template used. When you hit an error, check these in order, because the earlier ones hide the later ones:

  1. Confirm which -a agentcore prints one path.
  2. Confirm the model answers a converse call from your account.
  3. Confirm the flags match the 1.0 help output, not an older guide.

The exact messages and their fixes follow.

Error: “No such option: –version”

The Python bedrock-agentcore-starter-toolkit also installs a command called agentcore, and whichever directory comes first on your PATH wins. In the lab, toolkit 0.3.14 shadowed the npm CLI, rejected --version, and on agentcore deploy crashed with FileNotFoundError: Configuration not found: .../.bedrock_agentcore.yaml. First check which binaries exist:

which -a agentcore

Two paths means two tools. Remove the toolkit with the installer you used for it, then open a new shell so the command hash clears:

uv tool uninstall bedrock-agentcore-starter-toolkit
pip uninstall bedrock-agentcore-starter-toolkit

Run only the line that matches your install. After the uninstall, agentcore --version printed the npm version again.

Error: “is not available for this account”

The full message was AccessDeniedException ... anthropic.claude-sonnet-5-5 is not available for this account. It came back inside the invoke stream with status=200, so the CLI call itself looked successful. Your account cannot call the template’s default model. Pick a model that answers the converse test from the create section and set it in app/agent/model/load.py.

Error: “Model use case details have not been submitted for this account”

This ResourceNotFoundException means the account has not filled in the Anthropic use case form in the Bedrock console. In the lab it was inconsistent: a Claude Sonnet 4.6 call succeeded once and then failed with this message seconds later. Submit the form from the Bedrock model catalog and allow up to 15 minutes, or use an Amazon model such as Nova 2 Lite, which needs no form.

Error: “specify exactly one of –runtime, –harness, –gateway”

Since 1.0, invoke can target a Runtime, a harness or a Gateway, and it no longer guesses. Add --runtime agent (the Runtime name from agentcore.json), or pass a Runtime ID or ARN to invoke one outside the project.

Error: “Member must have length greater than or equal to 33”

The full message is Value at 'runtimeSessionId' failed to satisfy constraint. The lab hit it with --session-id short1. Use an ID of 33 or more characters, such as a UUID with a prefix.

Error: “agentcore migrate requires the project to be in a git repository”

Migrate refuses to change files you cannot roll back. Commit your project to git, as shown in the migrate section, and run it again.

Error: “declares no resources to deploy”

This is a guard, not a fault. After agentcore remove all, a plain agentcore deploy stops because deploying an empty project deletes the stack. Add --yes when deletion is what you want. The same applies to remove all itself, which refuses to run non-interactively without --yes.

Estimate what the deploy costs

AgentCore has no free tier for Runtime or Memory. The AgentCore pricing page quotes Runtime v2 consumption at $0.1276 per vCPU-hour and $0.0169 per GB-hour, billed per second (v1 runtimes list lower rates). CPU is not charged while the agent waits on the model. Memory is billed on what the session uses, with a 128 MB minimum, from the moment the microVM is ready until the session ends, although v2 reclaims idle memory after 120 seconds. Cost Explorer had not posted any AgentCore line for the lab day when this was written, so the table uses those published rates against what the lab actually created:

ItemLab usageRateCost
Runtime2 successful invokes in one session (13.7 seconds of request time, plus idle memory until v2 reclaimed it)$0.1276 per vCPU-hour, $0.0169 per GB-hour (v2)Under $0.01
Memory, long-term records3 records$0.75 per 1,000 records per monthUnder $0.01
Memory, short-term eventsEvents from 2 turns, billed at 12 KB minimum each$1.00 per GBUnder $0.01
Model tokensA few thousand Nova 2 Lite tokensBedrock on-demandUnder $0.01
CDKToolkit KMS key1 key, kept after cleanup$1 per key-month (KMS pricing)About $1 per month until deleted

Your agent itself costs cents at this scale. The line that keeps billing you is the bootstrap key, which outlives the agent by design. Span ingestion into aws/spans is billed at CloudWatch rates too, and a busy agent with 100% indexing will cost more there than a test like this one.

Clean up

To stop paying for the agent, empty the project and deploy the empty state. The CLI has no single destroy command; removal is a config change followed by a deploy.

  1. To empty agentcore.json, run agentcore remove all --yes.
  2. To delete the stack, run agentcore deploy --yes.
  3. To confirm, list your stacks, Runtimes and Memories with the AWS CLI.

Run the two removal commands from your project directory. The first prints removed all resources from project and leaves your code in app/. The second printed removing stack AgentCore-supportbot-default in the lab and finished in 2 minutes 47 seconds:

agentcore remove all --yes
agentcore deploy --yes

Then check that the AgentCore resources are gone:

aws cloudformation describe-stacks --query 'Stacks[].[StackName,StackStatus]' --output text
aws bedrock-agentcore-control list-agent-runtimes
aws bedrock-agentcore-control list-memories

The project stack is gone and both lists are empty. Only CDKToolkit remains:

CDKToolkit	CREATE_COMPLETE
{
    "agentRuntimes": []
}
{
    "memories": []
}

Four things survive agentcore deploy --yes, and you remove them by hand if this account will not run AgentCore again:

  • The CDKToolkit stack, with its KMS key and assets bucket.
  • The Runtime log group, created with no retention period.
  • The aws/spans and /aws/application-signals/data log groups.
  • Transaction Search, still ACTIVE.

The assets bucket still holds your 43.6 MB code zip, and the bootstrap template keeps the bucket when the stack is deleted, so you empty and delete it separately. The Runtime log group, /aws/bedrock-agentcore/runtimes/supportbot_default_agent-2m6sTG2zxY-DEFAULT in the lab, never expires its data unless you set a retention or delete it, and the same goes for /aws/application-signals/data; aws/spans keeps 30 days. You can turn Transaction Search off with aws xray update-trace-segment-destination --destination XRay, but only if nothing else in your account relies on it.

The lab deleted the Runtime log group with the first command below. The other two were left for the account owner because they change account-wide settings, so they were not run here; check them against your account before you use them. The second drops span indexing back to the free 1% while keeping Transaction Search on, and the third removes the bootstrap stack and its KMS key:

aws logs delete-log-group --log-group-name /aws/bedrock-agentcore/runtimes/supportbot_default_agent-2m6sTG2zxY-DEFAULT
aws xray update-indexing-rule --name Default --rule '{"Probabilistic":{"DesiredSamplingPercentage":1}}'
aws cloudformation delete-stack --stack-name CDKToolkit

Because the assets bucket is versioned and retained, deleting the stack leaves it behind. Empty it with the Empty button in the S3 console, which removes every object version, then delete the bucket.

Keep the bootstrap stack if you deploy other CDK apps in the Region, because they share it. If you run other agent tooling from the same machine, such as the DeepSeek harness or Claude Code with MCP servers, they do not depend on any of these resources. For secrets your agent reads at runtime, store them in AWS Secrets Manager with rotation rather than in the project’s .env.local file.

Keep reading

Open Source LLM Comparison Table (2026) AI Open Source LLM Comparison Table (2026) Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) AI OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) Install InvokeAI 7 on Linux with NVIDIA: Tested VRAM per Model AI Install InvokeAI 7 on Linux with NVIDIA: Tested VRAM per Model Install openSUSE with Claude Code: Agama MCP Server Tested AI Install openSUSE with Claude Code: Agama MCP Server Tested OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF) AI OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF)

Leave a Comment

Press ESC to close