Method, device and equipment for skill backup of intelligent agent and storage medium

By scanning and classifying the skill catalogs of multiple platforms, and combining sensitive information detection before import and repository visibility verification before synchronization, the problems of inaccurate scope of multi-platform skill backup and leakage of sensitive information have been solved, and secure and controllable skill backup has been achieved.

CN123138031APending Publication Date: 2026-11-20BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611308481.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In a multi-platform environment, existing technologies cannot effectively distinguish and manage the skill catalogs of different coding tools, leading to problems such as inaccurate backup scope, leakage of sensitive information, and uncontrollable backup targets.

Method used

By scanning multi-source skill catalogs, classifying skills by ownership based on catalog ownership, filtering out skills that need to be backed up, performing sensitive information checks before importing, and verifying the visibility of the backup target repository before synchronization, the security and accuracy of the backup are ensured.

Benefits of technology

It enables secure and controllable backup of skills assets across multiple platforms, improving the accuracy and security of backups, preventing the leakage of sensitive information, and ensuring the privacy of backup targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138031A_ABST
    Figure CN123138031A_ABST
Patent Text Reader

Abstract

The disclosure provides an agent skill backup method, relates to the technical field of computers, and particularly relates to the field of artificial intelligence. The method comprises the following steps: scanning at least one scanning root path, identifying a valid skill directory containing a skill identification file, and obtaining a skill record; determining the ownership category of the skill record according to the membership relationship between the actual source path of the skill record and a preset directory set, and screening the skills to be backed up according to the ownership category; performing sensitive information detection on the text files contained in the skills to be backed up, and blocking the import of the text files if sensitive information is detected; writing the skills to be backed up into a local backup library, performing sensitive information detection on the to-be-synchronized content in the local backup library again, and verifying the visibility of a backup target warehouse; and when no sensitive information is detected again and the backup target warehouse is a private warehouse, synchronizing the changes of the local backup library to the backup target warehouse. According to the technical scheme of the disclosure, the reliability and security of multi-platform skill backup are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to the fields of artificial intelligence and agent technology. Background Technology

[0002] With the rapid development of artificial intelligence and large model technology, the use of capabilities such as code generation and task orchestration is becoming increasingly frequent, and agent technology is being widely deployed in various coding tools and business systems. The functions of an agent are usually organized in the form of skills, with each skill corresponding to a directory containing documentation, script files, configuration files, etc., used to describe the agent's execution logic in a specific task.

[0003] Currently, users often use multiple coding tools simultaneously on the same device, and these tools differ in their skill storage directories, directory structures, and management methods. For example, some tools centrally store skills in a unified skill directory, some store system-provided skills in a managed directory, and others support user-defined directories and allow references to custom skill directories located elsewhere via links. Because the skill directories of each tool are independent and unrelated, users need to manage skills under each category of directory separately. Summary of the Invention

[0004] This disclosure provides a method, apparatus, device, and storage medium for backing up intelligent agent skills.

[0005] According to one aspect of this disclosure, a method for backing up intelligent agent skills is provided, comprising: Scan at least one root path to identify a valid skill directory containing skill identification files and obtain skill records. Based on the affiliation between the actual source path of the skill record and the preset directory set, determine the ownership category of the skill record, and select the skills to be backed up from the skill records according to the ownership category; Perform sensitive information detection on the text files contained in the backup skill. If sensitive information is detected, block the import of the backup skill. Write the skills to be backed up into the local backup repository, perform sensitive information detection again on the content to be synchronized in the local backup repository, and verify the visibility of the backup target repository; If no sensitive information is detected during the sensitive information detection process and the visibility characterization backup target repository is a private repository, the changes in the local backup repository will be synchronized to the backup target repository.

[0006] According to another aspect of this disclosure, an agent skill backup device is provided, comprising: The scanning module is used to scan at least one root path, identify valid skill directories containing skill identifier files, and obtain skill records. The classification and filtering module is used to determine the ownership category of skill records based on the affiliation between the actual source path of the skill records and the preset directory set, and to filter the skills to be backed up from the skill records according to the ownership category; The sensitivity detection module is used to perform sensitivity detection on the text files contained in the skill to be backed up. If sensitive information is detected, the import of the skill to be backed up will be blocked. The inbound verification module is used to write the skills to be backed up into the local backup repository, perform sensitive information detection again on the content to be synchronized in the local backup repository, and verify the visibility of the backup target repository. The synchronization module is used to synchronize changes in the local backup repository to the backup target repository if no sensitive information is detected during the sensitive information detection process again and the visibility characterization backup target repository is a private repository.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and The memory is communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0010] The technical solution disclosed herein improves the reliability and security of multi-platform skill backup.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1This is a flowchart illustrating the intelligent agent skill backup method provided according to embodiments of this disclosure; Figure 2 This is a complete flowchart of an agent skill backup method provided according to another embodiment of the present disclosure; Figure 3 This is a schematic diagram of the architecture of an intelligent agent skill backup system provided according to an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of an intelligent agent skill backup device provided according to an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. Detailed Implementation

[0013] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0014] In related technologies, intelligent agent skill backup solutions typically involve directly copying the entire skill catalog of each coding tool on the device and then archiving the copy to a remote storage location. This approach is feasible in scenarios with a small number of skills and a simple catalog structure. However, in complex scenarios where users simultaneously use multiple coding tools, each tool's skill catalog is independent, and some skills are referenced via links, the mixed origins and lack of attribution make it impossible to distinguish which skills belong to personal assets requiring backup and which are system-managed content that can be easily rebuilt. Furthermore, the lack of verification of credentials in scripts and configuration files during the copy process means that sensitive information such as access keys and tokens may be included in the backup and sent to remote storage. Additionally, the lack of verification of access attributes at the backup target location poses a risk of unauthorized access to the backup content. These issues collectively lead to risks such as inappropriate backup scope, leakage of sensitive information, and uncontrollable backup content in multi-platform skill backup processes.

[0015] To at least partially address one or more of the aforementioned problems and other potential issues, this disclosure proposes an agent skill backup method. This method involves scanning multi-source skill directories and classifying skills by ownership based on directory affiliation to select skills requiring backup. Before importing skills, sensitive information checks are performed on text files within the skills to block sensitive information from being added to the database. Before synchronization, sensitive information checks are performed again on the content to be synchronized, and the visibility of the backup target repository is verified. If the backup target repository is a private repository and no sensitive information is found during the second check, the backup repository is updated and synchronized to the backup target repository. This achieves secure and controllable backup of skill assets across multiple platforms. This method significantly improves the accuracy and security of skill backup and enhances the overall protection capability of the backup process through end-to-end sensitive information detection and visibility verification, thus ensuring the security of cross-platform skill asset backup.

