Service providing method, connection manager, and sandbox system

By introducing a connection manager and a container manager into the sandbox system, sandbox containers matching the agent's session topics are created, enabling session-level isolation and dynamic resource allocation. This solves the problem that existing sandbox systems cannot meet the calling needs of machine agents, and improves the system's security and scalability.

CN122113086APending Publication Date: 2026-05-29JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-02-24
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing sandbox systems are primarily designed for human rather than machine intelligent agents, which cannot effectively meet the needs of different intelligent agents to call the sandbox environment. This results in poor system isolation and security, and the inability to provide a system-level environment limits the capabilities and functional scalability of large models.

Method used

A service provision method and connection manager are provided. The connection manager establishes a connection with the target service of the sandbox container, creates a sandbox container that matches the topic of the agent's session, including internal services, and runs the image on the host machine using the container manager to achieve session-level isolation and dynamic resource allocation, supporting multi-turn interaction and business processing.

Benefits of technology

It achieves sandbox environment isolation at the agent session level, ensuring that different agents and sessions do not interfere with each other, protecting data privacy and workspace execution security, supporting complex business needs, reducing resource waste and maintenance costs, and improving the robustness and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113086A_ABST
    Figure CN122113086A_ABST
Patent Text Reader

Abstract

The present disclosure provides a service providing method, a connection manager and a sandbox system, and relates to the technical field of sandbox. The method comprises the following steps: in response to a first task instruction sent by an intelligent agent, a connection is established with a target service of a sandbox container, the sandbox container matches a session topic corresponding to the first task instruction, and the target service matches an execution requirement corresponding to the first task instruction; and in response to the target service executing the first task instruction, an execution result is fed back to the intelligent agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of sandbox technology, and more particularly to a service provisioning method, a connection manager, and a sandbox system. Background Technology

[0002] A sandbox is a security mechanism used to run untested or untrusted programs, code, or processes in a controlled, isolated execution environment.

[0003] The sandbox system for related technologies is mainly designed for a specific business scenario and is customized for development. Its primary users are "humans" rather than "machine intelligent agents". Summary of the Invention

[0004] One technical problem this disclosure aims to solve is to provide a service provisioning method, a connection manager, and a sandbox system that can fulfill the calling needs of different intelligent agents for the sandbox environment.

[0005] According to one aspect of this disclosure, a service provision method is proposed, executed by the connection manager of a sandbox system, comprising: in response to a first task instruction sent by an agent, establishing a connection with a target service of a sandbox container, wherein the sandbox container matches the session topic corresponding to the first task instruction, and the target service matches the execution requirements corresponding to the first task instruction; and in response to the target service executing the first task instruction, feeding back the execution result to the agent.

[0006] In some embodiments, in response to a first task instruction sent by the agent, establishing a connection with the target service of the sandbox container includes: if it is identified that the session topic corresponding to the first task instruction is the first received topic, invoking the container manager to create a sandbox container that matches the session topic of the agent, the sandbox container including one or more internal services; starting the sandbox container and establishing a connection with the target service that matches the execution requirements corresponding to the first task instruction.

[0007] In some embodiments, invoking the container manager to create a sandbox container that matches the agent's session topic includes: sending an internal service connection establishment request to the container manager so that the container manager pulls an image from the image library; after completing the image configuration based on the agent's session topic, determining the target host; running the image on the target host; and completing the construction of the sandbox container and one or more internal services contained in the sandbox container.

[0008] In some embodiments, the container manager determines the target host by: querying the available resources of the host cluster where the container is deployed based on the resource requirements of the agent; and determining the target host in the host cluster where the container is deployed based on the resource allocation policy.

[0009] In some embodiments, in response to a first task instruction sent by the agent, establishing a connection with an internal service of the sandbox container includes: if it is identified that the session topic corresponding to the first task instruction is a topic that has not been received for the first time, establishing a connection with a target service of the sandbox container that matches the session topic corresponding to the first task instruction, based on the agent's connection information.

[0010] In some embodiments, task instructions are obtained through the Model Context Protocol (MCP) interface between the agent and the sandbox system.

[0011] In some embodiments, intermediate variables and execution results generated by executing the first task instruction are cached; in response to a second task instruction sent by the agent, the second task instruction instructs the execution of a task based on at least one of the intermediate variables and execution results generated by the first task instruction, and instructs the target service to execute the second task instruction based on at least one of the intermediate variables and execution results.

[0012] In some embodiments, the execution results are stored in the workspace as files, and feeding back the execution results to the agent includes providing a download link to the agent based on the relative path of the file in the workspace.

