High-code Agents allow you to deploy self-developed Agent applications as container images to AgentCore. You can keep your existing development frameworks and HTTP services, configure the runtime environment in the console, debug conversations, and obtain the invocation endpoint.
This topic describes console operations. For application development, SDK installation, and framework integration, see Developer Reference. For a quick start, see Use the Python SDK to quickly create a pro-code Agent.
Prerequisites
-
AgentCore is activated and a workspace is created. For more information, see Manage Workspace.
-
A runnable Agent container image is prepared and pushed to Enterprise Container Registry (ACR).
-
The startup command, listening port, health check path, and conversation protocol of the application are determined.
-
If the application uses platform models, MCP tools, or Skills, the corresponding resources are configured in the target workspace and an execution role with the required permissions is prepared.
Note: This topic describes deploying self-built code to AgentCore managed runtime. It does not describe integrating a locally running Agent into the platform. Self-built HTTP services do not need to be replaced with AgentCoreServer. However, the actual interfaces must match the protocol and path configured in the console.
Step 1: Check the image and application configuration
Before creating, confirm that the image meets the following requirements.
| Item | Requirement |
|---|---|
| Image architecture | Supports linux/amd64 (x86_64). ARM64-only images are not supported. |
| Shell environment | Both /bin/bash and /bin/sh are available and executable in the image. |
| Image repository | Only Enterprise ACR is supported. The instance must enable public anonymous pull, and the image repository must be set to public. Do not embed keys or sensitive business data in public images. |
| Service listening | The application listens on 0.0.0.0. The service port must match the console configuration. Services listening only on 127.0.0.1 cannot receive requests forwarded by the platform. |
| Health check | The application provides an accessible health check endpoint. The path and port depend on the application implementation. |
| Dependencies and configuration | The image includes the programs, dependencies, and files required for startup. Business environment variables are configured during deployment as needed. |
The image repository must be reachable from the Agent runtime environment. The ability to push or pull images locally does not mean the cloud can pull them. For network settings, see "Configure network and logs" below. For image build examples, see Use the Python SDK to quickly create a pro-code Agent.
Step 2: Create a high-code Agent
1. Go to the creation page
-
Log on to the AgentCore console.
-
Select the target region at the top and switch to the target workspace.
-
In the left navigation pane, click Agent, then click Create Agent.
-
In Select creation method, select Custom code / Image.
2. Configure basic information and container image
In the Basic Information area, fill in the following fields.
| Parameter | Description |
|---|---|
| Agent name | Enter a name for identification, such as my-code-agent. |
| Description | Optional. Enter the purpose or responsibility of the application. |
| Container image instance | Select the prepared Enterprise ACR instance. After creating a new instance, click the refresh button to reload. |
| Repository | Select the repository that contains the image. |
| Image version | Select the version to deploy from the version list. You can verify the version by Digest, image size, and last push time. |
We recommend using explicit version tags for each release to facilitate deployment verification and troubleshooting.
3. Configure startup and execution role
| Parameter | Description |
|---|---|
| Startup command | Enter the application startup command executable in the image. Do not copy examples that do not match your directory or entry file. |
| Service port | Enter the actual listening port of the application. The default value is 8080. If the application listens on 9000, change it to 9000. |
| Execution role | Select a role that grants the Agent the cloud resource access permissions required at runtime. You can check permissions via View policies and update the role list via the refresh button. |
| Environment variables | Add names and values as required by the application. Both form mode and JSON mode are supported. If the application does not require additional environment variables, leave this field empty. |
The execution role is used by the Agent to access cloud resources. It is not the API Key for external calls to the Agent. For role requirements, see Authorization Description on the page.
The state of the selected role determines the authorization options available on the page:
-
If the role is displayed as Not created, click Create and authorize with one click. The platform creates the role and attaches the required policies.
-
If the role already exists but lacks the required permissions, the page lists the missing permissions. Click One-click authorization to add them, or click Go to the RAM console to authorize to handle the authorization yourself.
-
After the authorization is complete, the page displays The authorization is successful and the permission has taken effect. If the authorization is not complete or the permission has not taken effect, try again.
Note: If your browser blocks the authorization pop-up, allow pop-ups and try again. If the current account does not have the required permissions, the page cannot list roles. Contact the Alibaba Cloud account or a permission administrator to grant the permissions.
When using platform models, MCP tools, or Skills, reference the corresponding resources in your code. The high-code creation page does not generate prompts, select models, or register tools for the application like managed Harness does. For integration methods, see the SDK guide for your language.
4. Declare the conversation protocol
In Protocol configuration, click Configure, select the protocols supported by your application, enter the Path, and add Headers as needed. You can declare both protocols simultaneously.
| Option | Scenario | Default Path |
|---|---|---|
| Chat Completions | Call the Agent using the OpenAI Chat Completions format. | /openai/v1/chat/completions |
| AGUI | Use the AG-UI format for streaming conversations to display the execution process and tool events returned by the application. | /ag-ui/agent |
-
Path: Enter the actual interface path of the application, starting with
/. Do not include the full domain name. For example, if your service uses/v1/chat/completions, change it to that path. -
Header: Enter the fixed request headers required to call the protocol interface. Leave empty if not required. Do not enter the downstream model API Key as the Agent interface authentication information.
After filling, click Save in the dialog.
Note: Declaring a protocol does not automatically generate the corresponding interface for the application, nor does it add tool events. If no protocol is declared, the console debug panel cannot initiate conversations by protocol. If the declaration does not match the actual interface, 404 errors or response parsing failures may occur.
5. Configure runtime resources and health check
In Advanced configuration, adjust the following parameters as needed.
| Configuration item | Description |
|---|---|
| Specification | Select the CPU and memory for the application. |
| Instance count | Set the number of running instances. |
| Max sessions per instance | Set the maximum number of sessions per instance, adjusted based on the application concurrency. |
| Session TTL (seconds) | Set the session lifetime parameter. This is not the timeout for a single model generation. |
| Session isolation | Select based on your business needs: Disabled, Session affinity, or Header isolation, and complete the configuration for the selected method. |
| Health check | Enter the check path, check port, check interval, timeout, and unhealthy threshold. |
The platform performs health checks based on the configuration. Consecutive check failures affect traffic to the instance and may trigger instance restarts. Therefore, you cannot change only the service port without updating the check port to match.
The following are deployment values for the Python quick start example. They apply only to that example. For other applications, fill in values based on actual implementation.
| Configuration item | Example value |
|---|---|
| Startup command | uvicorn app:server --host 0.0.0.0 --port 9000 |
| Service port | 9000 |
| Protocol and path | AGUI, /ag-ui/agent |
| Health check path | /readyz |
| Health check port | 9000 |
Note: The default health check path on the creation page is /healthz. Applications using /readyz or other paths must manually update the value. Do not keep the default page value.
6. Configure network and logs
Network configuration
-
If the application needs to access public model services or other public endpoints, enable Allow default network interface to access public network.
-
If the application needs to access VPC resources in the workspace, enable Allow VPC access. This uses the VPC configuration of the current workspace.
-
When VPC access is not enabled, images are pulled over the public network. If ACR has a public access whitelist, add the Current workspace public egress IP shown on the page to the whitelist. After enabling VPC access, the platform attempts to pull images via VPC. Confirm that ACR allows access from the corresponding VPC.
Log configuration
We recommend enabling Enable logs, selecting Log project and Logstore to view runtime logs during deployment or invocation exceptions. The application should also output startup information and error logs for troubleshooting. Avoid printing keys and sensitive business content.
7. Submit
Verify the image version, startup command, service port, protocol path, and health check configuration, then click Create Now in the upper-right corner.
After creation, return to the Agent list and wait for the status to become Running. Hover over the corresponding card and click Details to view saved image version, startup configuration, and protocol declarations in Overview and configuration.
Step 3: Debug in the console
-
Open the Agent details and click Debug.
-
Select the declared protocol from the dropdown and confirm that Debug endpoint is ready.
-
Enter a simple message, such as "Hello, please introduce yourself in one sentence," and click send.
-
Check whether the Agent returns the expected response. Then test requests that require tool invocation or business resource access.
To start a new conversation, click Create session. For troubleshooting, copy the session ID from the page and view the corresponding logs via Runtime logs for the relevant time period.
Note: Whether the execution process and tool calls are displayed depends on the protocol events returned by the application. Selecting AGUI in the console does not automatically add events that the code does not output.
Step 4: Call from your application
-
In the Agent details, click External channel configuration.
-
Click Direct access to view the Endpoint status and invocation address.
-
In Authentication, click Get authentication info and configure the caller with the Header name and API Key shown on the page.
-
Follow the API call instructions and call examples on the page to send requests, using the path and request format consistent with the protocol declaration.
The Endpoint is the access address of the Agent application, not the downstream model provider address. Store the API Key in a trusted server-side configuration. Do not write it into public frontend code or documentation.
For development examples of request bodies and streaming responses, see the AgentCore Python SDK User Guide or Node.js SDK User Guide for "Call Agent services." Self-built servers use their actual protocol implementation.
Update the Agent
-
Push the new image version to ACR.
-
Open the Agent details, click Edit configuration in Overview and configuration. You can also enter from the list card via Edit.
-
Refresh the image version list and select the new version. If the application entry, port, or protocol changes, update the startup command, service port, health check, and protocol configuration accordingly.
-
Click Save and wait for the update to complete. Re-run console debugging and business call verification.
Updates may affect in-flight requests. We recommend performing updates during an appropriate business window. Do not assume the Agent is using the new version based solely on the new image appearing in ACR. Verify in the Agent configuration.
View status and troubleshoot
| Entry | Purpose |
|---|---|
| Overview and configuration | Verify the current image version, startup command, port, environment variables, and protocol declarations. |
| Instances and sessions | View instance status, session count, and locate by instance ID or session ID. |
| Observability → Basic monitoring | View runtime data for the selected time range. |
| Observability → Runtime logs | View collected application logs. |
| Symptom | Check first |
|---|---|
| Image not found or pull failed | Region, ACR instance and repository, image version, public anonymous pull configuration, and public whitelist or VPC access configuration. |
| Instance not ready or restarting repeatedly | Image architecture, shell, startup command, dependencies, resource specification. Verify the application listening address, service port, health check path, and port. |
| No protocol available on the debug page | In Edit configuration → Protocol configuration, declare the protocols supported by the application and save. |
| 404 on call | Whether the protocol Path matches the application route, and whether example paths were mistakenly used for the self-built service. |
| Authentication error on call | Distinguish the Endpoint API Key for external calls from the execution role for cloud resource access. Check based on the failure point. |
| Normal conversation, but model or tool calls fail | Resource names referenced in code, workspace, execution role permissions, and whether downstream services are reachable. |
| No runtime logs | Whether logs are enabled and the correct log project and Logstore are selected. Whether the application outputs logs, and whether the query time covers the failure. |
When contacting technical support, provide the region, workspace ID, Agent ID, failure time, and error message. If available, also provide the session ID or request ID. Do not include API Keys or full sensitive request headers.