OpenAI: shell, skills, and compaction
Source: Shell + Skills + Compaction: Tips for long-running agents that do real work
Published: 11 February 2026.
Evidence type: product guidance plus early production observations from OpenAI and Glean.
Three complementary primitives
- Skills are versioned procedures loaded after metadata-based selection.
- Shell supplies a real local or hosted execution environment for installing, running, and writing artifacts.
- Compaction preserves continuity once the conversation approaches the context limit, either automatically in-stream or through an explicit endpoint.
Together they move procedures out of the system prompt, execute real work, and support workflows longer than one model context.
Routing and skill content
OpenAI recommends descriptions that answer when to use, when not to use, and what output and success look like. Negative examples and edge cases distinguish neighbouring skills. Glean reported an initial targeted routing decrease of about 20% after introducing skills and recovery after adding negative cases.
Templates and worked examples belong inside the skill, not the system prompt, because they improve structured outputs without taxing unrelated requests. Glean attributes notable production quality and latency improvements to this on-demand placement.
For contractual production workflows, explicitly instruct the model to use the named skill rather than depending on automatic routing.
Long-run continuity
The article’s concrete continuation mechanism is previous_response_id.
Compaction can run automatically in-stream after a threshold or explicitly
through /responses/compact; these are separate controls, not synonyms.
- Reuse the same container when dependencies, caches, and intermediate output must persist.
- Continue the same response/thread state where the API and data policy permit.
- Plan for compaction from the start instead of treating it as failure recovery.
- Write deliverables to a known handoff directory so tools, models, developers, and later steps share a durable boundary.
OpenAI’s hosted convention is /mnt/data; the general standard should require a
declared artifact boundary rather than that literal path.
Network and secrets
OpenAI calls skills plus open networking a high-risk exfiltration path. Its recommended default permits skills and shell but enables networking only for a narrow request with a minimal allowlist.
The documented control has two layers: an organisation allowlist sets the maximum destinations and each request selects a subset needed for that job. Authenticated destinations use domain-bound secret injection so the model sees placeholders while a sidecar supplies actual values only to approved hosts. Tool output remains untrusted.
Local-to-hosted lifecycle
Local mode preserves the hosted tool contract: the application executes a
shell_call itself and returns shell_call_output, or supplies a custom shell
executor through the Agents SDK. The same skill can therefore move between an
internal developer machine and a hosted container without rewriting its
procedure.
Start locally for fast debugging and internal-tool access. Move to hosted containers for repeatability, isolation, and deployment consistency. Keep the skill stable across both so the workflow contract does not change with the executor.
Three described patterns progress from a shell producing a reviewable artifact, to a skill stabilising a repeatable shell workflow, to skills acting as living enterprise SOPs for multi-tool orchestration. Glean reports one Salesforce workflow improving evaluation accuracy from 73% to 85% and reducing time to first token by 18.1%; this is one customer result, not a universal baseline.
The three patterns are concrete:
- Install dependencies, fetch data, and write a reviewable artifact such as
/mnt/data/report.md. - Stabilise a successful shell workflow by moving its steps, guardrails, templates, and examples into a mounted skill.
- Use skills as living enterprise procedures for multi-tool work such as account planning, escalation triage, or brand-aligned content generation.
Standards implications
- Define skills as procedure, shell as execution, and artifacts as handoff.
- Require negative routing examples for potentially overlapping skills.
- Design compaction, environment reuse, and artifact persistence before long workflows enter production.
- Enforce organisation and request network boundaries and keep secrets out of model-visible context.
- Preserve workflow semantics across local and hosted executors.