[0013] According to a second aspect of this disclosure, a connection manager is also proposed, located in a sandbox system, comprising: a connection establishment module configured to establish a connection with a target service of a sandbox container in response to a first task instruction sent by an agent, wherein the sandbox container matches the session topic corresponding to the first task instruction, and the target service matches the execution requirement corresponding to the first task instruction; and a result feedback module configured to feed back the execution result to the agent in response to the target service executing the first task instruction.

[0014] According to a third aspect of this disclosure, a connection manager is also proposed, located in a sandbox system, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute the service provisioning method as described above based on instructions stored in the memory.

[0015] According to a fourth aspect of this disclosure, a sandbox system is also proposed, comprising: the connection manager described above; a container manager configured to create sandbox containers that match the session topics of the agent; and a sandbox container including one or more internal services.

[0016] In some embodiments, the container manager is configured to receive an internal service connection establishment request sent by the connection manager, pull an image from the image library, complete image configuration in an agent-based session topic, determine the target host, run the image on the target host, and complete the construction of the sandbox container and one or more internal services contained in the sandbox container.

[0017] In some embodiments, the container manager is configured to query the available resources of the host cluster where the containers are deployed based on the resource requirements of the agents; and to determine the target host in the host cluster where the containers are deployed based on the resource allocation policy.

[0018] In some embodiments, the connection manager is located in the connection layer of the sandbox system, and the container manager and sandbox container are located in the container layer of the sandbox system. The sandbox system also includes: an image layer, configured for the container manager to pull images from the image library, complete image configuration, and perform image maintenance; and a workspace layer, configured to map and mount the execution results obtained by the target service as files to a unified access file area, and to perform file import and export management.

[0019] In some embodiments, the container layer is also configured to perform lifecycle management of the sandbox container.

[0020] According to a fifth aspect of this disclosure, a computer-readable storage medium is also provided, having stored thereon computer program instructions that, when executed by a processor, implement the service provision method as described above.

[0021] According to a sixth aspect of this disclosure, a computer program product is also provided, comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the described service provision method.

[0022] In this embodiment of the disclosure, in response to the task instructions sent by the intelligent agent, the connection manager establishes a connection with the target service of the sandbox container, that is, the connection between the intelligent agent and the target service of the corresponding sandbox container is realized. Since the sandbox container matches the session topic of the intelligent agent, session-level sandbox container isolation can be achieved. The target service matches the execution requirements corresponding to the task instructions. Therefore, the internal services can be customized and adjusted, so that corresponding business processing can be implemented for different session requirements of different intelligent agents while ensuring security.

[0023] Other features and advantages of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0024] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the specification, serve to explain the principles of this disclosure.

[0025] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:

[0026] Figure 1 Flowcharts of some embodiments of the methods for providing services according to this disclosure;

[0027] Figure 2Flowcharts of other embodiments of the methods for providing services according to this disclosure;

[0028] Figure 3 A flowchart illustrating some embodiments of establishing connections with the internal services of the sandbox container disclosed herein;

[0029] Figure 4 Block diagrams of some embodiments of the connection manager disclosed herein;

[0030] Figure 5 Block diagrams of other embodiments of the connection manager disclosed herein;

[0031] Figure 6 Block diagrams of some embodiments of the sandbox system disclosed herein;

[0032] Figure 7 Block diagrams of other embodiments of the sandbox system disclosed herein. Detailed Implementation

[0033] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0034] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0035] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.

[0036] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0037] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0038] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0039] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0040] Sandbox technology has several applications. Firstly, it's primarily used for malware analysis in computer and network security, enabling rapid virus database updates and protection by monitoring malware behavior in an isolated environment. Secondly, in data security, sandbox technology builds an isolated and controlled computing environment to protect data privacy and security. Thirdly, in software development, it allows for code development and service deployment within a sandbox environment, ensuring a secure and controllable process, improving development efficiency, and reducing operational costs. Customized sandbox systems are required for each business scenario. Furthermore, the sandbox system is used by humans, not intelligent agents. This disclosure provides a service delivery method that enables different intelligent agents to access the sandbox environment.

[0041] The present invention will now be described in detail with reference to the accompanying drawings.

[0042] like Figure 1 As shown, Figure 1 This is a flowchart illustrating some embodiments of the method for providing services according to this disclosure. This embodiment is executed by a connection manager located in a sandbox system and includes steps S11-S12.

[0043] In step S11, in response to the first task instruction sent by the agent, a connection is established with the target service of the sandbox container. The sandbox container matches the session topic corresponding to the first task instruction, and the target service matches the execution requirements corresponding to the first task instruction.

