Skip to content

Artifacts

An artifact is a standalone piece of an agent’s reply, such as a code file, a document, a diagram, a chart or a small web page. In web chat, each artifact appears in the reply as a card with its title and type. Select the card to open the artifact in a panel beside the conversation, where you can read it, see its source, copy it or download it.

Card type What it is How it’s shown
Code Source code in any language Syntax-highlighted, with line numbers
Document Markdown Formatted text, with tables
HTML A web page Rendered in an isolated frame
SVG A vector image Rendered in an isolated frame
Diagram A Mermaid diagram, such as a flowchart or a sequence diagram Drawn as a diagram
Chart A Vega-Lite chart specification Drawn as an interactive chart
PDF A PDF file the agent delivered Shown in the panel’s PDF viewer
Image A PNG, JPEG, GIF, WebP, BMP, ICO or AVIF file the agent made Fitted to the panel, on a checkerboard so transparency shows, with its dimensions. Click it for actual size.
Word A .docx file Laid out in pages
PowerPoint A .pptx file Drawn slide by slide, with its charts
Excel A .xlsx file Each sheet’s saved values as a table, one tab per sheet

You don’t need to set anything up. Web chat turns these into artifact cards:

  • Code blocks. Code, commands and configuration stay in the reply as a highlighted block with its language and Copy code. Blocks marked as mermaid, html, svg or vega-lite, and JSON that is a Vega-Lite spec, become a card that opens as a diagram, page, image or chart.
  • Artifact tags. An agent can wrap a piece in an <artifact> tag with a type and a title. In web chat, agents whose Agent type is Classic are told to use it only for content that has to be rendered to be seen, such as a diagram, a chart, a page or an SVG, or when the person asks for an artifact or a standalone document; code stays in the reply. Deep agents can use the tag too if their instructions ask for it. The types are code (with a language), markdown, html, svg, mermaid and vega-lite.
  • Files the agent writes or delivers. When a deep agent writes or hands you a PDF, an image, a Word, Excel or PowerPoint file, a text file or a web page, its file step or tile opens it in the same panel. Other files, such as TIFF images, download instead. See How replies appear.

While a reply is still streaming, the card says it’s generating the artifact, for example Generating python…. Select it to open the panel on what has arrived so far: the panel follows the artifact as it’s written, until it’s complete.

A file open in the panel keeps up with the agent while a turn runs. You can open a file from its step as soon as that step ends, without waiting for the reply to finish. Then:

  • each write or edit the agent makes to the file shows at once;
  • the file is read again after each of the agent’s commands, because a script can change it without naming it, and once more when the turn ends.

While it follows, the panel shows Live and flashes on each change. This works for every type the panel shows, Word, Excel and PowerPoint included.

To steer how an agent presents its output, say so in its instructions, for example: “When you show figures over time, draw them as a Vega-Lite chart.”

Charts use Vega-Lite, a JSON format for describing charts. A chart artifact looks like this:

<artifact type="vega-lite" title="Sales by month">
{"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"values": [{"month": "Jan", "sales": 120}, {"month": "Feb", "sales": 150}]},
"mark": "bar",
"encoding": {"x": {"field": "month", "type": "ordinal"},
"y": {"field": "sales", "type": "quantitative"}}}
</artifact>
  • Any agent can draw one. A JSON code block that is a Vega-Lite spec, because its $schema names Vega-Lite or it has both mark and encoding, is drawn as a chart too. Its title comes from the spec’s title or description.
  • The data must be in the spec. Put it under "data": {"values": [...]}. Charts never load data from a URL, so a chart can’t make your browser contact another site.
  • Charts fit the panel. A chart without a width fills the panel’s width, and it follows the light or dark theme.
  • Export. The chart’s menu saves it as PNG or SVG.

If a spec isn’t valid, the panel shows the error and the spec instead of a chart.

The panel opens beside the conversation. Drag its edge to resize it. The conversation keeps a minimum width, so the message box always stays usable.

Button What it does
View code Shows what the agent wrote behind a formatted artifact: the Markdown, HTML, SVG, Mermaid or chart spec, with syntax highlighting. Select View preview to go back. Code artifacts are already code, and files such as PDFs, images and Office files have no source to show.
Copy response Copies the artifact’s content to the clipboard. Not offered for files such as PDFs, images and Office files.
Download Saves the artifact as a file of its type, for example .md, .html, .svg, .mmd or .vl.json. Code is saved with its language as the extension, and a file the agent made keeps its own name.
Close Closes the panel

In dev mode, the panel opens over the IDE instead of as another column.

If the agent works in a sandbox, the same panel also shows your files and your browser. With more than one open, the panel has tabs: Artifact, Files and Browser. See Sandboxes.

  • Web chat, both the workspace chat and a chat embedded in another site.
  • Conversations, where transcripts show the same cards, and they open in the same panel.

On other channels, such as Slack, Telegram or Google Chat, replies arrive as that channel’s own messages and there is no artifact panel.