Detection Capability | Description |
AI semantic audit | Perform semantic analysis on the natural language description and Prompt instructions of the Skill to determine whether the declared feature is consistent with the actual behavior. |
Static rule scan | Perform static analysis on the code, scripts, dependencies, and configuration files in the Skill package to identify known malicious patterns. |
Dynamic sandbox validation | Run the Skill in an isolated sandbox environment, observe its runtime behavior, and identify abnormal behaviors such as file operations, network exfiltration, and command execution. |
Risk Dimension | Description |
Supply chain risk | Detect whether third-party packages and remote links that the Skill depends on contain known vulnerabilities or malicious components. |
Command injection | Detect whether the Skill code or Prompt contains malicious command execution logic. |
Data exfiltration | Detect whether the Skill sends user data or system information to external addresses during runtime. |
Prompt injection | Detect whether the Skill description or instructions contain malicious Prompts that hijack model behavior. |
Abnormal runtime behavior | Detect abnormal behaviors such as file operations and network access during Skill runtime. |
Scenario | Customer Values |
Skill Marketplace Listing Review | Identify malicious code, Prompt injection, credential theft, supply chain risks, and runtime abnormal behaviors before third-party Skills are listed. |
Internal SkillHub Admission | Establish a unified security baseline for Skills submitted by internal employees or external suppliers. |
Batch Rescan of Existing Skills | After rules, models, or sandbox capabilities are upgraded, perform version-based rescans on historical Skills. |
Automated Integration via OpenAPI | Support customer platforms, CI/CD, and operations backends in calling upload and query APIs. |
Security Operations and Audit | Output traceable scan conclusions, risk items, scores, and reports to facilitate review, remediation, and record-keeping. |
Configuration Item | Requirement |
Packaging Method | Use the built-in ZIP library of the programming language for packaging, such as Go archive/zip and Python zipfile. |
File Sorting | Sort by path byte order, which is equivalent to running LC_ALL=C sort in the Shell. |
Timestamp. | Fixed to 2000-01-01 00:00:00 UTC. |
Compression Algorithm | DEFLATE, with the compression level fixed at 6. |
Permissions for the file. | Fixed to 0644. |
Extra Field / Comment | Do not write. |
Directory Entries | Do not write directory entries separately. The directory structure is reflected by the file paths themselves. |
File Filtering | All files in the Skill directory must be packaged without any filtering or exclusion. |
FileData parameter of the UploadSkillSecScan API./path/to/skill_dir with the path to the Skill directory to be detected.FileData parameter to the UploadSkillSecScan API.package mainimport ("archive/zip""bytes""compress/flate""crypto/sha256""encoding/base64""encoding/hex""fmt""io""os""path/filepath""sort""strings""time")// Fixed timestamp: 2000-01-01 00:00:00 UTCvar fixedModTime = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)func packSkillDir(skillDir string) ([]byte, error) {// 1. Collect relative paths of all filesvar files []stringerr := filepath.Walk(skillDir, func(path string, info os.FileInfo, err error) error {if err != nil {return err}if info.IsDir() {return nil // Do not write directory entry}rel, err := filepath.Rel(skillDir, path)if err != nil {return err}// Use / as the path separator in the ZIP filefiles = append(files, filepath.ToSlash(rel))return nil})if err != nil {return nil, err}// 2. Sort by path byte order (equivalent to LC_ALL=C sort)sort.Strings(files)// 3. Write ZIP (compression level 6, fixed timestamp, fixed permission 0644)buf := new(bytes.Buffer)zw := zip.NewWriter(buf)// Explicitly register a deflate writer at compression level 6 to ensure stable output across Go versionszw.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {return flate.NewWriter(out, 6)})for _, rel := range files {header := &zip.FileHeader{Name: rel,Method: zip.Deflate,Modified: fixedModTime,}header.SetMode(0644)// Do not write Extra Field / Commentheader.Extra = nilheader.Comment = ""w, err := zw.CreateHeader(header)if err != nil {return nil, err}f, err := os.Open(filepath.Join(skillDir, filepath.FromSlash(rel)))if err != nil {return nil, err}if _, err := io.Copy(w, f); err != nil {f.Close()return nil, err}f.Close()}if err := zw.Close(); err != nil {return nil, err}return buf.Bytes(), nil}func main() {if len(os.Args) < 2 {fmt.Println("Usage: skill_package_to_base64 <skill_dir>")os.Exit(1)}skillDir := strings.TrimRight(os.Args[1], string(os.PathSeparator))zipBytes, err := packSkillDir(skillDir)if err != nil {fmt.Fprintf(os.Stderr, "pack failed: %v\\n", err)os.Exit(1)}sum := sha256.Sum256(zipBytes)fmt.Println("ContentHash:", hex.EncodeToString(sum[:]))fmt.Println("FileData (Base64):")fmt.Println(base64.StdEncoding.EncodeToString(zipBytes))}
FileData parameter of the UploadSkillSecScan API.python3 skill_package_to_base64.py /path/to/skill_dir
FileData parameter to the UploadSkillSecScan API.#!/usr/bin/env python3# skill_package_to_base64.py# Package the Skill directory into a ZIP file as specified, and output Base64 and ContentHash (SHA256)import base64import hashlibimport ioimport osimport sysimport zipfile# Fixed timestamp: 2000-01-01 00:00:00 UTCFIXED_DATE_TIME = (2000, 1, 1, 0, 0, 0)# File permission 0644UNIX_FILE_MODE = 0o644def collect_files(skill_dir: str):"""Recursively collect relative paths of all files under skill_dir and sort them in byte order."""files = []for root, _dirs, filenames in os.walk(skill_dir):for name in filenames:abs_path = os.path.join(root, name)rel = os.path.relpath(abs_path, skill_dir)# Use / as the path separator in the ZIP filerel = rel.replace(os.sep, "/")files.append(rel)# Sort by path byte order (equivalent to LC_ALL=C sort)files.sort(key=lambda s: s.encode("utf-8"))return filesdef pack_skill_dir(skill_dir: str) -> bytes:buf = io.BytesIO()# Compression level is fixed at 6 (Python 3.7+ supports compresslevel)with zipfile.ZipFile(buf, mode="w", compression=zipfile.ZIP_DEFLATED, compresslevel=6) as zf:for rel in collect_files(skill_dir):abs_path = os.path.join(skill_dir, rel.replace("/", os.sep))with open(abs_path, "rb") as f:data = f.read()zi = zipfile.ZipInfo(filename=rel, date_time=FIXED_DATE_TIME)zi.compress_type = zipfile.ZIP_DEFLATED# Write file permission 0644 to the upper 16 bits of external_attrzi.external_attr = (UNIX_FILE_MODE & 0xFFFF) << 16# Do not write Extra Field / Commentzi.extra = b""zi.comment = b""zf.writestr(zi, data)return buf.getvalue()def main():if len(sys.argv) < 2:print("Usage: python3 skill_package_to_base64.py <skill_dir>", file=sys.stderr)sys.exit(1)skill_dir = sys.argv[1].rstrip(os.sep)if not os.path.isdir(skill_dir):print(f"Not a directory: {skill_dir}", file=sys.stderr)sys.exit(1)zip_bytes = pack_skill_dir(skill_dir)content_hash = hashlib.sha256(zip_bytes).hexdigest()print("ContentHash:", content_hash)print("FileData (Base64):")print(base64.b64encode(zip_bytes).decode("ascii"))if __name__ == "__main__":main()
Language | ZIP Library | Method for Setting Compression Level |
Node.js | fflate | zipSync(data, { level: 6 }) |
Java | java.util.zip | ZipOutputStream.setLevel(6) |
Rust | zip crate + flate2 crate | ZipWriter::start_file(name, FileOptions::default().compression_level(Some(6))) |
UploadSkillSecScan API currently limits the size of a single Skill ZIP file to 10 MB. Files exceeding this limit will be rejected. We recommend that you streamline the Skill package content, for example by removing unnecessary binary resources and model weights, to keep the file within 10 MB.malicious / suspicious / benign.フィードバック