[0044] For example, a user sends a request to an agent to perform a specific task. The agent accepts the user's request and sends an execution instruction to the sandbox system during the processing. The connection manager of the sandbox system establishes a connection with the target service in the sandbox container that matches the session topic corresponding to the task instruction, thereby enabling the agent to establish a connection with the target service in the corresponding sandbox container.

[0045] Each session of each agent corresponds to a sandbox container, and different sessions of different agents correspond to different sandbox containers. A sandbox container can contain one or more internal services, such as services related to execution requirements like bash, IPython, and npm. Based on the agent's business needs, calls to the internal services within the sandbox container are implemented.

[0046] In step S12, in response to the target service executing the first task instruction, the execution result is fed back to the intelligent agent.

[0047] Once the sandbox container and internal services have established a connection with the agent, the internal services can execute the instructions sent by the agent normally. After the instructions are executed, the connection manager will send the execution results back to the agent.

[0048] In this embodiment, in response to the task instructions sent by the agent, the connection manager establishes a connection with the target service of the sandbox container, that is, the connection between the agent and the target service of the corresponding sandbox container is realized. Since the sandbox container matches the session topic of the agent, session-level sandbox container isolation can be achieved. The target service matches the execution requirements corresponding to the task instructions. Therefore, the internal services can be customized and adjusted, so that corresponding business processing can be implemented for different session requirements of different agents while ensuring security.

[0049] In some embodiments, in response to a first task instruction sent by the agent, establishing a connection with the target service of the sandbox container includes: if it is identified that the session topic corresponding to the first task instruction is the first received topic, invoking the container manager to create a sandbox container that matches the session topic of the agent, the sandbox container including one or more internal services; starting the sandbox container and establishing a connection with the target service that matches the execution requirements corresponding to the first task instruction.

[0050] For example, after receiving the first task instruction from the agent, the connection manager identifies whether it is the agent's first session. If so, it first calls the container manager to create a sandbox container matching the agent's session, starts the sandbox container, and establishes a connection mapping relationship with a service running inside the container. This allows the service to execute the agent's instructions.

[0051] In this embodiment, for the first session topic of the agent, the connection manager creates a corresponding container in the sandbox. Different sessions correspond to different containers to ensure that different sessions do not interfere with each other, thus ensuring the security of the large model's working environment. It also establishes a connection with the services inside the container, thereby enabling the agent's business needs to be met.

[0052] In some embodiments, invoking the container manager to create a sandbox container that matches the agent's session topic includes: sending an internal service connection establishment request to the container manager so that the container manager pulls an image from the image library; after completing the image configuration based on the agent's session topic, determining the target host; running the image on the target host; and completing the construction of the sandbox container and one or more internal services contained in the sandbox container.

[0053] An image is a static, immutable, hierarchical file system containing the complete file structure, dependencies, environment variables, and startup configurations required to run an application. A container is a running instance of an image, created based on the image, and runs the application in an isolated user-space process. A sandboxed image refers to the operating system and software dependency configurations that an agent relies on. A sandboxed container is an instance of a sandboxed image running on a host machine. An agent can access a running service inside the sandboxed container through the host machine's network address and port.

[0054] If the sandbox container for the current agent does not exist in the container layer, the container manager will pull the image related to the current agent from the image repository on a machine with sufficient resources through the scheduling policy, add software dependencies that match the agent's session topic to the image, complete the image configuration, generate a new image that matches the agent, build the container configuration based on the new image, start the sandbox container, and establish a connection mapping relationship with a certain internal service executed within the container.

[0055] In this embodiment, the connection manager creates a sandbox container by calling the container manager, facilitating connections between the agent and the internal services within the sandbox container. The internal services can be dynamically configured according to the agent's execution needs, thus ensuring better scalability of the solution.

[0056] In related technologies, sandboxes typically involve launching a thread or process to execute code. Since the code or instructions generated by a large model cannot be fully controlled, this approach results in poor system isolation and security, potentially directly threatening host machine security. Furthermore, this method fails to provide a system-level environment, severely limiting the capabilities of large models and hindering their scalability. This disclosure provides agent-session-level sandbox environment isolation, ensuring that different agents and sessions do not interfere with each other, protecting the data privacy and execution security of each sandbox environment.

[0057] In some embodiments, the container manager determines the target host by: querying the available resources of the host cluster where the container is deployed based on the resource requirements of the agent; and determining the target host in the host cluster where the container is deployed based on the resource allocation policy.

