Build

Artifacts

On this page

What an artifact is

An artifact is a static website: HTML, CSS, JavaScript, images and any other files, published from a folder. Reports, dashboards, briefs, prototypes and slide-like pages are all artifacts. Everything runs in the visitor's browser; there is no server code. If your tool needs a server, publish it as an app instead.

The CLI and the MCP tools call an artifact a site: valet sites, publish_site.

Publish an artifact

Ask your agent:

Publish this report as a Valet artifact called report.

Your agent creates the artifact, then publishes the files:

create_service
{ "kind": "site", "name": "report" }
publish_site
{
  "name": "report",
  "title": "Weekly support report",
  "description": "Tickets opened and closed this week, by team.",
  "files": [
    { "path": "index.html", "content": "<!doctype html>\n<title>Weekly support report</title>\n…" },
    { "path": "style.css", "content": "body { font-family: system-ui; }" }
  ]
}

With files, publish_site carries the pages in the call, as text only: HTML, CSS, JavaScript, Markdown, JSON and SVG. An agent that can run git publishes from a Git push instead, which sends only what changed and carries any file, images and PDFs included. See Publish with Git.

With the CLI, valet sites create makes the artifact and links the current folder to it. valet deploy commits every file in the folder except .git and .valet, then pushes the commit with Git, sending only what changed. It doesn't use ignore files to exclude files. Publish from a folder that holds only what belongs on the page.

Addresses

Every artifact has its own address:

https://<name>.<org>.valet.run

An artifact named report in the organization acme serves at https://report.acme.valet.run. If you don't choose a name, Valet generates one. Artifacts, apps and agents share one set of names in an organization, so two can't have the same name.

In a new organization, the first address can take a few minutes to start working while Valet sets up HTTPS.

Valet serves files as follows:

  • /about serves about.html, and /about/ serves about/index.html.
  • A missing page serves your 404.html if the artifact has one.
  • An artifact answers only page requests. A form that posts to the artifact's own address gets an error; use an app for that.

Who can open it

Each artifact has one access mode. New artifacts are private.

ModeWho can open it
PrivateMembers of your organization, after they sign in to Valet
PasswordMembers of your organization, plus anyone with the password
PublicAnyone on the internet

Ask your agent:

Make the report public.
set_service_access
{ "name": "report", "kind": "site", "mode": "public" }

Password mode takes no password in the tool call. set_service_access with "mode": "password" and a reason returns a link to a page in your dashboard. You set the visitor password there, and the access mode changes when you finish. The password never enters the conversation. You can also run valet sites access report password, which asks for the password without showing it.

A sign-in to an artifact lasts 24 hours. Changing or clearing the password signs out everyone who entered the old one.

Share with one person

Sharing gives one person access to one artifact. They don't need a Valet account, and they get nothing else your organization owns. Use it to show a private report to a customer or a colleague outside your organization.

Valet emails each person a link. The link itself grants access: anyone who has the email can open the artifact, so forwarding it forwards access. A share link lasts until you remove it, unless you set a deadline when you send it.

share_service
{ "name": "report", "emails": ["alice@example.com"], "expires_in": "7d" }
  • expires_in (--expires-in in the CLI) stops the link a set time after you send it.
  • access_ttl (--expires-after-open) stops it a set time after the person first opens it.
  • You can share with up to ten addresses at a time.

To remove access:

unshare_service
{ "name": "report", "emails": ["alice@example.com"] }

Access ends within seconds. A removed link never works again; sharing with the same address sends a new one.

valet sites shares report lists who has access and whether they have opened it. get_service reports how many people an artifact is shared with, and with include: ["shares"] lists their emails. In the dashboard, an artifact's Sharing tab shows the same list and can renew an expired link.

Update, rename or remove

Publishing again replaces the artifact's files with a new release. The address stays the same. Valet removes any file you leave out of the new publish.

A blocking release policy can refuse a release. The artifact keeps serving its current release. See Release policies to review findings in the dashboard's Releases tab.

Any member of the organization can update an artifact, even without the original files. Your agent reads the published files first:

get_source
{ "name": "report" }

An agent that can run git clones the artifact instead, through create_push or get_source with git: true and a key_sha256, and publishes its changes from a push.

To go back to an earlier release, list the releases and roll back to one. Leave out release to go back to the newest earlier release with different files.

list_releases
{ "name": "report" }

rollback_service
{ "name": "report", "release": 3 }

A rollback publishes the earlier release's files again as a new release, and release policies check it as they would any publish. It doesn't change env vars, connectors or access. The CLI has no rollback command.

To rename or remove it:

rename_service
{ "name": "report", "new_name": "q3-report" }

destroy_service
{ "name": "q3-report" }

Renaming moves the artifact to the new address. The old address stops working and doesn't redirect. Destroying an artifact takes it down permanently and removes every share link.

Call your organization's connectors

A page can use live data from a connector your organization has set up, such as a CRM or an internal MCP server. Valet adds the organization's credential, so the page never holds it. Ask your agent:

Attach the hubspot connector to the report and show this week's deals.

The agent attaches the connector:

attach_connector
{ "name": "report", "connector": "hubspot" }

Then it reads the connector's tools with list_connector_tools, which lists each tool's input schema and, when the connector's server sends them, its output schema and annotations. It never runs a tool. Given only connector, it reads any organization connector's tools, attached or not, so an agent can check what a connector offers before you attach it. Attach one only when you want the page to call it.

Your agent then writes the page's code to call the connector through Valet, and tests it by opening the page, which calls the connector through the site's own broker. That call is real: a tool that writes or sends does so.

Connector limits:

  • The connector must be an MCP server Valet reaches over HTTP. list_connectors shows which ones qualify.
  • Public artifacts can't call connectors. Make the artifact private or password first.
  • By default, each artifact can make 60 connector calls a minute. Each call has 30 seconds and a 4 MiB answer limit.

See Connectors for how an administrator sets connectors up.

Show who is visiting

A published page can ask Valet who opened it. It sends a GET request to /__valet/visitor on its own address. The answer is JSON: a visitor object with the visitor's kind, sub, email and name, and a signed token.

Use it to greet a signed-in member or to show which address a share went to. Don't use it to protect data. A visitor controls the page in their own browser, and Valet already checks access before it serves the page. To keep data behind who someone is, build an app.

Test WebMCP tools

An artifact renders as a top-level page, so a browser that finds WebMCP tools only at the top level, such as Codex's built-in browser, finds tools the page registers with document.modelContext.registerTool. Test at your local development address first, then open the artifact's own address once it's published. A private artifact asks the visitor to sign in to Valet first, so sign in rather than making it public to test.

Limits

One file, from the CLI or a push

Default
25 MiB

One publish, from the CLI or a push

Default
500 files and 50 MiB

One publish over MCP with files

Default
50 text files, 128 KiB each, 192 KiB in all

Artifacts per organization

Default
1,000

The CLI and a push publish any file type. An artifact can't run server code, store data from visitors, or hold env vars or resources; those need an app.

Next steps

  • Data access: choose how your artifact reaches company data.
  • Apps: run server code or store records.