[0016] This disclosure provides a method for backing up intelligent agent skills, which can be applied to a multi-platform intelligent agent skill backup device. This multi-platform intelligent agent skill backup device is located in an electronic device. The electronic device includes, but is not limited to, fixed devices and / or mobile devices. For example, fixed devices include, but are not limited to, servers, which can be cloud servers, ordinary servers, or distributed nodes. Mobile devices include, but are not limited to, laptops, desktop computers, workstations, etc. In some possible implementations, the intelligent agent skill backup method can also be implemented by a processor calling computer-readable instructions stored in memory.

[0017] The following describes in detail the implementation methods of this disclosure in conjunction with application scenarios and examples.

[0018] Figure 1 This is a flowchart illustrating the intelligent agent skill backup method provided according to embodiments of this disclosure. Figure 1 As shown, the method includes, but is not limited to, steps S110 to S150. Each step is described in detail below.

[0019] Step S110: Scan at least one root path to identify a valid skill directory containing skill identifier files and obtain skill records.

[0020] The root scan path can be understood as the root directory on the device used to store the skill directories of various coding tools. There can be multiple root scan paths, or just one. A skill identifier file can be understood as a tag file used to identify a directory as a valid skill directory, such as the skill description file SKILL.md. A skill record can be understood as an abstract description of the identified valid skill directories, used to carry the key information of that skill directory.

[0021] Specifically, when it is necessary to inventory the skill assets of this device, a pre-configured set of scan root paths can be read, which contains at least one scan root path. Each scan root path is then recursively traversed, checking whether each subdirectory contains a skill identifier file during the traversal. Subdirectories containing skill identifier files are identified as valid skill directories, and their relevant information is extracted to form skill records. After scanning is complete, the skill records corresponding to all valid skill directories constitute a skill record set. By uniformly including skill directories from different encoding tools in the scanning scope, the cross-platform skill distribution can be grasped at once.

[0022] Step S120: Determine the ownership category of the skill record based on the affiliation between the actual source path of the skill record and the preset directory set, and filter the skills to be backed up from the skill record according to the ownership category.

[0023] The actual source path can be understood as the real storage path of the content corresponding to the skill directory. The preset directory set can be understood as a pre-set set of directories used to determine skill ownership, which may include user-defined development directory sets, shared root path sets, and system-hosted directory sets. The ownership category can be understood as the classification result of the skill ownership attribute, used to indicate whether the skill belongs to personal creation, cross-platform sharing, system hosting, or unclear ownership.

[0024] Specifically, for each skill record, its actual source path is first determined. Since some skill directories reference other directories via links, the path of a skill record itself may not be the actual location of the skill content. Therefore, it is necessary to parse the links to obtain the actual source path. Subsequently, this actual source path and the root path to which the skill record belongs are compared with a preset set of directories to determine the ownership category of the skill record. Ownership categories can include personal, shared, hosted, and unknown categories. Then, based on the ownership category, skills that should be included in the backup process are selected. For example, personal skills are directly included in the backup list, while shared skills are included after user confirmation, thus achieving automatic identification of the backup scope.

[0025] Step S130: Perform sensitive information detection on the text files contained in the skill to be backed up. If sensitive information is detected, block the import of the skill to be backed up.

[0026] Text files can be understood as files stored in text format within the skill directory to be backed up, such as documentation, scripts, and configuration files. Sensitive information can be understood as access keys, platform tokens, private keys, hard-coded credentials, and other information that could pose a security risk if leaked.

[0027] Specifically, before the skill to be backed up is imported into the local backup repository, all text files in the directory of the skill to be backed up are traversed, and their contents are checked for sensitive information one by one. If sensitive information is detected in any text file, the skill to be backed up is deemed to have a risk of leakage, and the import operation of the skill to be backed up is blocked; if no sensitive information is detected in any text file, the skill to be backed up is allowed to proceed to the next step. By performing checks before import, skills containing sensitive information can be blocked from entering the backup repository at the source.

[0028] Step S140: Write the skills to be backed up into the local backup library, perform sensitive information detection again on the content to be synchronized in the local backup library, and verify the visibility of the backup target repository.

[0029] The local backup repository can be understood as a local storage area on the device used to centrally store skills to be backed up. The backup target repository can be understood as a remote storage repository used to receive backup content.

[0030] Specifically, skills that pass the sensitive information detection are copied and written to a preset skill subdirectory in the local backup repository. When changes to the local backup repository need to be synchronized to the remote repository, sensitive information detection is performed again on the content to be synchronized in the local backup repository to intercept sensitive information newly introduced after the skill is added to the repository and before synchronization. Simultaneously, the visibility attributes of the backup target repository are verified through the interface provided by the code hosting platform to confirm that the backup target repository is a private repository. Since the access attributes of the repository may be modified, runtime verification before each synchronization can promptly detect visibility anomalies.

[0031] Step S150: If no sensitive information is detected during the sensitive information detection process and the visibility characterization backup target repository is a private repository, the changes in the local backup repository are synchronized to the backup target repository.

[0032] Specifically, only when no sensitive information is detected during the second sensitive information detection, and the verification result shows that the visibility of the backup target repository is a private repository, are the changes in the local backup repository allowed to be committed and pushed to the backup target repository to complete the backup synchronization. Conversely, if sensitive information is detected again, or the backup target repository is not a private repository, the synchronization operation is terminated to prevent sensitive information or private content from being pushed to a public location.

[0033] According to the solution of this disclosure embodiment, by performing ownership classification screening on the skills to be backed up, sensitive information detection and blocking before import, secondary sensitive information detection before synchronization, and runtime verification of the visibility of the backup target repository, security protection is set at both the entry of skills into the backup repository and the synchronization to the remote end. This solves the problems of inappropriate backup scope, leakage of sensitive information with backup, and uncontrollable backup target when backing up skills on multiple platforms in related technologies. Thus, it realizes secure and controllable backup of skill assets on multiple platforms and improves the reliability, security and accuracy of skill backup.

[0034] In one possible implementation, step S110, scanning at least one root path to identify a valid skill directory containing skill identifier files and obtaining skill records, includes the following steps: S111, recursively traverse at least one root path; S112. If a subdirectory contains a skill identifier file, the subdirectory is identified as a valid skill directory. S113. Extract the skill name, absolute path, root path identifier of the scan, and whether the path is a symbolic link from the valid skill directory, and generate skill records.