[0058] Based on the caller's resource requirements, the container manager queries the resource availability of the host cluster. If available resources exist, it identifies the target host for container deployment based on the invocation strategy. For example, if real-time available resource data for three host machines are selected, and the invocation strategy is "prioritize GPU-dedicated needs + ensure sufficient basic resources + reserve 20% of resources to prevent overload," then the target host can be selected from these three host machines.

[0059] In this embodiment, by selecting a target host, service failures due to insufficient host resources can be reduced. Dynamic cluster load adaptation based on policies improves overall resource utilization, allowing the agent to perform at its best. Furthermore, this step ensures the dynamic horizontal scaling of the sandbox system; increasing the number of host machines enables greater concurrency support and enhances system robustness.

[0060] In some embodiments, in response to a first task instruction sent by the agent, establishing a connection with an internal service of the sandbox container includes: if it is identified that the session topic corresponding to the first task instruction is a topic that has not been received for the first time, establishing a connection with a target service of the sandbox container that matches the session topic corresponding to the first task instruction, based on the agent's connection information.

[0061] For example, if the agent has already established a connection with a service in a sandbox container, and issues a task instruction again based on the same session topic, the connection manager can map to an already executed container based on the agent's session and existing connection information, and establish a connection with the service inside the container.

[0062] There is a limit to the number of connections within each host machine and container. For non-first agent sessions, the connection manager maps to an already executed container based on the current agent's session and connection information, and establishes a connection with the service inside the container. This can meet the agent's business needs while reducing resource waste. Furthermore, the same connection can retain the previous execution process without the caller needing to maintain context information.

[0063] In some embodiments, the connection manager obtains task instructions through the MCP (Model Context Protocol) interface between the agent and the sandbox system.

[0064] MCP is an open, standardized client-server protocol. It allows AI applications (clients) to dynamically discover and invoke various "tools" from external services (servers) and obtain structured context information. In this embodiment, a standardized interface is provided based on the MCP protocol definition, enabling different intelligent agents to interact in a standardized manner with the connection manager within the sandbox system through a unified MCP interface. This allows for the invocation of various internal services within the sandbox environment, thereby meeting diverse use cases.

[0065] The service provision method will be further described below with reference to specific embodiments, such as... Figure 2 As shown, Figure 2 A flowchart illustrating another embodiment of the method for providing services according to this disclosure, which includes steps S21-S27.

[0066] In step S21, the user sends a request to the agent to execute a specific task.

[0067] In step S22, the agent sends an execution command to the sandbox system and calls the sandbox service through the MCP interface.

[0068] In step S23, the connection manager of the sandbox system calls the container manager to ensure that the agent's associated container starts.

[0069] In step S24, the container manager queries or starts the container.

[0070] The container manager pulls images from the image repository and adds dependent operating systems and software to meet the sandbox invocation requirements of the target intelligent agent.

[0071] Sandbox containers can provide IPython services, Bash services, and more. Sandbox containers are deployed on the host machine.

[0072] In step S25, the sandbox container returns container configuration information to the container manager.

[0073] In step S26, the connection manager establishes a connection with the service within the sandbox container, and the service executes commands.

[0074] In step S27, the sandbox container returns the execution result to the connection manager. The connection manager then feeds back the execution result to the agent.

[0075] The execution results are saved as files in the workspace, and the connection manager provides download links to the agents based on the relative paths of the files in the workspace.

[0076] The intelligent agent can obtain the instruction execution result either through the return value of the MCP interface or through file linking. By providing the intelligent agent with flexible ways to obtain execution results, it can adapt to different scenarios and reduce the risk of business interruption.

[0077] In some embodiments, access control can also be provided for download links, meaning that only authorized agents can export the file corresponding to the execution result from the workspace, further enhancing the security of the dialogue.

[0078] Current large-scale models possess strong natural language understanding and generation capabilities, but they struggle with complex logical operations and analytical tasks, such as intelligent question answering, data analysis, and visualization. The typical approach involves dividing the original problem into multiple sub-steps, generating corresponding code for each sub-step, executing it, obtaining the result, and using the result of the previous step to guide subsequent steps until the final result is obtained. In this process, a secure, stable, and reliable sandbox environment is essential. The solution disclosed herein can provide different sandbox containers for different sessions of different agents, utilizing services within the containers to provide services to the agents, ensuring business security while fulfilling various complex business needs of the agents.

[0079] Figure 3 This is a flowchart illustrating some embodiments of establishing a connection with the internal services of a sandbox container according to the present disclosure, including steps S31-S310.

[0080] In step S31, the connection manager initiates a request to establish a connection to the container manager's internal services.

[0081] In step S32, the container manager queries the corresponding image information in the image library.

