Overview
AgentLoop console supports integration into third-party systems via embedding. You can open a specified AgentSpace page through a login-free link and use URL parameters to control the navigation, the page header, the AgentSpace switching entry, and the initial state of some business pages.
The recommended domain for embedded access is:
https://agentloop4service.console.alibabacloud.comDo not mix the regular console domain with the embedded domain. Embedded access should always use the 4service domain mentioned in this document to avoid inaccessible pages due to inconsistent login states.
Page URL format
The AgentSpace page URL format is as follows:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/{appPath}Parameter descriptions:
Parameter | Description |
| The region where the AgentSpace is located, for example |
| AgentSpace name |
| The page path to open |
Example:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/agent-insightCommon page paths:
Page |
| Description |
Quick start |
| Opens the Quick start page |
Agent Insights |
| Opens the Agent observability analysis page |
Agent comparison |
| Opens the Agent comparison page |
AI Agent Observability |
| Opens the AI Agent Observability main entry |
Dashboard |
| Opens the Dashboard page |
Integration Center |
| Opens the Integration Center page |
Agent trajectory |
| Opens the Agent trajectory page |
Evaluation tasks |
| Opens the evaluation tasks page |
Evaluation analysis insights |
| Opens the Evaluation analysis insights page |
Evaluator |
| Opens the Evaluator page |
Experiment plan |
| Opens the Experiment plan page |
Experiment record |
| Opens the Experiment record page |
The {agentSpaceName} path variable must be URL-encoded when the address is concatenated.
Generate login-free links
You can refer to the Alibaba Cloud Management Console login-free link generation method, using the AgentLoop target page as the Destination to generate a login-free link that can be placed in an iframe.
Step 1: Generate Destination
Destination is the AgentLoop page that users will ultimately open after login-free authentication.
const destination = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/evaluate-task'
);
destination.searchParams.set('hiddenSwitch', 'true');
destination.searchParams.set('hiddenBackHome', 'true');
destination.searchParams.set(
'embed',
JSON.stringify({
sidebar: 'hidden',
header: 'hidden',
eval: {
dataSource: 'trace',
serviceName: '{serviceName}',
},
})
);Step 2: Obtain temporary credentials
The third-party system server calls STS AssumeRole to obtain temporary credentials. Configure least privilege based on user, tenant, or business resource scope. A token can only be used once. For details, see AssumeRole.
Common parameters:
Parameter | Description |
| The ARN of the RAM role to be assumed |
| Session name. Use an auditable business user identifier. |
| Validity period of temporary credentials |
| Optional. Used to further restrict the scope of resources accessible in this session. |
Do not save or transmit long-term AccessKey in the browser frontend.
Step 3: Obtain SigninToken
Call RAM single sign-on (SSO) to obtain the SigninToken. The link format is as follows. Note: TicketType must be set to mini.
http://signin.aliyun.com/federation?Action=GetSigninToken
&AccessKeyId=<Temporary AK returned by STS>
&AccessKeySecret=<Temporary Secret returned by STS>
&SecurityToken=<Security Token returned by STS>
&TicketType=miniTo avoid exposing sensitive information, GetSigninToken should only be called on the server side. Do not concatenate or expose temporary keys in the browser frontend.Step 4: Generate login-free link
Append the returned SigninToken to the prepared link to generate a password-free access link.
const loginUrl = new URL('https://signin.aliyun.com/federation');
loginUrl.searchParams.set('Action', 'Login');
loginUrl.searchParams.set('LoginUrl', 'https://{your-domain}/login-expired');
loginUrl.searchParams.set('Destination', destination.toString());
loginUrl.searchParams.set('SigninToken', signinToken);
console.log(loginUrl.toString());Final URL format:
http://signin.aliyun.com/federation?Action=Login
&LoginUrl=<The address to redirect to when login expires, typically configured as a URL that performs a 302 redirect in your custom web service. Use encodeURL to encode LoginUrl.>
&Destination=<The actual page to access. If there are parameters, use encodeURL to encode them.>
&SigninToken=<The obtained login token. Use encodeURL to encode the token.>iframe example:
<iframe
src="{loginUrl}"
width="100%"
height="100%"
frameborder="0"
allowfullscreen
></iframe>Embedded parameters
AgentLoop supports the following URL parameters to control the display and behavior of embedded pages.
embed
embed is used to pass structured embedding configuration as a JSON string. When appended to a URL, it must be URL-encoded.
Readable form:
?embed={"sidebar":"hidden","header":"hidden","eval":{"dataSource":"trace","serviceName":"{serviceName}"}}Structure definition:
interface EmbedConfig {
sidebar?: 'hidden';
header?: 'hidden';
eval?: {
dataSource?: 'trace' | 'atif' | 'log' | 'dataset';
serviceName?: string;
explorer?: {
timePicker?: 'hidden';
topBar?: 'hidden';
filterSidebar?: 'hidden';
timeRange?: {
from: number;
to: number;
};
};
};
}Parameter descriptions:
Parameter | Possible values | Description |
|
| Hides the entire AgentSpace left-side area, including the logo, the AgentSpace selector, the menu, and the collapse button. Suitable for scenarios where the third-party system provides its own navigation. |
|
| Hides the header of the AgentSpace content area, including the page title, the top tabs, and the operation area on the right. It does not control the outermost top bar of the Alibaba Cloud Management Console. |
|
| Pre-fills the data source type when the create task form is opened on the Evaluation tasks page |
| Service name | Pre-fills the service name when the create task form is opened on the Evaluation tasks page |
|
| Hides the time picker on the Evaluation analysis insights page |
|
| Hides the search, aggregation, and log area at the top of the Evaluation analysis insights page |
| Number | Initial start time, a second-level Unix timestamp |
| Number | Initial end time, a second-level Unix timestamp |
timeRange.from must be smaller than timeRange.to, and both values use second-level Unix timestamps. embed.eval only pre-fills the create task form; it does not open the form automatically.
Generation example:
const targetUrl = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/evaluate-task'
);
targetUrl.searchParams.set(
'embed',
JSON.stringify({
sidebar: 'hidden',
eval: {
dataSource: 'trace',
serviceName: '{serviceName}',
},
})
);
console.log(targetUrl.toString());Generated URL example:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/evaluate-task?embed=%7B%22sidebar%22%3A%22hidden%22%2C%22eval%22%3A%7B%22dataSource%22%3A%22trace%22%2C%22serviceName%22%3A%22%7BserviceName%7D%22%7D%7DhiddenSwitch
Hides the AgentSpace switching entry.
hiddenSwitch=trueIf the third-party system has already fixed the current AgentSpace, enable this parameter to prevent users from switching to other spaces within the embedded page.
hiddenBackHome
Hides the "Back to Home" entry.
hiddenBackHome=trueIf the third-party system wants users to stay on the specified AgentSpace page, enable this parameter to prevent users from returning to the AgentLoop home page.
and are evaluated by presence only. Even if the value is false, the parameter still takes effect as long as it appears in the URL. To restore the AgentSpace switching entry or the home page entry, remove the corresponding parameter from the URL.
Recommended parameter combinations
Hide left-side navigation
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/agent-insight?embed=%7B%22sidebar%22%3A%22hidden%22%7DHide the page header
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/agent-insight?embed=%7B%22header%22%3A%22hidden%22%7DDisable space switching and return to home
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/agent-insight?hiddenSwitch=true&hiddenBackHome=true&embed=%7B%22sidebar%22%3A%22hidden%22%2C%22header%22%3A%22hidden%22%7DHide navigation and pre-fill evaluation task parameters
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/evaluate-task?hiddenSwitch=true&hiddenBackHome=true&embed=%7B%22sidebar%22%3A%22hidden%22%2C%22eval%22%3A%7B%22dataSource%22%3A%22trace%22%2C%22serviceName%22%3A%22%7BserviceName%7D%22%7D%7DSimplify the Evaluation analysis insights page
Generating the address with the standard browser API avoids manual handling of JSON, spaces, and quotation marks:
const targetUrl = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/explorer'
);
targetUrl.searchParams.set(
'embed',
JSON.stringify({
sidebar: 'hidden',
header: 'hidden',
eval: {
explorer: {
timePicker: 'hidden',
topBar: 'hidden',
filterSidebar: 'hidden',
timeRange: {
from: 1785427200,
to: 1785513600,
},
},
},
})
);
console.log(targetUrl.toString());Evaluation page parameters
Besides the embed configuration, the evaluation pages read a small set of URL parameters that open a specific form or restore a specific initial state.
Open the create task form automatically
Page path:
/app/evaluate-taskParameter descriptions:
Parameter | Required | Possible values | Description |
| Yes |
| Opens the create task form automatically |
| No |
| Pre-fills the data source |
| No | Dataset name | Pre-fills the dataset when the data source is |
Example:
const targetUrl = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/evaluate-task'
);
targetUrl.searchParams.set('action', 'create');
targetUrl.searchParams.set('dataSource', 'dataset');
targetUrl.searchParams.set('datasetName', '{datasetName}');After the page consumes these one-time parameters, action, dataSource, and datasetName are removed from the address bar so that a refresh does not trigger the form again.
Open the task edit form
/app/evaluate-task?editTaskId={taskId}editTaskId is also removed from the address bar after it is consumed.
Open task details
Page path:
/app/evaluate-task-detailParameter descriptions:
Parameter | Required | Description |
| Required when viewing, copying, or editing an existing task | Evaluation task ID |
| No |
|
| No | The current details flow supports |
Set the initial state of Evaluation analysis insights
Page path:
/app/explorerParameter descriptions:
Parameter | Type | Default value | Description |
| String | Empty | Initial query statement. It must be URL-encoded. |
| String |
| Initial primary aggregation dimension. Supported values: |
| String |
| Initial secondary aggregation dimension. The values are the same as |
Example:
const targetUrl = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/explorer'
);
targetUrl.searchParams.set('q', 'status: success');
targetUrl.searchParams.set('groupBy', 'evaluator');When no aggregation is needed, omit groupBy and subGroupBy or set them to none.
AI Agent Observability page
The current main entry of the AI Agent Observability page is:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/llm_agent/app-listThe main entry selects the inner page in the following order:
If
traceIdis passed, Trace details opens.If
traceIdis not passed andtargetPage=session-explorer, Session Explorer opens.In all other cases, the AI application list opens.
Open application list
When neither traceId nor targetPage is passed, the page opens the application list.
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/llm_agent/app-list?hiddenSwitch=true&hiddenBackHome=trueOpen Trace details
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/llm_agent/app-list?traceId={traceId}&startTime={startTime}&endTime={endTime}&hiddenSwitch=true&hiddenBackHome=trueParameter descriptions:
Parameter | Required | Description |
| Yes | Trace ID. The main entry is case-sensitive, so use this spelling. |
| No | Query start time. AgentLoop Trace deep links currently use millisecond-level Unix timestamps. If it is not passed, the default value is one hour before the current time. |
| No | Query end time. AgentLoop Trace deep links currently use millisecond-level Unix timestamps. If it is not passed, the default value is the current time. |
Open Session Explorer
const targetUrl = new URL(
'https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/llm_agent/app-list'
);
targetUrl.searchParams.set('targetPage', 'session-explorer');
targetUrl.searchParams.set(
'filters',
'attributes.gen_ai.session.id: "{sessionId}"'
);
targetUrl.searchParams.set('queryTimeType', '99');
targetUrl.searchParams.set('startTime', '{startTime}');
targetUrl.searchParams.set('endTime', '{endTime}');Parameter descriptions:
Parameter | Required | Description |
| Yes | Set to |
| No | Session or Trace filter expression |
| No | Query statement that is passed through to the inner query page |
| No | Time mode of the downstream page. AgentLoop internal deep links currently pass |
| No | Query start time. AgentLoop Session deep links currently use second-level Unix timestamps. |
| No | Query end time. AgentLoop Session deep links currently use second-level Unix timestamps. |
Session deep links use second-level timestamps while Trace deep links use millisecond-level timestamps, so convert the time values according to the page you open. Encode all service names, dataset names, query statements, and filter expressions with URLSearchParams.
Trace component route compatibility parameters
When the deployed dynamic module registers /app/llm_agent/trace-detail, that component route additionally supports the following parameters:
Parameter | Required | Description |
| Yes | Trace ID. The component route also accepts the lowercase spelling. |
| No | Supports second-level or millisecond-level timestamps. |
| No | Supports second-level or millisecond-level timestamps. |
| No | Specify Span ID |
| No | Initial tab on the Trace details page |
| No | Trace query source identifier |
| No | Page source identifier |
| No | Span detail filter conditions |
| No | Span time series filter conditions |
The /app/llm_agent/app-list main entry does not forward all of these advanced parameters. For a stable, unified entry, use only traceId, startTime, and endTime, which the main entry supports.
Integration Center page
The Integration Center page path is:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/integratingcenterYou can combine embedded parameters as needed, for example:
https://agentloop4service.console.alibabacloud.com/agentloop/region/{regionId}/agentspace/{agentSpaceName}/app/integratingcenter?hiddenSwitch=true&hiddenBackHome=true&embed=%7B%22sidebar%22%3A%22hidden%22%2C%22header%22%3A%22hidden%22%7DIntegration best practices
Generate login-free links on the server side:
AssumeRole,GetSigninToken, and the final Login URL should all be completed on the server side. The browser frontend only receives the final accessible iframe URL.Always use the 4service domain:
Destinationmust useagentloop4service.console.alibabacloud.com.Handle URL encoding correctly:
Destinationitself may contain query parameters and must be entirely encoded when written into the Login URL. UseURLandURLSearchParamsfor generation.Hide console navigation as needed: If the external system already provides navigation, use a combination of
embed={"sidebar":"hidden","header":"hidden"},hiddenSwitch=true, andhiddenBackHome=true.Control login-free link expiration: Refresh the login-free link before the
SigninTokenexpires to prevent the page within the iframe from becoming inaccessible due to expired login state.Least privilege authorization: RAM role permissions should be scoped to the necessary AgentLoop, logging, and observability resources according to business requirements.
Parameter parsing and compatibility rules
embedmust be valid JSON. If parsing fails, the entireembedconfiguration is ignored.embedis parsed only once during the lifecycle of the current page. Reload the page after the parameter is changed.Unrecognized
embedfields have no effect.URL parameters control only the display and the initial state. They do not provide access control, and hiding a menu or a header does not replace RAM, AgentSpace, or data permission verification.
Encode all user input, service names, dataset names, query statements, and filter expressions with
URLSearchParams.Query parameters and runtime fields that are not listed in this document are not part of the public integration protocol. Do not concatenate them yourself and do not add them to online documentation.
FAQ
Issue | Troubleshooting |
Not logged in shown in iframe | Confirm that |
No permission shown in iframe | Confirm that the RAM role permissions cover the target AgentSpace and its associated resources. |
User can switch AgentSpace | Add |
User can return to AgentLoop home page | Add |
Left-side navigation still displays | Confirm that |
Page header still displays | Confirm that |
Switching entry is still hidden after is passed | This parameter is evaluated by presence. Remove it from the URL to restore the entry. |
Create task form does not open automatically | Use |
Service name not pre-filled when creating evaluation task | Confirm that the |
Session is not opened on the AI Agent page | Use the current entry |
Page does not change after | The configuration is parsed only once. Reload the page after the URL is changed. |