[0035] In this embodiment of the disclosure, the skill name can be understood as a name used to identify the skill directory, such as taken from the name field or directory name of the skill directory. The absolute path can be understood as the complete path of the skill directory in the device file system. The associated scan root path identifier can be understood as information indicating which scan root path the skill directory originates from, such as the scan root path number or path string. The flag indicating whether the path is a symbolic link can be understood as a Boolean flag indicating whether the path of the skill directory is a link.

[0036] Specifically, in this implementation, a recursive traversal is performed on each scan root path in the scan root path set, checking subdirectories at each level during the traversal. When a subdirectory contains a skill identifier file (e.g., SKILL.md), that subdirectory is identified as a valid skill directory. The skill name, absolute path, identifier of its corresponding scan root path, and whether the path is a symbolic link are then extracted from this valid skill directory, and this information is encapsulated into a skill record. After performing the above processing on all valid skill directories, a set of skill records is obtained.

[0037] In one example, the root path for scanning includes the first tool skill directory, the second tool skill directory, and the third tool skill directory. After recursively traversing, if a subdirectory A containing SKILL.md is found under the first tool skill directory, then subdirectory A is determined to be a valid skill directory, and a skill record A is generated. This skill record A contains the skill name of subdirectory A, its absolute path, the identifier of the root path to which it belongs, and a marker indicating whether the path of subdirectory A is a symbolic link.

[0038] According to the solution of this disclosure embodiment, by recursively traversing and scanning the root path and determining the valid skill directory using the skill identification file, skill assets scattered across multiple platform directories can be automatically discovered without the need for manual inventory, thus saving the time cost of skill inventory.

[0039] In one possible implementation, the actual source path is determined in the following way: S121. When the path indicated by the skill record is a symbolic link, parse the symbolic link and determine the path pointed to by the symbolic link as the actual source path. S122. If the path corresponding to the skill record instruction is not a symbolic link, determine the absolute path of the skill record as the actual source path.

[0040] In this embodiment of the disclosure, a symbolic link can be understood as a link file that points to another file or directory, and accessing the link is equivalent to accessing the target it points to. The actual source path can be understood as the real storage path that the symbolic link ultimately points to.

[0041] Specifically, when the marker indicating whether the path in a skill record is a symbolic link indicates that the path in the skill record is a symbolic link, the symbolic link is parsed to obtain the target path it points to, and this target path is determined as the actual source path of the skill record. When the marker indicates that the path in the skill record is not a symbolic link, it means that the content of the skill directory is directly stored at the absolute path recorded in the skill record, and in this case, the absolute path is directly determined as the actual source path.

[0042] In one example, a skill directory exists as a symbolic link under the first tool skill directory. This symbolic link points to a subdirectory under the user-defined development directory. After resolving the symbolic link, the subdirectory under the user-defined development directory is determined as the actual source path of the skill record.

[0043] According to the solution of this disclosure embodiment, by parsing symbolic links to determine the actual storage path of skill content, misjudgment of ownership caused by skill catalogs referencing other locations in the form of links is avoided, providing an accurate basis for subsequent ownership classification.

[0044] In one possible implementation, the preset directory set includes a user-defined development directory set, a shared root path set, and a system-hosted directory set. Based on the affiliation between the actual source path of the skill record and the preset directory set, the ownership category of the skill record is determined, including the following steps: S123. When the actual source path belongs to a set of user-defined development directories, the ownership category is determined to be individual. S124. If the scan root path to which the skill record belongs belongs to the shared root path set and the actual source path does not belong to the system-managed directory set, determine the ownership category as shared. S125. When the actual source path belongs to the system managed directory set, determine the ownership category as managed; S126. If the actual source path does not belong to the user-defined development directory set, the scanning root path to which the skill record belongs does not belong to the shared root path set, and the actual source path does not belong to the system-managed directory set, the ownership category is determined to be unknown.

[0045] In this embodiment, the user-defined development directory set can be understood as a set of directories configured by the user to store personally created skill directories. The shared root path set can be understood as a set of directories used to store cross-platform shared skills. The system-hosted directory set can be understood as a set of directories automatically generated by the system or tool during installation, used to store managed skills with fixed paths. The user-defined development directory set and the shared root path set can be configured by the user, while the system-hosted directory set can be a fixed, built-in set.

[0046] Specifically, the ownership category of a skill record is determined according to the following rules: When the actual source path belongs to the user-defined development directory set, it indicates that the skill is personally created content and is classified as personal. When the scan root path of the skill record belongs to the shared root path set, and the actual source path does not belong to the system-hosted directory set, it indicates that the skill is located in a shared area and is not system-hosted content, and is classified as shared. When the actual source path belongs to the system-hosted directory set, it indicates that the skill is hosted by the system or a tool, and is classified as hosted. When the actual source path does not belong to the user-defined development directory set, the scan root path of the skill record does not belong to the shared root path set, and the actual source path does not belong to the system-hosted directory set, it indicates that the skill cannot be classified into any of the above categories and is classified as unknown.

[0047] In one example, a skill is classified as personal when its actual source path points to a subdirectory under a user-defined development directory. A skill is classified as shared when it resides in a shared subdirectory of the second tool's skill directory and its actual source path is not in the system-managed directory set. A skill is classified as managed when it resides in a managed subdirectory of the system tools.

[0048] According to the scheme of this disclosure embodiment, by combining the actual source path and the scanning root path to perform hierarchical determination of the affiliation of multiple directory sets, the automatic four-classification of skill ownership is realized, eliminating the need for manual identification of skill affiliation one by one, and providing a rule-based basis for automatic screening of backup scope.

[0049] In one possible implementation, skills to be backed up are filtered from skill records based on ownership category, including the following steps: S127. Skill records with ownership category of individual are identified as skills to be backed up; S128. If a skill record with the ownership category of shared is confirmed by the user, the skill record of the shared category shall be identified as a skill to be backed up.

[0050] In this embodiment of the disclosure, the skill to be backed up can be understood as a skill that is allowed to enter the subsequent sensitive information detection and backup process.

[0051] Specifically, skill records with personal ownership are considered private assets created by the user and are directly identified as skills to be backed up. Skill records with shared ownership, originating from cross-platform shared directories, can be included in the backup process at the user's discretion; after user confirmation, these shared skill records are identified as skills to be backed up. Skill records with managed or unknown ownership are not included in the backup process, thus limiting the backup scope to user-controlled private and confirmed shared skills.

[0052] In one example, among the multiple skill records obtained from the scan, personal skill records are directly identified as skills to be backed up; for shared skill records, the skill record is also identified as a skill to be backed up after the user confirms that the shared skill needs to be backed up; managed and unknown skill records are not included in the set of skills to be backed up.

