Skip to main content
A download link hands one sandbox file to something that cannot carry a LangSmith credential: a browser tab, an <a href> in an email, a webhook consumer, or a third-party service that fetches a URL you give it. The link carries its own token. Reading a file with the SDK’s read() needs a workspace API key on every request; a download link needs nothing beyond the URL itself.

Quick start

Anyone can then fetch it with no credential:
The token encodes the sandbox, the tenant, the exact file path, and the response headers, so a link cannot be edited to point at a different file or a different sandbox. Each link serves exactly one path. A link is pinned to that path, not to a snapshot of the file. The file itself is not captured or copied when the link is minted.
Do not modify a file after minting a link for it. A later write to that path may or may not be reflected in what the link serves, so treat the file as immutable for the life of the link. When the contents change, write a new file and mint a new link for it.
Links are served from the sandbox service domain, on the sandbox’s own host, never from the LangSmith API host. Downloaded content is therefore isolated from your LangSmith session.
Call it on the client instead of a sandbox instance to mint a link by sandbox name:

Options

Response:
expires_at is null when expires_in_seconds was omitted. Minting a link requires the sandboxes:exec permission, the same access a credentialed download needs. See Sandbox permissions. GET and HEAD are supported, along with Range (for resumable and partial downloads), If-Range, and If-None-Match. No headers, query string, or body are needed or accepted. Fetching a link wakes a stopped sandbox, so the first request after an idle stop takes as long as a start. The sandbox does not need to be running when you mint the link.

Security considerations

A download link is a bearer credential embedded in a URL. Anyone who obtains it can read that one file until it expires. Treat a link like a password: send it over a channel you trust, and prefer a short expires_in_seconds for anything sensitive.
  • Links cannot be revoked. A minted link stays valid until it expires, even if the API key that created it is deleted or loses sandboxes:exec. Set an expiry when that matters.
  • Links die with the sandbox. Deleting the sandbox invalidates every link into it.
  • The file must not change. A link is pinned to a path, so a write to that path after minting may or may not be reflected in what the link serves.
  • Guest headers are dropped. The response is rebuilt from an allowlist of content, range, and validator headers. Cookies or other headers set by code inside the sandbox are never forwarded.
  • Rendered content is sandboxed. Every response carries X-Content-Type-Options: nosniff and Content-Security-Policy: sandbox, so a file served with content_disposition=inline renders with no capabilities and no access to your LangSmith session.
Use a download link to hand one file to an outside consumer. Use read() to pull file bytes into your own code. Use a service URL to reach an HTTP server running inside the sandbox.

Troubleshoot