[0082] If the sandbox container for the current agent does not exist in the container manager, the corresponding container needs to be started.

[0083] In step S33, the image library returns the image configuration.

[0084] In step S34, the container manager queries the host cluster resource usage.

[0085] In step S35, the host cluster returns information on the remaining resources of the cluster.

[0086] In step S36, the container manager selects a host machine, creates and starts a container based on the scheduling policy.

[0087] Based on the caller's resource requirements, the container manager queries the current container cluster's resource availability and identifies the target host machine for deploying containers through the call strategy.

[0088] In step S37, the container returns container status information.

[0089] In step S38, the container manager returns container configuration information to the connection manager.

[0090] The container manager generates the corresponding container startup configuration and starts the container and the internal services contained in the container configuration on the target host machine.

[0091] In step S39, the connection manager establishes a connection with the service inside the container.

[0092] The connection manager creates internal service connections by calling the internal service connection initialization interface.

[0093] In step S310, the internal service returns an internal service connection to the connection manager.

[0094] Establish a mapping relationship between agent sessions and service connections within the container in the connection manager.

[0095] In this embodiment, a new container is created for the first invocation of the agent session, thereby establishing a connection with the service inside the container. By providing agent session-level sandbox environment isolation, it ensures that different agents and different sessions do not interfere with each other, protecting the data privacy of each sandbox environment and the execution security of the workspace.

[0096] In related technologies, each time code is executed in a sandbox, it starts from a completely new environment, causing all previously generated files, variables, etc. to be lost. The caller has to maintain external memory to record and manage the state, which leads to high maintenance costs and is prone to desynchronization, seriously hindering the implementation of complex multi-step tasks.

[0097] In some embodiments, intermediate variables and execution results generated by executing the first task instruction are cached; in response to a second task instruction sent by the agent, the second task instruction instructs the execution of a task based on at least one of the intermediate variables and execution results generated by the first task instruction, and instructs the target service to execute the second task instruction based on at least one of the intermediate variables and execution results.

[0098] For sandbox multi-turn interaction design of large-scale intelligent agents, the sandbox container retains operation records such as intermediate variables and calculation results during the execution of agent instructions. When the agent calls the sandbox container again, it determines whether it needs to continue executing new instructions based on the previous round of dialogue. If so, it instructs the sandbox container to continue executing the current instructions based on the previous results.

[0099] This embodiment enables multi-round interactions between the agent and the sandbox environment. The execution record of the agent is saved in the sandbox environment. When the agent calls the sandbox again, it can continue to execute based on the previous result, thereby reducing the memory burden of large models.

[0100] Figure 4 This is a block diagram of some embodiments of the connection manager of this disclosure, which is located in a sandbox system and includes a connection establishment module 41 and a result feedback module 42.

[0101] The connection establishment module 41 is configured to establish a connection with the target service of the sandbox container in response to the first task instruction sent by the agent. The sandbox container matches the session topic corresponding to the first task instruction, and the target service matches the execution requirements corresponding to the first task instruction.

[0102] In some embodiments, the connection establishment module 41 is configured to, upon recognizing that the session topic corresponding to the first task instruction is the first received topic, invoke the container manager to create a sandbox container that matches the session topic of the agent, the sandbox container including one or more internal services; start the sandbox container and establish a connection with the target service that matches the execution requirements corresponding to the first task instruction.

[0103] In some embodiments, the connection establishment module 41 is configured to send an internal service connection establishment request to the container manager so that the container manager can pull an image from the image library, complete the image configuration in the agent-based session topic, determine the target host, run the image on the target host, and complete the construction of the sandbox container and one or more internal services contained in the sandbox container.

[0104] The container manager determines the target host by: querying the available resources of the host cluster where the container is deployed based on the resource requirements of the agent; and determining the target host in the host cluster where the container is deployed based on the resource allocation policy.

[0105] In some embodiments, the connection establishment module 41 is configured to establish a connection with the target service of the sandbox container that matches the session topic corresponding to the first task instruction, based on the connection information of the agent, when it is identified that the session topic corresponding to the first task instruction is not the first received topic.

[0106] In some embodiments, the connection establishment module 41 is further configured to obtain task instructions through the MCP interface between the agent and the sandbox system. In this embodiment, a standardized access method for internal services within the sandbox container is achieved by constructing a unified MCP interface.

[0107] The result feedback module 42 is configured to respond to the first task instruction executed by the target service and feed back the execution result to the intelligent agent.

[0108] In some embodiments, the execution results are stored in the workspace as files, and the result feedback module 42 is also configured to provide a download link to the agent based on the relative path of the file in the workspace.