[0053] According to the solution of this disclosure embodiment, by including only personal skills and shared skills confirmed by the user in the skills to be backed up, the automatic separation of personal private skills from system-hosted and unclaimed skills is achieved, avoiding the overall backup of irrelevant skills and improving the accuracy of the backup scope.

[0054] In one possible implementation, step S130, performing sensitive information detection on the text files contained in the skill to be backed up, includes the following steps: S131. Based on the preset file extension whitelist, filter text files from the files included in the skill to be backed up; S132. Perform sensitive information detection on each text file included in the backup skill.

[0055] In this embodiment of the disclosure, the preset file extension whitelist can be understood as a pre-configured set of file extensions used to indicate the type of text file, such as .md, .py, .js, .json, .yaml, etc.

[0056] Specifically, when performing sensitive information detection on a backup skill, the system first iterates through all files in the directory of the skill to be backed up, determining whether each file belongs to a text file type in the preset file extension whitelist based on its extension, thereby filtering out the text files that need to be detected. Then, the content of each filtered text file is read one by one, and sensitive information detection is performed.

[0057] In one example, the directory containing the skills to be backed up contains files such as documentation (.md), scripts (.py), configuration files (.yaml), and images (.png). Based on a preset file extension whitelist, documentation (.md), scripts (.py), and configuration files (.yaml) are filtered as text files, while images (.png) are not included in the detection scope because their extension is not on the whitelist. Sensitive information checks are then performed on each of the documentation (.md), scripts (.py), and configuration files (.yaml).

[0058] According to the solution of this disclosure embodiment, the text files to be detected are filtered by a file extension whitelist, which not only covers text files that may carry sensitive information in the skills, but also avoids invalid scanning of non-text files, thereby improving detection efficiency.

[0059] In one possible implementation, sensitive information detection includes at least one of the following matches: Matching the private key file header format, matching the platform token prefix format, matching the cloud service access key format, and matching the hard-coded credential assignment format.

[0060] In this embodiment of the disclosure, the private key file header format can be understood as the starting mark format of the private key file, such as a format starting with "-----BEGIN PRIVATE KEY-----". The platform token prefix format can be understood as the prefix identifier of various platform access tokens, such as token formats prefixed with "ghp_" or "github_pat_". The cloud service access key format can be understood as the identifier format of cloud service access keys, such as key identifier formats prefixed with "AKIA". The hard-coded credential assignment format can be understood as the format of hard-coding credentials in the code using assignment statements, such as the assignment pattern "api_key = "……"".

[0061] Specifically, when performing sensitive information detection, regular expressions can be used to match the content of text files. The detection includes at least one of the following matches: matching the private key file header format to identify whether the text contains the start marker of the private key file; matching the platform token prefix format to identify whether the text contains the platform token; matching the cloud service access key format to identify whether the text contains the cloud service access key; and matching the hard-coded credential assignment format to identify whether the text contains the hard-coded credential assignment. The above detection mode is the basic mode; other modes can be added as needed, such as adding a mode to identify private content like email addresses.

[0062] In one example, if a line in a script file contains "api_key = "sk-1234"", then that line is matched by a regular expression pattern for a hard-coded credential assignment format, indicating that the text file contains sensitive information.

[0063] According to the scheme of this disclosure embodiment, by adopting multi-pattern regular expression matching covering private keys, platform tokens, cloud service access keys and hard-coded credentials, it is possible to comprehensively identify common sensitive information forms in skill text files, while supporting pattern expansion, thus taking into account both the comprehensiveness and flexibility of detection.

[0064] In one possible implementation, blocking the import of the skill to be backed up upon detecting sensitive information includes the following steps: S133. Output the path and matching type of the text file containing sensitive information in the skill to be backed up; S134. Terminate the import of skills to be backed up.

[0065] In this embodiment of the disclosure, the matching type can be understood as indicating which detection mode the hit sensitive information belongs to, such as private key file header, platform token prefix, cloud service access key or hard-coded credential assignment.

[0066] Specifically, when sensitive information is detected in any text file of the skill to be backed up, an alarm report is output to the user. This alarm report includes the specific path of the text file that was hit and the matching type corresponding to the hit content, so that the user can locate the problematic file and determine the specific type of leakage risk. At the same time, the import operation of the skill to be backed up is terminated.

[0067] In one example, when performing sensitive information detection on the backup skill, if a hard-coded key assignment is detected in the script file "scripts / registry.py", an alarm report containing the path to "scripts / registry.py" and the matching type "hard-coded credential assignment" is output, and the import of the backup skill is terminated.

[0068] According to the solution of this disclosure, by outputting the path and matching type of the hit file and terminating the import when sensitive information is detected, the sensitive information is blocked before entering the backup library. At the same time, it provides users with locatable and verifiable alarm information, effectively preventing skills containing sensitive information from being backed up accidentally.

[0069] In one possible implementation, step S140, writing the skill to be backed up into the local backup library, includes the following steps: S141. Perform security verification on symbolic links within the backup skill; S142. If there are symbolic links inside the skill to be backed up pointing to the outside of the skill's directory, refuse to write the skill to be backed up to the local backup library. S143. If the verification is successful, copy the skill to be backed up to the preset skill subdirectory of the local backup library; S144. Update the manifest file of the local backup library, and record the skill name and import timestamp of the skill to be backed up.

[0070] In this embodiment, symbolic link security verification can be understood as a process of checking whether symbolic links contained within the skill to be backed up point to the skill directory. A preset skill subdirectory can be understood as a subdirectory in the local backup library used to centrally store skill content, such as the skills subdirectory. A manifest file can be understood as a file used to record information about skills imported into the backup library, such as a library.json file.

[0071] Specifically, before copying the skill to be backed up to the local backup repository, a security verification is performed on all symbolic links within the skill to be backed up, checking whether each symbolic link points to the directory of the skill to be backed up. If there are symbolic links pointing outside the directory of the skill to be backed up, it means that the skill contains references to external directories, which may pose a risk of unauthorized dissemination. In this case, the skill to be backed up is rejected from being written to the local backup repository. If the verification passes, that is, all symbolic links point to their own directories, the skill to be backed up is completely copied to the preset skill subdirectory of the local backup repository. After the copy is completed, the manifest file of the local backup repository is updated, recording the skill name and import timestamp of the skill to be backed up in the manifest file.

[0072] In one example, if a skill to be backed up contains a symbolic link pointing to another external directory, the symbolic link security verification will fail when the external link is detected, and the skill will be refused to be written to the local backup library. In another example, if all symbolic links within a skill to be backed up point to its own directory, the skill will be copied to the skills subdirectory of the local backup library after successful verification, and its name and import timestamp will be recorded in library.json.

