Skip to content
Source
Sign inSign up

Set share links and allowed hosts

Code and repositories / Artifacts

Set share links and allowed hosts

Your repository is private, and a reviewer outside the team must read one plan. Or an HTML report of your agent needs a chart script from your own CDN, and the sandbox blocks it. The artifact settings of the repository decide both.

2 min read

You need admin access to the repository.

1. Open the settings

Open the repository, then Settings, then Artifacts.

In the Share links card, use the switch Anyone with a link can open shared artifacts.

  • On: people with write access can make share links, and the links work.
  • Off: no new link can be made, and every link of the repository stops working. When you turn it on again, the links that nobody revoked work again.

The text under the switch says where the state comes from:

  • Default for a public repository: on.
  • Default for a private repository: off.
  • Set here: you changed it. Click Use the default to follow the visibility again.

3. Add an allowed host

  1. In the Allowed hosts card, type a host in Host, for example cdn.example.com.
  2. Click Add host.

The HTML artifacts of the repository can then load scripts, styles, fonts, images and data from that host, over https. A change can take up to 30 seconds to reach the pages.

The rules of a host:

  • A host name only, with no https://, no path and no port.
  • No IP address and no localhost.
  • At most 20 hosts.

To remove a host, click Remove on it, then Remove host.

Done

Your reviewer opens the plan with a share link, and the HTML report draws its chart from your CDN.

An owner of an organization can turn share links off in all its repositories, and for the artifacts of its profile:

  1. Open the organization's Settings, on the General tab.
  2. In the Artifacts card, turn on Turn off share links for artifacts in all repositories.

While it is on, the switch of each repository is off and you cannot change it. Every link of the organization stops working.

From a terminal or an agent

src artifact settings view
src artifact settings set --link-sharing on
src artifact settings set --link-sharing default
src artifact settings set --allowed-hosts cdn.example.com,charts.example.com
src artifact settings set --org acme --link-sharing off
  • --allowed-hosts sets the whole list. --allowed-hosts "" removes every host.
  • The MCP tools are get_repo_artifact_settings, set_repo_artifact_settings, get_org_artifact_settings and set_org_artifact_settings.
  • The REST routes are GET and PATCH on /api/v1/repos/{owner}/{repo}/artifact-settings and /api/v1/orgs/{org}/artifact-settings.