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

# Share and install agents

> Share an agent by link, install a copy, and finish its setup

Any agent can be shared by link, like a document. Whoever opens the link sees what the agent does and can install their own copy. Ready-made agents in the **Agent Library** install exactly the same way.

## Share an agent

1. Open the agent and click **Share**.
2. Choose who can open the link: **Anyone with the link**, or **People in this workspace**.
3. Click **Create link**, then **Copy**.

The link is on or off: switch it off and the page stops opening and no one can install from it. Add a **Source** such as `newsletter` to count the opens, sign-ups and copies that came from each place you post it.

### Share takes a snapshot

The link shares the agent as it was when you clicked **Create link**. Your later changes reach new copies only when you click **Update**. Copies people already made never change.

### Before you can share

If the agent uses an item that sits in another agent directly, such as a workflow one of its steps runs, the Share window lists it with **Move into this agent**. A copy could not reach items outside the agent. Connections never count: whoever installs connects their own.

A step that calls another agent through an [endpoint](https://docs.cogniagent.ai/features/endpoints.md) does not stop you sharing. When someone installs the copy, finishing setup asks them to pick an endpoint for that step, or skip it.

A store another agent shares with this one does not stop you sharing either. It travels as the copy's own store, under the key its items already use. See [Stores from other agents](#stores-from-other-agents).

To share an agent, you need edit access to every workflow, conversation flow, knowledge base and coworker in it. The same applies when you turn a link back on or open it to anyone. Turning a link off needs less: anyone who can add things to the agent can do it.

## What a copy takes

| Travels with the copy | Never travels |
| - | - |
| Every workflow and conversation flow | Your connections and connected accounts |
| Every knowledge base, with its documents | Phone numbers and WhatsApp lines |
| The agent's files | Conversations and run history |
| Every [data store](https://docs.cogniagent.ai/features/data-stores.md): variable groups with their values, and the contents of each database and File Store you switch on | Secret values: a secret arrives empty |
| Every coworker, with its instructions, persona, skills and capabilities | A coworker's tasks and memory |
| The setup fields it asks for | Your own answers to those setup fields |
| What it offers other agents (its endpoints), switched off | Endpoint keys, and the calls its endpoints logged |
| Its stores, at **Off** and shared with no one | Who a store was shared with, and the log of calls to it |
| The stores other agents share with it, as stores of its own: their variables, tables or empty File Store, with their contents only when you include them | Which agent shared them, their secrets and Connection variables, and their ids |

Put in a variable group only what you are willing to give to whoever gets the link: the values go with the copy. A copy gets the values, rows and files of the environment you pick, see [Share from an environment](#share-from-an-environment). You choose per database and File Store whether its contents go too, see [Include contents](#include-contents).

### What the share screen shows

Before a link or Library entry goes out, the **Share** window lists what the copy will carry: each variable with its value, the table and row counts of each database, and the file count and size of each file store. It says **Secrets are not included**, and "The copy's stores are shared with no one, and no endpoint keys come with it." The stores other agents share with this one are listed under **Stores from other agents**.

It also warns about a variable whose name or value looks like a credential, such as `api_key` or a long token: a text or URL variable, each item of a list, or a string inside a JSON value. For a single text or URL, click **Make it a Secret** to turn it into a secret: its value moves into the secret and is no longer shared. A list or a JSON value can't become a secret: change or remove what it holds.

A copy runs on the installer's credits, and its knowledge is indexed again on them.

## Share from an environment

When the agent has more than one [environment](https://docs.cogniagent.ai/features/environments.md), the **Share** window shows **Share from** at the top. It lists the environments, Production first, and marks the current one. Pick the one the copy should get its values from, and its rows and files where **Include contents** is on. The variables below show that environment's values, and each database and File Store shows its counts there. A variable with no value there shows **Empty: the copy will ask for it**.

* **Production picked.** The window says **Copies get your own Production values.** With databases or File Stores, it adds "and its rows and files where Include contents is on."
* **Another environment picked.** The window says, for example, "Copies get Demo's values as their own, and Demo's rows and files where Include contents is on."
* **Its rows or files are not ready there.** A store whose rows or files in that environment are still being copied, or could not be made, says why, such as "Demo's rows in Leads are still being copied. Sharing them waits until they are ready." Creating or updating the link, or publishing to the Library, is refused until they are.
* **Only Production.** There is no picker. The window says **Copies get these values. To share other values, add an environment such as Demo.** The link opens the Environments tab.
* **The environment was deleted.** The window says **The environment this was shared from was deleted. Choose which values to share.** Pick another one before you update.

### When the copy reads the values

The copy gets the values as they stand when it is installed, not as they were when you shared. Change a value in the environment and the next install gets the new one. Copies already installed never change.

Two cases differ:

* **Shares made before this release** keep the values they had. They start reading the environment after your next **Update**.
* **If the source agent or environment is gone**, the copy gets the values from when you shared. Finish installation says: "The values were taken from when this was shared."

### Accounts are never shared

A [Connection variable](https://docs.cogniagent.ai/features/agent-variables.md#connection-variables) goes into the copy as a definition, never with an account, even when you share with the values of an environment. The share screen lists each one with "The person installing picks their own HubSpot account." and the badge **Account not included**.

### What never travels

* **Secrets.** A secret arrives empty in the copy. So does a variable you turned into a secret after you shared.
* **A value that looks like a credential.** If it was not like that when you shared, it arrives empty.
* **Other environments.** The copy has one environment, **Production**. It holds the values you picked, that environment's channels, endpoints and trigger settings, and the rows and files you included from it. A trigger step with no settings in that environment travels with Production's.

## Include contents

Each database and File Store row in the Share window has an **Include contents** switch. It is off by default.

* **Off.** The copy gets an empty database or File Store. The row says "Off: the copy gets an empty database." or "Off: the copy gets an empty File Store."
* **On.** The copy gets the rows or files of the environment you [share from](#share-from-an-environment), as its Production rows or files. They come from a snapshot taken when you create the link or update it, or publish to the Library. The row says when, such as "Snapshot from Nov 20, 09:14: 2 tables, 40 rows".

Variable groups have no switch: they always travel with their values. Shares made before this release copy the contents of every store.

### Stores from other agents

A store another agent shares with this one travels as the copy's own store, for example "Pricing from Front desk: travels as this agent's own store (structure only)." Structure means a variable group's variables and a database's tables. A File Store arrives empty, as any File Store of a copy does without its contents: folders never travel.

* **You may share that store yourself** (you can change it): the line has an **Include contents** switch, off by default. On, the copy gets its values, rows or files too, always from that agent's Production, and the line ends "(with its contents)."
* **You can't:** the line says "Contents stay with Front desk." The copy gets the structure only.

A variable group's values never sit in what you share: with contents, the copy reads them from that store when it is made, as they are then. Secrets and Connection variables never travel, and neither does a value that looks like a credential: it arrives empty and is asked for. The copy never learns which agent shared the store.

### The link and the Agent Library keep their own choices

The link and the Agent Library entry each keep their own environment and **Include contents** choices. In **Settings → Sharing**, the **Link** and **Agent Library** tabs show each one's choices. The Share window shows the link's.

A change you make applies only after you update. Until then the window says **Not applied yet**: copies get it after you update the link, or after you update it in the Library.

## Install an agent

1. Open the link, or the agent in the Agent Library, and click **Get your own copy**. Sign up or log in if you need to.
2. Connect the apps it uses, or pick connections you already have.
3. Click **Install**.

The copy appears as a new agent named after the original. If you already have one with that name, the copy is named "AI Receptionist 2". It runs right away, using example data for anything you have not filled in yet.

## Finish installation

An installed agent shows **Finish installation** at the top of its page while it still runs on example data. Fill in each field, such as your business hours or prices, and click **Save**. Each value replaces the example everywhere the agent uses it. Text you changed by hand after installing is left alone.

### Accounts to pick

Each Connection variable of the copy has a step under **Accounts to pick**, titled "Pick an account for HubSpot", with what needs it, for example "Business › CRM account. Needed by Lead intake and Daily report." The picker lists the shared accounts you can use. A private account of yours shows **Share**, to share it with the workspace so it can be used. **New** connects another account.

The installed agent does not start until every account that something uses is picked. See [Connection variables](https://docs.cogniagent.ai/features/agent-variables.md#connection-variables).

### Stores from other agents

The stores another agent shared with the original need no step. Installed in another workspace, each is a store of the copy, and the copy's items use it under the key they already write. Its variables that arrived empty are under **Needs a value**. A store named like another of the copy's stores of the same kind gets the next free name, such as "Pricing 2".

Its contents are judged again when the copy is made, and again at **Retry setup**: they come only while the store is still that agent's, it still shares the store with the original agent, and the person who shared the copy may still share that store. Otherwise the copy gets the structure, and you are told "Its contents stay with the agent that shares it." Each copy of the contents shows in that store's **Activity**.

Installed in the original's own workspace, the copy uses the other agent's store again, as the original did, when that store is still shared with other agents at the level its items need and you can open it. Otherwise the copy gets its own store, with the structure.

### What Finish installation lists for stores

* **Needs a value.** A variable that arrived empty at install, because its value was empty in the environment you shared from or looked like a credential. Each is listed with what uses it. You can fill it in, or leave it if nothing needs it.
* **Secrets with no value.** Each is listed with what uses it. When the shared agent's code steps read it, **Code steps can read this secret** shows next to the value, off until you turn it on. The agent shows **Needs setup** until every empty secret and every needed connection is filled in.
* **Variables to review.** A variable marked **Ask on install** is listed so you can check its value. Reviewing is optional and doesn't block the agent.
* **Databases not set up.** If the database service was unavailable during the install, **Retry setup** finishes it.
* **Files not copied**, with a **Retry**, if copying a File Store failed.

## Setup fields

> [!NOTE]
>
> An agent that keeps its values in a [variable group](https://docs.cogniagent.ai/features/agent-variables.md) needs no setup fields: the installer reviews the variables you marked **Ask on install** instead.

The **Setup** tab of an agent lists what anyone installing a copy must fill in. To add one:

1. Click **Add field** and give it a label, a type and an example value.
2. Use it in a prompt or step as `{{template.key}}`, for example `{{template.business_hours}}`.

When you share the agent, your own values are replaced by the field again, so they never travel. To change the fields, or to fill them in on an installed copy, you need edit access to the items that use them.

## Agent Library

The Agent Library is the catalogue of ready-made agents, formerly the Template Center. CogniAgent's template authors publish to it from an agent's **Share** window. A library agent installs the same way as one shared by link.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.