[0073] According to the solution of this disclosure embodiment, by performing security verification on internal symbolic links before skills are copied into the library and rejecting skills containing external links from being copied into the library, unauthorized references to external directories are prevented during the skill backup process, and import information is recorded through a manifest file, thereby improving the integrity and traceability of the backup process.

[0074] In one possible implementation, verifying the visibility of the backup target repository includes the following steps: S145. If the backup target repository does not exist, create the backup target repository in private mode and verify the visibility of the created backup target repository again. S146. If the backup target repository exists and the visibility indicates that the backup target repository is a private repository, the verification is confirmed to be successful. S147. If the backup target repository exists and its visibility indicates that the backup target repository is not a private repository, then synchronization is refused. S148. If the visibility query fails, terminate the synchronization.

[0075] In this embodiment of the disclosure, the visibility of the backup target repository can be understood as the attribute of whether the repository is a private repository or a public repository, which can be obtained through the interface provided by the code hosting platform.

[0076] Specifically, before repository creation, connection, and each synchronization push, the visibility attribute of the backup target repository is queried through the interface provided by the code hosting platform. If the backup target repository does not exist, it is created in private mode, and its visibility is queried again after creation to confirm that the creation result meets expectations. If the backup target repository exists and its visibility is private, the visibility verification is considered successful. If the backup target repository exists but its visibility is not private, it indicates that the backup target has a risk of public exposure, and synchronization is refused. If the visibility query fails, synchronization is terminated and a security warning is output.

[0077] In one example, when a backup target is initially set up, the backup target repository does not yet exist. The system creates the repository in private mode and then queries again to confirm that it is a private repository, thus verifying the privacy. If the backup target repository already exists but has been changed to a public repository, its visibility is found to be non-private before synchronization, synchronization is refused, and a risk is reported to the user. If the visibility query for the backup target repository fails, synchronization is terminated, and a security warning is output.

[0078] According to the solution of this disclosure, by performing runtime verification of the visibility of the backup target repository before repository creation, connection and each synchronization, and refusing to synchronize non-private repositories and terminating synchronization when queries fail, even if the access attributes of the backup target repository are accidentally modified, it can be detected and blocked in time before synchronization, thus ensuring the privacy of the backup target throughout its entire lifecycle.

[0079] In one possible implementation, step S150, synchronizing changes from the local backup repository to the backup target repository, includes the following steps: S151. Detect changes to the working area of ​​the local backup repository; S152. Add the changed files whose paths match the preset whitelist to the temporary storage area. The preset whitelist includes the manifest file of the local backup library and the files in the preset skill subdirectory of the local backup library. S153. Perform the commit and push operations to synchronize the changes to the backup target repository.

[0080] In this embodiment, the workspace can be understood as the version management work area corresponding to the local backup repository, and workspace changes can be understood as file changes that occur within this work area, such as additions, modifications, or deletions. The staging area can be understood as a storage area in version management used to temporarily store file changes to be committed. The preset whitelist can be understood as the range of paths allowed to enter the staging area, such as including the manifest file of the local backup repository and files under preset skill subdirectories. The current content of the workspace can be understood as the latest content of the files in the staging area within the workspace.

[0081] Specifically, when synchronizing the local backup repository, changes to the working directory of that local backup repository are first detected. Then, only changed files whose paths match a preset whitelist are added to the staging area; that is, only files in manifest files (e.g., library.json) and preset skill subdirectories (e.g., the skills directory) are allowed to enter the staging area. Path changes outside the whitelist are not added to the staging area. After confirming that no sensitive information is detected during a subsequent sensitive information check and that the backup target repository is a private repository, a commit and push operation is performed to synchronize the changes to the backup target repository.

[0082] In one example, multiple changes occur in the local backup repository's working area, including modifications to a skill file in the `skills` directory, an update to `library.json`, and the generation of a temporary file. Since the temporary file's path is not in the default whitelist, only the modified file in the `skills` directory and `library.json` are added to the staging area. After the synchronization prerequisites are met, a commit and push operation is performed to synchronize the changes to the target backup repository.

[0083] According to the solution of this disclosure embodiment, the range of files entering the temporary storage area is limited by the path whitelist, and sensitive information detection is performed again on the current content of the temporary file's workspace before pushing. Sensitive information and irrelevant files are blocked from entering the remote repository from both the synchronization path and content detection levels, ensuring the purity and security of the remote backup content.

[0084] In one possible implementation, step S140 involves performing sensitive information detection again on the content to be synchronized in the local backup repository, including the following steps: S149. Perform sensitive information detection on the current content of the working area of ​​the files in the temporary storage area.

[0085] In this embodiment, the current content of the working area of ​​a file in the staging area can be understood as the latest content of the file that has been added to the staging area in the current working area. Since skills may still be edited after being imported into the local backup library, and new sensitive information may be introduced during the editing process, it is necessary to perform sensitive information detection again on the current content of the working area of ​​the staging file before synchronization.

[0086] Specifically, before synchronizing changes from the local backup repository to the target backup repository, sensitive information detection is performed on files that have been added to the staging area, based on their current content in the working area, rather than only detecting the content of old snapshots that have been staging. This ensures that sensitive information newly introduced through subsequent editing can also be detected.

[0087] In one example, a skill file was modified by a user after being imported into a backup repository, and the modifications included an access token. Before synchronization, when performing a sensitive information check on the current content of the file's workspace in the staging area, this access token was detected, thus blocking the push of the sensitive information.

[0088] According to the solution of this disclosure, by performing sensitive information detection on the current content of the working area of ​​the file in the temporary storage area before synchronization, the object of the secondary detection is applied to the current working area content of the temporary file. This enables continuous interception of newly introduced sensitive information during the editing stage after the skills are added to the database, forming a double defense together with the pre-import detection.

[0089] In one possible implementation, before synchronizing changes in the local backup repository to the backup target repository, the multi-platform skill backup method provided in this disclosure embodiment further includes the following steps: S160. Generate and output the operation plan for the change operation. The operation plan includes safety risk information of the skills involved in the change operation. S170. Upon receiving the user's overall confirmation instruction for the operation plan, perform the change operation.

[0090] In this embodiment of the disclosure, the operation plan can be understood as a description of the change operation to be performed, used to display the specific content of the change operation to the user before execution. Security risk information can be understood as warning information in the operation plan regarding the security risks of the skills involved.