[0109] In this embodiment, in response to the task instructions sent by the agent, the connection manager establishes a connection with the target service of the sandbox container, thereby realizing the connection between the agent and the target service. Since the sandbox container matches the session topic of the agent, session-level sandbox container isolation can be achieved. The target service matches the execution requirements corresponding to the task instructions. Therefore, the internal services can be customized and adjusted, so that corresponding business processing can be implemented for different session requirements of different agents while ensuring security.

[0110] In some embodiments, the result feedback module 42 is further configured to cache the intermediate variables and execution results generated by executing the first task instruction; in response to a second task instruction sent by the agent, the second task instruction instructs the execution of a task based on at least one of the intermediate variables and execution results generated by the first task instruction, and instructs the target service to execute the second task instruction based on at least one of the intermediate variables and execution results.

[0111] This embodiment enables multi-round interactions between the agent and the sandbox environment. The execution record of the agent is saved in the sandbox environment. When the agent calls the sandbox again, it can continue to execute based on the previous result, thereby reducing the memory burden of large models.

[0112] It should be noted that the above modules are logical modules divided according to their specific functions, and are not used to restrict the specific implementation method. For example, they can be implemented in software, hardware, or a combination of software and hardware. In actual implementation, the above modules can be implemented as independent physical entities, or they can be implemented by a single entity (e.g., a processor (CPU or DSP, etc.), integrated circuit, etc.).

[0113] Figure 5 The block diagram below illustrates another embodiment of the connection manager of this disclosure. The connection manager 5 includes a memory 51 and a processor 52. The memory 51 can be a disk, flash memory, or any other non-volatile storage medium. The memory is used to store instructions as described in the above embodiments. The processor 52 is coupled to the memory 51 and can be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 52 is used to execute the instructions stored in the memory.

[0114] In some embodiments, the processor 52 is coupled to the memory 51 via a BUS bus 53. The connection manager 5 can also be connected to an external storage device 55 via a storage interface 54 to access external data, and can also be connected to a network or another computer system (not shown) via a network interface 56. Further details are omitted here.

[0115] In this embodiment, by storing data instructions in a memory and then processing the instructions by a processor, corresponding business processing can be achieved for different session needs of different intelligent agents while ensuring security.

[0116] In some embodiments, a sandbox system is protected, which includes a connection manager as described above, a container manager, and a sandbox container. The container manager is configured to create a sandbox container that matches the session topic of the agent. The sandbox container includes one or more internal services.

[0117] Different sessions of different intelligent agents correspond to different sandbox containers, ensuring that different intelligent agents and sessions do not interfere with each other, protecting the data privacy and workspace execution security of each sandbox environment. The internal services in the sandbox can be customized according to task instructions, thus meeting various complex business needs in reality.

[0118] In some embodiments, the container manager is configured to receive an internal service connection establishment request sent by the connection manager, pull an image from the image library, complete image configuration in an agent-based session topic, determine the target host, run the image on the target host, and complete the construction of the sandbox container and one or more internal services contained in the sandbox container.

[0119] In this embodiment, the connection manager creates a sandbox container by calling the container manager, facilitating connections between the agent and the internal services within the sandbox container. The internal services can be dynamically configured according to the agent's execution needs, thus ensuring better scalability of the solution.

[0120] In some embodiments, the container manager is configured to query the available resources of the host cluster where the containers are deployed based on the resource requirements of the agents; and to determine the target host in the host cluster where the containers are deployed based on the resource allocation policy.

[0121] In this embodiment, by selecting a target host, business failures caused by insufficient host resources can be reduced. Based on the strategy, the cluster load is dynamically adapted, the overall resource utilization is improved, and the intelligent agent can perform at its best.

[0122] In some embodiments, the connection manager resides in the connection layer of the sandbox system, while the container manager and sandbox containers reside in the container layer of the sandbox system. The sandbox system also includes: an image layer, configured for the container manager to pull images from the image repository, complete image configuration, and perform image maintenance; and a workspace layer, configured to map and mount the execution results obtained from the target service as files to a unified access file area, and to manage file import and export.

[0123] Below, with Figure 6Taking this as an example, the architecture of the sandbox system disclosed herein will be introduced.

[0124] like Figure 6 As shown, Figure 6 The diagram shows some embodiments of the sandbox system disclosed herein. The high-level sandbox system adopts a layered architecture design, which includes, from bottom to top, a mirror layer 61, a container layer 62, a workspace layer 63, and a connection layer 64.

