> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrmagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Artifact Sharing & External Delivery

> Turn any Agent output into a read-only share link — zero signup for recipients, optional password gate, TTL expiry, immutable version snapshots, and one-click revocation.

# Artifact Sharing & External Delivery

When your Agent finishes a web page, report, PDF, or a multi-file site, Myrm can turn it into a **read-only share link** that anyone can open in a browser — no account, no install, no login. It is the final step of the "say → do → see → share" delivery loop.

## One-Click Share Links

From the artifact card, click **Share** to generate a public link instantly:

* **Zero signup for recipients** — the link opens directly in any browser
* **Read-only by design** — recipients can view, not edit; editing happens inside Myrm
* **Optional password gate** — protect sensitive content (weekly reports, contract drafts) behind a password
* **TTL auto-expiry** — links live from 1 to 30 days (configurable) and then stop working automatically

## Immutable Version Snapshots

A share link is always locked to a **specific immutable version** of the artifact:

* The content never drifts — later edits to the artifact do not pollute a link you already sent
* Each snapshot is fingerprinted by SHA-256, so shared content is provably the exact bytes at share time
* If the materialized bundle is removed, it is automatically re-materialized from the immutable snapshot on next access

## Multi-File Bundles

Myrm automatically collects everything a page needs into a single share bundle:

* **HTML + CSS + JavaScript + images** discovered from the real reference chain — not just the entry file
* **Nested directories** are preserved, so sub-resources resolve correctly
* **Inline styles with single-quoted URLs** are handled correctly
* **Lockfiles and build artifacts** (`package-lock.json`, `node_modules`) are excluded from bundles
* **Documents and PDFs** are served with correct media types even when the vault object has no filename extension — a Chinese-named document renders as Markdown, a PDF opens as a PDF

## Share Lifecycle — Revoke, Status & Audit

Share links are fully manageable and **revocable at any time** — for both artifacts and conversations:

* **One-click revoke** — revoking a link makes it return `404 Link Revoked` immediately, with no grace period and no cache bypass
* **Revoked password-protected links** — lifecycle checks run *before* the password gate, so a revoked protected link shows the dead-link page to fresh visitors, never a password prompt
* **Revoked tokens never resurrect** — the current `share_token_fingerprint` and a persisted `share_revoked_fingerprints` set ensure a revoked link stays 404 forever, even if you share the same conversation again later
* **Search-engine blocking** — every public share response carries `X-Robots-Tag: noindex, nofollow` + `Cache-Control: no-store` + `Referrer-Policy: no-referrer`, so a revoked link cannot be reached through cached or indexed copies
* **Live status in the UI** — the share dialog shows the current state (`unshared` / `revoked` / `active` / `password_protected`), the link URL, and remaining expiry every time you open it; after revoking, the dialog stays open showing "revoked"
* **Revocation audit log** — every revoke is recorded for traceability
* **Conversation deletion cascades** — deleting the source conversation immediately invalidates its share (`404 Content Unavailable`)

## Security Design

| Dimension            | Implementation                                                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Tamper-proof         | Stateless HMAC-SHA256 signature — any byte change invalidates the link (404)                                             |
| Traversal-safe       | Materialized paths are strictly contained with `Path.is_relative_to`; `../` and `%2e%2e` encodings are rejected          |
| Credential isolation | Password-unlock cookies are named per-token (SHA-256 fingerprint), so concurrent password-protected shares never collide |
| HTTPS defense        | Unlock cookies set `Secure` over HTTPS, plus `HttpOnly` + `SameSite=Strict`                                              |
| Sub-resource auth    | After unlocking, a short-lived signed cookie authorizes CSS/JS/image sub-requests — no repeated password prompts         |
| Content safety       | HTML responses carry CSP + `X-Content-Type-Options`; non-HTML files get precise media types                              |
| Expiry recovery      | Expired links fail closed; expired unlock credentials automatically fall back to the password gate                       |
| Malformed payloads   | Signed but type-malformed tokens are rejected defensively instead of crashing                                            |
| Revoke-proof tokens  | `share_revoked_fingerprints` persisted set — revoked links stay 404 even after re-sharing                                |
| Anti-indexing        | `noindex, nofollow` + `Cache-Control: no-store` on all public share responses                                            |

## Deployment Modes

Artifact sharing works identically across all three deployment modes — the shared bundle is served from **your own sandbox**, so data never leaves your instance:

* **Local WebUI** — self-hosted, links served from your machine
* **Tauri Desktop** — served from your desktop instance
* **Cloud-hosted** — served from your dedicated sandbox via the control plane

## Honest Boundaries

* **Read-only sharing** is a deliberate choice: external recipients view only, and collaborative editing is out of scope for the single-user sandbox architecture
* **Revocation is final, not live-collaborative** — `noindex`/`no-store` stop indexing at the source, but copies already downloaded by recipients cannot be recalled
* **Password gate is single-factor** — it prevents accidental leakage, not enterprise-grade access control
* **Password-protected links require a new password after re-sharing** — passwords are never stored (HMAC-derived), so after revoking, a fresh share needs a new password; this is deliberate so old passwords cannot rebuild old links