[0091] Specifically, for change operations, such as importing, deleting, or synchronizing skills, by default only an operation plan is generated and output, without directly executing the actual changes. This operation plan includes security risk information for the skills involved in the change operation. The corresponding change operation is only executed upon receiving the user's overall confirmation instruction for the operation plan. Through the above preview-confirm-execute process, all change operations are reversible by default, allowing users to fully review the operation plan and confirm its accuracy before execution.

[0092] In one example, an operation plan is generated and output before the synchronization operation is performed. This plan lists the skills involved in the change operation and the security risk information for each skill. The actual synchronization change is only executed after the user confirms the overall operation plan.

[0093] According to the solution of this disclosure, by generating and outputting an operation plan containing information on the safety risks of the skills involved before the change operation is executed, and only executing the change after the user confirms the entire plan, the change operation is made reversible by default, reducing the risk of data loss due to misoperation.

[0094] Figure 2This is a complete flowchart illustrating a multi-platform intelligent agent skill backup method according to another embodiment of this disclosure. Figure 2 As shown, this method can be applied to the aforementioned intelligent agent skill backup device, combining the steps of the above embodiments to form a complete backup and synchronization process. This method includes, but is not limited to, steps S210 to S290. Each step is described in detail below.

[0095] Step S210: Recursively traverse each scan root path in the scan root path set to identify valid skill directories containing skill identifier files, and obtain a skill record set.

[0096] In this embodiment, a pre-configured set of scan root paths is read, which includes multiple scan root paths. Each scan root path is recursively traversed, and during the traversal, it is checked whether each subdirectory contains a skill identifier file (e.g., SKILL.md). For subdirectories containing skill identifier files, they are determined to be valid skill directories, and the skill name, absolute path, identifier of the scan root path to which it belongs, and a marker indicating whether the path is a symbolic link are extracted to generate skill records. These records are then aggregated to obtain a set of skill records.

[0097] Step S220: For each skill record in the skill record set, parse the symbolic link to obtain the actual source path, and determine the ownership category based on the affiliation between the actual source path and the preset directory set.

[0098] In this embodiment of the disclosure, for each skill record, if its path is a symbolic link, the symbolic link is parsed to obtain the actual source path; if its path is not a symbolic link, its absolute path is used as the actual source path. Subsequently, the actual source path and the scanning root path to which the skill record belongs are compared with the preset directory set (including the user-defined development directory set, the shared root path set, and the system-hosted directory set) to determine the ownership category of the skill record according to the rules of personal, shared, hosted, and unknown categories.

[0099] Step S230: Filter the skills to be backed up according to ownership category.

[0100] In this embodiment of the disclosure, skill records with the ownership category of individual are directly identified as skills to be backed up, and skill records with the ownership category of shared are identified as skills to be backed up after obtaining user confirmation. Skill records of managed and unknown categories are not included in the skills to be backed up.

[0101] Step S240: Perform sensitive information detection on the text files contained in the backup skill.

[0102] In this embodiment of the disclosure, text files are selected from the files contained in the skill to be backed up based on a preset file extension whitelist, and sensitive information detection is performed on each text file one by one. Sensitive information detection includes matching at least one of the following: private key file header format, platform token prefix format, cloud service access key format, and hard-coded credential assignment format.

[0103] Step S250: If sensitive information is detected, the import of the skill to be backed up is blocked, and an alarm report containing the file path and matching type is output.

[0104] In this embodiment of the disclosure, when sensitive information is detected in any text file, an alarm report containing the path of the text file and the matching type is output, and the import of the skill to be backed up is terminated.

[0105] Step S260: For the skills to be backed up that have passed the sensitive information detection, perform internal symbolic link security verification, copy them to the local backup library, and update the manifest file.

[0106] In this embodiment of the disclosure, security verification is performed on the symbolic links inside the skill to be backed up. If there are symbolic links pointing to the outside of the directory of the skill to be backed up, writing is rejected. After the verification is passed, the skill to be backed up is copied to the preset skill subdirectory of the local backup library, and the manifest file is updated to record the skill name and import timestamp.

[0107] Step S270: Before synchronization, perform sensitive information detection again on the content to be synchronized in the local backup repository, and verify the visibility of the backup target repository.

[0108] In this embodiment of the disclosure, before synchronizing the local backup repository, sensitive information detection is performed again on the content to be synchronized, and the visibility attribute of the backup target repository is queried through the interface provided by the code hosting platform. If the backup target repository does not exist, it is created in private mode and verified again; if the backup target repository exists and is a private repository, the verification passes; if the backup target repository exists and is not private, synchronization is rejected; if the query fails, synchronization is terminated.

[0109] Step S280: Detect changes to the working area of ​​the local backup library and add the changed files whose paths match the preset whitelist to the temporary storage area.

[0110] In this embodiment of the disclosure, the preset whitelist includes a list file of the local backup library and files in the preset skills subdirectory. Path changes outside the whitelist are not added to the temporary storage area.

[0111] Step S290: Perform a sensitive information check on the current content of the working area of ​​the file in the staging area again. If no sensitive information is detected, perform the commit and push operation to synchronize the changes to the backup target repository.

[0112] In this embodiment, sensitive information detection is performed again on the current content of the working area of ​​the file in the temporary storage area. If no sensitive information is detected, the commit and push operations are performed to synchronize the changes of the local backup library to the backup target repository, thereby completing the secure backup and synchronization of skills across multiple platforms.

[0113] According to the solution of this disclosure, by linking multi-source scanning, ownership classification, sensitive information detection and blocking before import, symbolic link security verification, backup target repository visibility verification, path whitelist incremental synchronization, and secondary sensitive information detection before synchronization into a complete backup synchronization process, multiple security defenses are set up throughout the entire process of skill assets from discovery to remote backup. This solves the problems of inappropriate backup scope, leakage of sensitive information during backup, and uncontrollable backup targets in related technologies when backing up skills on multiple platforms, thereby achieving secure and controllable backup and synchronization of skill assets on multiple platforms.

[0114] Figure 3 This is a schematic diagram of the architecture of an intelligent agent skill backup system provided according to an embodiment of this disclosure. Figure 3 As shown, the system includes a multi-source discovery module 301, an ownership classification module 302, a sensitive information scanning module 303, a privacy verification module 304, and an incremental synchronization module 305.

[0115] The multi-source discovery module 301 is used to scan at least one scanning root path, identify a valid skill directory containing skill identification files, and obtain skill records.

[0116] The ownership classification module 302 is used to determine the ownership category of the skill record based on the affiliation between the actual source path of the skill record and the preset directory set, and to filter the skills to be backed up from the skill record according to the ownership category.

