Skip to main content
Each application using sandboxed runtime has a file system where LLMs can read, write, and process files as needed. The file system contains two types of files:
  • Resources: Persistent files you upload or create, such as skills.
  • Artifacts: Temporary files LLMs generate during each run.
File System

Resources

Resources are files you create or import for your workflows. LLMs can read but cannot modify them. They persist across runs and are included when you export the app.

Skills

Skills bundle instructions, knowledge, scripts, and any other references for specialized tasks—define once, reuse across workflows. For example, instead of repeating style guidelines and uploading brand materials every time you need an LLM to generate marketing copy, create a marketing-copy skill with everything included and simply reference it whenever needed. Think of a skill as a detailed SOP (Standard Operating Procedure) and the LLM as a capable new hire. The new hire has general abilities but doesn’t know your company’s specific processes. A skill provides everything they need—step-by-step instructions, reference materials, tools to use—so they can complete tasks the way you expect.

Create or Import Skills

Import skills you’ve been using elsewhere, start with our ready-made skill templates, or create custom ones directly in the file system. Every skill requires a SKILL.md file that defines what the task is, when to use the skill, and how to perform it step by step. Within SKILL.md, you can reference any available resources—scripts, templates, context materials, or Dify tools—and specify when and how to use them.
Skills

Reference Skills in Prompts

Type / in the prompt editor and select a skill folder from the Files tab. LLMs read the skill’s frontmatter (name, description, and metadata) first, then load the full content only when needed. This saves tokens and keeps things efficient, especially when working with multiple skills.

Artifacts

Artifacts are files LLMs generate during execution—reports, images, or any other output. LLMs have full read-write access to them. You can preview and download artifacts under the Skills tab or in the Variable Inspect panel at the bottom of the canvas.

Artifact Lifecycle

Artifacts in the sandbox have different lifecycles in testing and production. They are not included when you export the app.
Artifacts persist across test runs. To clear them, click Reset all in the Variable Inspect panel.
You may also see system files like .bashrc and .profile under Artifacts. These are part of the sandbox environment and persist across runs.

Output Artifacts to End Users

Artifacts are stored in the sandbox environment and cannot be directly exposed to end users. To output them, you need to extract them through another Agent node:
  1. Add an Agent node downstream of the node that generates the file.
  2. Disable Agent Mode and enable Structured Output.
  3. Add a file-type structured output variable.
  4. Import the upstream Agent’s chat history via Add Chat History. This lets the LLM locate the file path.
  5. In the user message, instruct the model to extract and output the file (e.g., “Output the generated PDF file”).
  6. In an Answer or Output node, reference the Agent node’s file output variable.

Supported File Types and Operations

The file system supports any file type. All files can be downloaded; some can also be previewed or edited.
  • Markdown: MD, MARKDOWN, MDX
  • Code: JSON, YAML, YML, TOML, JS, JSX, TS, TSX, PY, SCHEMA
  • Other text: HTML, CSS, XML, SQL, SH, BASH, CSV, TXT, JSONL, and other plain text files