---
id: 18164
lang: en
title: "VK AI Space dropped per-file copying into the pod: a sandbox call took 92 seconds"
published_at: "2026-11-25 08:27:07"
source_name: "Habr AI"
source_url: "https://habr.com/ru/companies/vktech/articles/1111700/?utm_campaign=1111700&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18164"
categories: ["llm", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# VK AI Space dropped per-file copying into the pod: a sandbox call took 92 seconds

> **Краткая суть (BLUF):** Before an agent can run a skill's script, the working files have to be delivered into an isolated sandbox. VK AI Space copied them from S3 one at a time: with 530 files, acquiring the sandbox took 20 seconds and releasing it took 72, for a total of 92 seconds and 1,060 requests. Now the S3 folder is mounted into the Kubernetes pod as a disk via the csi-s3 driver. For platforms running agents, mounting storage is cheaper than copying files.  • A skill is a folder containing SKILL.md, scripts, and reference files; the format is open • Unstable skill ordering broke the prompt cache and made requests more expensive • Scripts without set -e could fail halfway and still return exit code 0

Writing a skill for a personal assistant is easy. The difficulties start when it has to be handed over to an entire department: who gets access to the scripts, where they run, and what happens if a skill reaches out to the network or starts rewriting its own files. The VK AI Space team added support for the open Agent Skills format (the same one Claude Code uses) and described how it handled these questions in the runtime. One figure stands out: on a workspace of 530 files, a single call to the sandbox, meaning the isolated environment where the agent runs scripts, initially took 92 seconds and 1,060 HTTP requests. Those seconds went to moving files from S3 storage into the pod (the smallest unit of container deployment in Kubernetes) and back.

## What a skill is and how it differs from a prompt

A skill is a folder with a SKILL.md file (a YAML header plus instructions in Markdown), optional scripts, and reference files. Instructions in a prompt field live in the agent's settings, are edited by its owner, and are transferred by copying text. A skill is stored in a project folder, maintained by the author of the procedure, and the folder can be checked with the standard's validator before upload. A step in a prompt is carried out by the model based on text; a step in a skill can be carried out by a script.

The agent loads a skill in three stages. First, only the name and description go into the system prompt, on the order of a hundred tokens per skill. When the task matches the description, the agent loads the full SKILL.md. Only after that does it run scripts and read nested files. A hundred-page reference costs not a single token until it is needed. That is why the description must state the conditions of use and prohibitions such as "do not use for generating PDFs": the phrase "works with PDF" tells the model nothing.

Uploads go through the API as a ZIP archive. The platform checks three requirements: a name of up to 64 characters from the set a-z, 0-9, and hyphen; a description of up to 1,024 characters; and the name must match the directory. Changes during migration apply only to the runtime: remove hardcoded paths like ~/.claude/skills, do not write to the skill directory (it is read-only; write to /storage/session or /tmp), and do not install packages with pip inside a skill, because the network is closed.

## Two errors found through the accounting and the missed steps

The first concerns the prompt cache. Model providers cache the beginning of a request, but for a cache hit the prefix must match exactly. The order of skills in the list changed from request to request, because it was not set explicitly during assembly, so processing was billed at the full rate. The fix was sorting by name.

The second is related to shell scripts. Shell returns the exit code of the last command, so a script without set -e could partly execute and return 0. The agent considered the step complete even though it had not been carried out. VK does not rewrite third-party scripts: on upload the author receives a warning, and the model is given, along with the skill text, a rule to run scripts as bash -euo pipefail script.sh.

## From copying to mounting

Delivering files into the pod took the most time in the release. Skills, session files, and the user's "My Files" section live in S3. In the first version, the platform walked the S3 prefix and uploaded files into the pod one at a time through the API, then transferred them back when the sandbox was released. The sandbox is released after every tool call, so files were moving back and forth long before the session ended. Earlier the team called this scheme mounting, but in practice it was per-file copying.

By measurements on 530 files, acquiring the sandbox took about 20 seconds and releasing it took 72, totaling 92 seconds and 1,060 HTTP requests per run_in_sandbox call. Parallelizing across eight threads reduced the waiting, but files still had to be moved in both directions.

Now the S3 prefix is attached to the pod as a static PersistentVolume through the csi-s3 CSI driver with the geesefs mounter: files appear as a regular directory, and there is no need to copy them in full.

## What this means in practice

For platform teams, the takeaway is this. If an agent has many files and frequent sandbox calls, per-file copying from object storage quickly becomes the main bottleneck. Sort skills in the prompt so the cache is not lost, run scripts in strict mode, and give each agent only the subset it needs: an accountant gets pdf-text-extract and invoice-check, a recruiter gets resume-parser, and they know nothing about each other's skills.

A caveat: a skill remains executable code, so isolation and the closed network matter as much as speed. For comparison, Gemini CLI has a separate activate_skill tool for activation, and Codex reserves two percent of the context window for the skill list and shortens descriptions when it overflows. VK chose to load instructions on demand and execute them in the sandbox with ordinary commands, without a separate "run the skill" tool.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/companies/vktech/articles/1111700/?utm_campaign=1111700&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18164
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