[0117] The sensitive information scanning module 303 is used to perform sensitive information detection on the text files contained in the skill to be backed up, block the import of the skill to be backed up if sensitive information is detected, and perform sensitive information detection again on the content to be synchronized before synchronization.

[0118] Privacy verification module 304 is used to verify the visibility of the backup target repository.

[0119] The incremental synchronization module 305 is used to synchronize changes in the local backup repository to the backup target repository.

[0120] In this embodiment, the data flow between the modules is as follows: the multi-source discovery module 301 outputs the scanned skill records to the ownership classification module 302; the ownership classification module 302 filters out the skills to be backed up according to the ownership category and allows the user to select them; the skills to be backed up selected by the user are sent to the sensitive information scanning module 303 to perform sensitive information detection before import; the skills that pass the detection are written to the local backup library; the privacy verification module 304 performs visibility verification on the backup target library; and the incremental synchronization module 305 synchronizes the changes in the local backup library to the remote private library after the verification is passed.

[0121] According to the scheme of this disclosure, by sequentially coordinating the multi-source discovery, ownership classification, sensitive information scanning, privacy verification and incremental synchronization modules, a complete security link from skill discovery to remote backup is constructed, realizing secure and controllable backup of multi-platform skill assets.

[0122] In one possible implementation, the agent skill backup method provided in this disclosure can also be applied to cross-device recovery scenarios. When a user changes devices or reinstalls the system, they can use a recovery command to pull backed-up personal skills from a remote private repository and restore the skills to the corresponding skill catalogs on each platform, thereby quickly restoring the personalized development environment. The recovery operation can be performed using conventional pull and deployment methods.

[0123] In one possible implementation, the agent skill backup method provided in this disclosure can also be applied to skill security audit scenarios. Security teams can leverage sensitive information detection capabilities to conduct regular audits of all skill assets, discover legacy hard-coded credentials, and drive the completion of key cleanup and configuration modifications.

[0124] In one possible implementation, the agent skill backup method provided in this disclosure can also be applied to scenarios where open-source and private skills are managed separately. Open-source skills and private skills are automatically distinguished through ownership classification. Open-source skills retain their original update channels, while private skills are backed up separately to a private repository, with neither interfering with the other.

[0125] In one possible implementation, operations involving access to local device data, such as sensitive information detection of skill files, require user authorization if necessary.

[0126] Figure 4 This is a schematic diagram of the structure of an intelligent agent skill backup device 400 provided according to an embodiment of this disclosure. Figure 4 As shown, the device includes: Scanning module 401 is used to scan at least one scanning root path, identify a valid skill directory containing skill identification files, and obtain skill records; The classification and filtering module 402 is used to determine the ownership category of the skill record based on the affiliation between the actual source path of the skill record and the preset directory set, and to filter the skills to be backed up from the skill record according to the ownership category. Sensitive detection module 403 is used to perform sensitive information detection on the text files contained in the skill to be backed up, and to block the import of the skill to be backed up if sensitive information is detected; The inbound verification module 404 is used to write the skills to be backed up into the local backup library, perform sensitive information detection again on the content to be synchronized in the local backup library, and verify the visibility of the backup target repository. The synchronization module 405 is used to synchronize changes in the local backup repository to the backup target repository if no sensitive information is detected during the sensitive information detection process and the visibility characterization backup target repository is a private repository.

[0127] In one possible implementation, the scanning module 401 is used to: recursively traverse at least one scanning root path; if a subdirectory contains a skill identifier file, determine the subdirectory as a valid skill directory; extract the skill name, absolute path, identifier of the scanning root path to which it belongs, and a marker indicating whether the path is a symbolic link from the valid skill directory, and generate a skill record.

[0128] In one possible implementation, the device further includes a parsing module, configured to: parse the symbolic link when the skill record indicates that the corresponding path is a symbolic link, and determine the path pointed to by the symbolic link as the actual source path; and determine the absolute path of the skill record as the actual source path when the skill record indicates that the corresponding path is not a symbolic link.

[0129] In one possible implementation, the preset directory set includes a user-defined development directory set, a shared root path set, and a system-managed directory set. The classification and filtering module 402 is used to: determine the ownership category as individual when the actual source path belongs to the user-defined development directory set; determine the ownership category as shared when the scan root path to which the skill record belongs belongs to the shared root path set and the actual source path does not belong to the system-managed directory set; determine the ownership category as managed when the actual source path belongs to the system-managed directory set; and determine the ownership category as unknown when the actual source path does not belong to the user-defined development directory set, the scan root path to which the skill record belongs does not belong to the shared root path set, and the actual source path does not belong to the system-managed directory set.

[0130] In one possible implementation, the classification and filtering module 402 is further configured to: identify skill records with an ownership category of individual as skills to be backed up; and, if a skill record with an ownership category of shared is confirmed by the user, identify the shared skill record as a skill to be backed up.

[0131] In one possible implementation, the sensitivity detection module 403 is used to: filter text files from the files contained in the skill to be backed up according to a preset file extension whitelist; and perform sensitivity information detection on each text file contained in the skill to be backed up. Sensitive information detection includes matching at least one of the following: private key file header format, platform token prefix format, cloud service access key format, and hard-coded credential assignment format.

[0132] In one possible implementation, the sensitivity detection module 403 is also used to: output the path and matching type of the text file containing sensitive information in the skill to be backed up; and terminate the import of the skill to be backed up.

[0133] In one possible implementation, the inbound verification module 404 is used to: perform security verification on symbolic links within the skill to be backed up; if there are symbolic links within the skill to be backed up pointing to the outside of the skill's directory, refuse to write the skill to be backed up into the local backup library; if the verification passes, copy the skill to be backed up to the preset skill subdirectory of the local backup library; and update the manifest file of the local backup library to record the skill name and import timestamp of the skill to be backed up.

[0134] In one possible implementation, the inbound verification module 404 is further configured to: create a backup target repository in private mode if the backup target repository does not exist, and re-verify the visibility of the created backup target repository; determine that the verification is successful if the backup target repository exists and the visibility indicates that the backup target repository is a private repository; refuse synchronization if the backup target repository exists and the visibility indicates that the backup target repository is not a private repository; and terminate synchronization if the visibility query fails.

[0135] In one possible implementation, the synchronization module 405 is used to: detect changes in the working area of ​​the local backup repository; add changed files whose paths match a preset whitelist to the staging area, the preset whitelist including the manifest file of the local backup repository and files in the preset skill subdirectories of the local backup repository; perform sensitive information detection again on the current content of the working area of ​​the files in the staging area; and if no sensitive information is detected, perform commit and push operations to synchronize the changes to the backup target repository.