[0125] Image layer 61 maintains the sandbox environment dependency configurations for different intelligent agents, including the dependent operating systems and software. In the image layer, sandbox environments can be custom-built, base images can be set, and software dependencies can be added. The runtime environment that the current intelligent agent depends on can be quickly built using images, thereby meeting the sandbox invocation requirements of the target intelligent agent.

[0126] Container layer 62 is responsible for maintaining sandbox container configurations, including image selection, host resource allocation, internal service configuration, and container startup configuration. It also manages the lifecycle of the sandbox environment, including the creation, startup, shutdown, and deletion of sandbox containers, execution of container commands, and log maintenance.

[0127] Workspace layer 63 maintains workspace information for each sandbox environment and maps files generated inside the container to a unified access file storage area, thereby supporting persistent import and export of files.

[0128] The connection layer 64 serves as the entry point for calling sandbox tools, maintaining the mapping relationship between agent sessions and sandbox containers and their internal service connections, thereby ensuring the continuity of the same session running in the sandbox; at the same time, the connection layer supports the acquisition and deletion of connections, the execution of instructions in connections, and the acquisition of execution results.

[0129] The layered architecture of the sandbox system described above will be further explained below with reference to a specific embodiment.

[0130] In some embodiments, within an intelligent system, there exist two agents: a data analysis agent and a web page building agent. These two agents interact with the sandbox environment, such as... Figure 7 As shown, Figure 7 Block diagrams of other embodiments of the sandbox system disclosed herein.

[0131] Sandbox containers are built for different agents, with each image containing the necessary system and software dependencies. For example, two agents create their own images at the image layer. The data analysis agent sandbox depends on the Ubuntu operating system, a Python interpreter, and the pandas computing library. The web-based agent depends on the Debine operating system, a Node.js execution environment, and uses the Chrome browser for rendering and debugging. Image maintenance is achieved through a configuration file.

[0132] At the container layer, an agent sandbox runtime environment is built based on images, with each agent corresponding to a specific image configuration. For example, at the container layer, a data analysis agent builds two containers based on its image, used for different agent sessions in the upper-layer application. Host machines are assigned to these two containers according to a built-in resource allocation strategy; for instance, data analysis container 1 can be accessed via host1:8001, and data analysis container 2 can be accessed via host2:8002. A web page building agent generates a container based on its image configuration, accessible via host3:9001. The container manager manages the container lifecycle, which includes the following states: creation, running, paused, stopped, and deleted.

[0133] At the working directory layer, each connection establishes a separate working directory to record intermediate execution results and achieves persistent file storage by mounting it to a unified access file target. A unified access working path is assigned to each container, supporting the import of external files and the export of files generated within the container. For example, for a data analysis agent, the working paths are / tmp / data_agent / conn_1 and / tmp / data_agent / conn_2, respectively. For a web page building agent, the working path is / tmp / web_agent / conn_1.

[0134] The connection layer serves as the entry point for interaction between the agent and the sandbox environment, implemented by calling the MCP interface. For example, services within a container are encapsulated as MCP interfaces for external agents to call. Each container can contain multiple internal services, and each internal service can establish multiple connections. Connections can be analogized to terminal windows; for instance, in Windows, multiple command prompts can be opened simultaneously, each executing different commands. For example, a data analysis agent can execute Python code via IPython (import numpy as np\na=np.numpy([1,2,3])) or execute system commands via Bash (mkdir code \n python main.py). A web page building agent can simultaneously execute web page startup (npm run dev) and web page rendering commands (chrome --headless a.html) via Bash connections.

[0135] This disclosed sandbox system achieves session-level sandbox environment isolation for intelligent agents. Different sessions of different intelligent agents create independent sandbox environments, whose working environments are independent of each other and do not interfere with each other, thus ensuring the security of the large model's working environment. Furthermore, by constructing a unified MCP interface, a standardized access method for internal services within the sandbox container is implemented, and the internal services within the sandbox can be customized to meet various complex real-world business needs. Moreover, for the multi-turn interaction design of large model intelligent agents, the sandbox container retains the agent's internal operation records, thereby helping to maintain the context of the large model and reducing the model's memory burden.

[0136] In other embodiments, a computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the steps of the methods described above. Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, apparatus, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0137] In some embodiments, a computer program product is protected, comprising a computer program or instructions that, when executed by a processor, implement the driving strategy determination method or driving control method described above. The computer program product includes a computer program carried on a computer-readable medium, containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a CPU, it performs the functions defined in the methods of the embodiments of this disclosure.

[0138] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0139] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0140] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0141] This concludes the detailed description of the present disclosure. To avoid obscuring the concept of the disclosure, some details known in the art have not been described. Those skilled in the art will fully understand how to implement the technical solutions disclosed herein based on the above description.

[0142] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.

[0143] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A service provisioning method, executed by a connection manager of a sandbox system, comprising: In response to a first task instruction sent by the intelligent agent, a connection is established with the target service of the sandbox container, wherein the sandbox container matches the session topic corresponding to the first task instruction, and the target service matches the execution requirements corresponding to the first task instruction; In response to the target service executing the first task instruction, the execution result is fed back to the intelligent agent.

2. The service provision method according to claim 1, wherein, In response to the first task instruction sent by the agent, establishing a connection with the target service of the sandbox container includes: If the session topic corresponding to the first task instruction is identified as the first received topic, the container manager is invoked to create a sandbox container that matches the session topic of the agent. The sandbox container includes one or more internal services. The sandbox container is launched, and a connection is established with the target service that matches the execution requirements corresponding to the first task instruction.

3. The service provision method according to claim 2, wherein, Invoking the container manager to create a sandbox container that matches the agent's session topic includes: Send an internal service connection establishment request to the container manager so that the container manager can pull the image from the image library. After completing the image configuration based on the session topic of the agent, determine the target host machine, run the image on the target host machine, and complete the construction of the sandbox container and one or more internal services contained in the sandbox container.

4. The service provision method according to claim 3, wherein, The container manager determines the target host machine by including: Based on the resource requirements of the intelligent agent, query the available resources of the host cluster where the container is deployed; Based on the resource allocation strategy, the target host machine is determined in the host machine cluster where the container is deployed.

5. The service provision method according to any one of claims 1 to 4, wherein, In response to the first task command sent by the agent, establishing a connection with the internal services of the sandbox container includes: If it is identified that the session topic corresponding to the first task instruction is not the first time the topic has been received, a connection is established with the target service of the sandbox container that matches the session topic corresponding to the first task instruction, based on the connection information of the agent.

6. The service provision method according to any one of claims 1 to 4, further comprising: The task instructions are obtained through the Model Context Protocol (MCP) interface between the agent and the sandbox system.

7. The service provision method according to any one of claims 1 to 4, further comprising: The intermediate variables generated from executing the first task instruction and the execution result are cached; In response to a second task instruction sent by the agent, the second task instruction instructs the target service to execute the second task instruction based on at least one of the intermediate variables generated by the first task instruction and the execution result.

8. The service provision method according to any one of claims 1 to 4, wherein, The execution results are stored in the workspace as files, and the feedback of the execution results to the agent includes: Based on the relative path of the file in the workspace, a download link is provided to the agent.

9. A connection manager, located in a sandbox system, comprising: The connection establishment module is configured to establish a connection with the target service of the sandbox container in response to a first task instruction sent by the agent. The sandbox container is matched with the session topic corresponding to the first task instruction, and the target service is matched with the execution requirements corresponding to the first task instruction. The result feedback module is configured to respond to the target service executing the first task instruction by feeding back the execution result to the intelligent agent.

10. A connection manager, located in a sandbox system, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the service provision method as described in any one of claims 1 to 8 based on instructions stored in the memory.

11. A sandbox system, comprising: The connection manager as described in claim 9 or 10; The container manager is configured to create sandbox containers that match the agent's session topic; The sandbox container includes one or more internal services.

12. The sandbox system according to claim 11, wherein, The container manager is configured to receive internal service connection establishment requests sent by the connection manager, pull images from the image library, complete image configuration based on the agent's session topic, determine the target host, run the image on the target host, and complete the construction of the sandbox container and one or more internal services contained in the sandbox container.

13. The sandbox system according to claim 11, wherein, The container manager is configured to query the available resources of the host cluster where the containers are deployed based on the resource requirements of the agent. Based on the resource allocation strategy, the target host machine is determined in the host machine cluster where the container is deployed.

14. The sandbox system according to any one of claims 11 to 13, wherein, The connection manager is located in the connection layer of the sandbox system, the container manager and the sandbox container are located in the container layer of the sandbox system, and the sandbox system further includes: The image layer is configured for the container manager to pull images from the image library, complete image configuration, and perform image maintenance. The workspace layer is configured to map and mount the execution results obtained from the target service as files to a unified access file area, and to manage file import and export.

15. The sandbox system according to claim 14, wherein, The container layer is also configured to perform lifecycle management on the sandbox container.

16. A computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the service provision method as described in any one of claims 1 to 8.

17. A computer program product comprising a computer program or instructions that, when executed by a processor, implement the service provision method according to any one of claims 1 to 8.