[0136] In one possible implementation, the device further includes a safety confirmation module for: generating and outputting an operation plan for the change operation, the operation plan containing safety risk information of the skills involved in the change operation; and executing the change operation upon receiving a user's overall confirmation instruction for the operation plan.

[0137] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0138] The acquisition, storage, and application of any type of information, such as user personal information, involved in the technical solutions disclosed herein comply with relevant laws and regulations and do not violate public order and good morals.

[0139] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0140] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0141] like Figure 5 As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0142] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0143] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the agent skill backup method. For example, in some embodiments, the agent skill backup method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the agent skill backup method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the agent skill backup method by any other suitable means (e.g., by means of firmware).

[0144] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0145] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0146] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0147] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0148] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0149] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0150] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0151] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for backing up agent skills, comprising: Scan at least one root path to identify a valid skill directory containing skill identification files and obtain skill records. Based on the affiliation between the actual source path of the skill record and the preset directory set, determine the ownership category of the skill record, and based on the ownership category, filter the skills to be backed up from the skill record; Perform sensitive information detection on the text files contained in the skill to be backed up, and block the import of the skill to be backed up if sensitive information is detected; The skill to be backed up is written into the local backup library. Sensitive information detection is performed again on the content to be synchronized in the local backup library, and the visibility of the backup target repository is verified. If no sensitive information is detected during the re-execution of sensitive information detection and the visibility indicates that the backup target repository is a private repository, the changes in the local backup repository will be synchronized to the backup target repository.

2. The method according to claim 1, characterized in that, The step of scanning at least one root path to identify a valid skill directory containing skill identifier files and obtain skill records includes: The at least one root path of the scan is recursively traversed; If the skill identifier file is contained in a subdirectory, the subdirectory is identified as a valid skill directory; Extract the skill name, absolute path, root path identifier, and whether the path is a symbolic link from the valid skill directory to generate the skill record.

3. The method according to claim 1, characterized in that, The actual source path is determined in the following way: If the path indicated by the skill record is a symbolic link, the symbolic link is parsed, and the path pointed to by the symbolic link is determined as the actual source path; If the path indicated by the skill record is not a symbolic link, the absolute path of the skill record is determined as the actual source path.

4. The method according to claim 1, characterized in that, The preset directory set includes a user-defined development directory set, a shared root path set, and a system-managed directory set. The step of determining the ownership category of the skill record based on the affiliation between the actual source path of the skill record and the preset directory set includes: If the actual source path belongs to the user-defined development directory set, the ownership category is determined to be individual. If the scan root path to which the skill record belongs belongs to the shared root path set and the actual source path does not belong to the system-hosted directory set, the ownership category is determined to be shared. If the actual source path belongs to the system's hosted directory set, the ownership category is determined to be hosted. If the actual source path does not belong to the user-defined development directory set, the scanning root path to which the skill record belongs does not belong to the shared root path set, and the actual source path does not belong to the system-hosted directory set, then the ownership category is determined to be unknown.

5. The method according to claim 1, characterized in that, The step of filtering skills to be backed up from the skill records according to the ownership category includes: The skill records with ownership categorized as "individual" are identified as skills to be backed up. If a skill record with the ownership category of shared is confirmed by the user, the skill record of the shared category is identified as a skill to be backed up.

6. The method according to claim 1, characterized in that, The process of performing sensitive information detection on the text files contained in the skill to be backed up includes: Based on a preset file extension whitelist, text files are selected from the files contained in the skill to be backed up; The sensitive information detection is performed on each of the text files.

7. The method according to claim 6, characterized in that, The sensitive information detection includes at least one of the following matches: Matching the private key file header format, matching the platform token prefix format, matching the cloud service access key format, and matching the hard-coded credential assignment format.

8. The method according to claim 1, characterized in that, The step of blocking the import of the skill to be backed up upon detecting sensitive information includes: Output the path and matching type of the text file containing the sensitive information in the skill to be backed up; Terminate the import of the skill to be backed up.

9. The method according to claim 1, characterized in that, The step of writing the skill to be backed up into the local backup library includes: Perform security verification on the symbolic links within the skill to be backed up; If a symbolic link exists within the skill to be backed up that points to a directory outside the skill to be backed up, the skill to be backed up will not be written to the local backup library. If the verification is successful, the skill to be backed up will be copied to the preset skill subdirectory of the local backup library; Update the manifest file of the local backup library to record the skill name and import timestamp of the skill to be backed up.

10. The method according to claim 1, characterized in that, The verification of the visibility of the backup target repository includes: If the backup target repository does not exist, create the backup target repository in private mode and verify the visibility of the created backup target repository again; If the backup target repository exists and the visibility indicates that the backup target repository is a private repository, the verification is deemed successful. If the backup target repository exists and the visibility indicates that the backup target repository is not a private repository, synchronization is refused. If the visibility query fails, the synchronization is terminated.

11. The method according to claim 1, characterized in that, The step of synchronizing changes in the local backup repository to the target backup repository includes: Detect changes to the working area of ​​the local backup repository; Add the changed files whose paths match the preset whitelist to the temporary storage area. The preset whitelist includes the manifest file of the local backup library and the files in the preset skill subdirectory of the local backup library. Perform commit and push operations to synchronize the changes to the backup target repository.

12. The method according to claim 11, characterized in that, The process of performing sensitive information detection again on the content to be synchronized in the local backup repository includes: Perform sensitive information detection on the current content of the working area of ​​the files in the temporary storage area.

13. The method according to claim 1, characterized in that, Before synchronizing the changes in the local backup repository to the target backup repository, the method further includes: Generate and output an operation plan for the change operation, the operation plan including safety risk information of the skills involved in the change operation; Upon receiving confirmation from the user regarding the overall operation plan, the change operation is executed.

14. An agent skill backup device, comprising: The scanning module is used to scan at least one root path, identify valid skill directories containing skill identifier files, and obtain skill records. The classification and filtering module is used to determine the ownership category of the skill record based on the affiliation between the actual source path of the skill record and the preset directory set, and to filter the skills to be backed up from the skill record based on the ownership category. A sensitivity detection module is used to perform sensitivity information detection on the text files contained in the skill to be backed up, and to block the import of the skill to be backed up if sensitive information is detected; The inbound verification module is used to write the skill to be backed up into the local backup library, perform sensitive information detection again on the content to be synchronized in the local backup library, and verify the visibility of the backup target repository. The synchronization module is used to synchronize the changes in the local backup repository to the backup target repository if no sensitive information is detected during the sensitive information detection process again and the visibility characterization backup target repository is a private repository.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-13.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-13.

17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-13.