Machines carry your agent between hosts

Move your agent to a box in your own cloud, and back, with everything it knows. Its memory, conversations, files, settings and connections come along.

Create inside a Linux guest

lnk agent create work --on here --vm vm.toml --env env.toml creates a private guest through the box machine interface. An accepted Linux host account can replace here. VM and environment inputs are optional and independent: the host's approved profile supplies the VM default. A new agent on a VM-required personal host uses that profile; an existing native agent keeps its authority until explicitly moved.

Captured inputs

The agent's own spec may name vm and env relative to that file. Command-line paths are relative to the caller. Creation captures their content once. Later edits affect future creation, rather than modifying the running agent's VM, environment or approved network grant.

Runtime placement

The complete runtime, harness installation, hooks, native tools and children run in the guest. The controller records the guest identity before activation and forwards later start, use and other agent commands to that exact identity. Stop/start restores the retained guest and its captured environment. A removed or replaced guest causes a refusal; there is no native placement fallback.

Created and borrowed guests

Creating on an existing VM box borrows it and retains that box's captured inputs. Removing the agent preserves a borrowed box. Removing an agent whose creation owns its guest removes that guest only after the agent's removal succeeds. Interrupted creation retains its identity for retry or explicit removal, without running setup on the personal host.

Approved programs and connections

The approved Linux base needs verified Link and sandbox artifacts. An explicit guest service supervisor supports bases without systemd. If outside traffic is needed, the owner approves a filtering bridge in the guest's bootstrap profile. Guest credentials are configured explicitly; the controller's model keys and SSH agent are not forwarded. Existing dedicated cloud VM boxes keep their networking and do not create a nested guest automatically.

Move it to a box, and back

lnk agent move takes your agent to a box in your own cloud and brings it back.

lnk agent move --cloud aws                  # your only agent, to your box in aws, a new one if you have none
lnk agent move --cloud gcp-1 --agent work   # one of several, to your box gcp-1, from wherever it runs
lnk agent move --here --agent work    # and back
lnk agent move --cloud aws --agent work --image web-ready   # to a new box in aws from your image, set up already

What you need

You need a cloud account connected with lnk box, and the box costs what your cloud charges. Services covers where an agent can run.

Which box

A cloud account's name moves the agent to your one box there. With no box there, move makes one for you, as lnk box create does. With several, it lists them and you name the one you want. Run move on this computer, wherever the agent is.

What goes with it

The agent's memory, conversations, files, settings and connections go with it. So do its keys (its model's, its fallback's and its connections'), sealed to the machine it goes to, and this computer notes each box they went to, for lnk secret delete (Secrets). The harness is installed fresh where it lands.

Once it answers there

Once the agent answers there, the machine it left deletes its copy and keeps its files for 30 days. If it doesn't answer, the old machine keeps its copy, stopped.

From your image, with its buckets

A move with --image starts a new box from your image, even where you already have a box. The agent's buckets go with it, so lnk agent backup works there.

Chat with it there

On a box, it answers lnk agent chat send from this computer too: the chat goes there through lnk box run, and its link conversations came with it.

Keep it answering while it moves

A move goes in two phases, and your agent answers throughout.

The copy

Its files and its memory's index go to where it's going while it runs as before, and to a box or this computer what its harness knows too. The move shows how many files and bytes it has copied.

The switch

The agent pauses: its connections stop reading, and it finishes the turn it's in, for a minute at most. What changed since the copy goes, with its settings, connections, scheduled jobs and the day's count, and it starts where it went. The move says how long the switch took, a few seconds however long its history.

Through each place's storage

Conversations, their tool restrictions and memory's notes move through each place's storage contract. The receiving machine uses its supported places, leaving the agent's storage preferences in its spec for its next move. Home is streamed with bounded buffers, including a large individual file.

A message during the switch

A message sent during the switch, on a connection Link carries for it, waits on that connection, and the agent answers it where it went; a harness that reads a connection itself takes what comes there as it always does.

A move that fails

A move that fails, is stopped (Ctrl-C, or its terminal closed) or ends with the agent not answering where it went leaves it answering where it was, nothing of it where it was going, and says it failed. One move of an agent runs at a time.

A move cut off

A move cut off before it could say so (lnk killed, this computer off or asleep too long) is finished or taken back by the next lnk agent move or lnk agent start of the agent on this computer: finished when the agent answers where it went, else taken back, its copy there removed.

A box that stops answering

Its copy on a box that stopped answering is removed once the box answers again; while the agent may have started on a box that doesn't answer, it stays stopped here, so it never answers in both, and on a box that's gone it answers here.

A move tried again

A copy tried again sends only what's missing, and a move back to a machine the agent left in the last 30 days sends only what changed since.

Move it to a cloud that hosts agents

A cloud account whose adapter hosts agents runs your agent itself, with no box of yours.

lnk agent move --cloud host                 # to your cloud account host, which hosts agents
lnk agent move --here --agent main    # and back, every file the same
lnk bucket push ~/Link/Agents/main/Home/taxes   # add files to its Home there
lnk bucket pull ~/Link/Agents/main/Home         # bring its Home down
lnk agent backup --agent main       # backed up there, where it runs
lnk agent restore main              # back to that backup, there
lnk agent chat send --agent main         # talk to it there

Its two phases there

The move goes in the same two phases, through the account's adapter. The cloud may refuse a move, and the move then says why and when the next one is allowed. lnk agent list shows the agents each such account hosts.

Its Home there

While your agent is there, its Home is there too, and lnk bucket push and pull reach it through the same adapter, sending only what's new.

Messages while it was paused

Messages that came while it was paused there are handed to it where it went, only from those its connection is paired with: kept with its settings, only yours to read, until it's given each one, so one moved with --no-start is answered when it starts. One it's never given there (a connection Link doesn't carry for it) is shown to you whole, in the move or in lnk agent deliver.

Its backups there

lnk agent backup and restore of it are the account's to keep, where it runs: it's backed up without stopping, and a restore keeps its conversations. An account that keeps no backups says so, and lnk agent backup backs it up once it's back here.

Chat with it there too

lnk agent chat send --agent main talks to it there, through the same adapter, on the same link threads, its answer shown as it comes. An answer nobody waited for there (one you stopped waiting for) stays in its conversation there, and isn't handed to your next chat; an account whose adapter doesn't carry chats says so.

Its adapter

Adding a cloud lists what such an adapter answers, and Accounts That Host Agents each command.

Choose where its traffic leaves from

On a box, your agent can reach the internet from this computer's address instead of the box's.

lnk agent exit --here       # from the address of this computer, over SSH
lnk agent exit --direct     # from the box it runs on

exit --here

By default your agent reaches the internet from the box's address, and exit --here makes sites see this computer's address instead. This computer then keeps an SSH link to the box open through the exit plugin, and stays awake. With this computer off or offline, your agent on the box has no internet at all, and it never falls back to the box's address. lnk exit list shows whether each exit is up.

It moves with the agent

The setting belongs to the agent and moves with it. On this computer, traffic leaves from here either way.

Run more than one agent

Run as many agents as you like, each with its own settings, files, harness, ports and bot.

lnk agent create work                     # Link Harness by default
lnk agent create scout --harness hermes   # a member of a team, by its purpose
lnk agent create writer --on aws-1        # on one of your boxes
lnk agent list                            # every agent, here and on the boxes this computer knows
lnk agent list --refresh                  # and on boxes made on your other computers
lnk agent connect telegram --agent work   # --agent picks the agent

Kept apart

The sandbox keeps each agent out of the others' folders. With one agent, commands act on it, and with several you pass --agent <name>. The first agent is main. Each agent has its own grants (Choose what your agent can reach), and agents on one harness share only what that harness needs.

Back up your agent

Back up your agent's files, and what its harness knows, to your own clouds.

lnk agent backup                     # its files, and what its harness knows
lnk agent restore                    # go back to what it knew at the last backup
lnk agent restore --agent work --yes   # without asking first

What you need

You need buckets in your clouds (Buckets); without the bucket plugin, backup and restore install it first, and with no cloud yet, backup asks where to make one.

What it keeps

backup stops the agent, then copies its files folder and its harness's memory, conversations and skills to its buckets. Keys are never backed up, and only the latest backup is kept.

A restore

restore of an agent that's here replaces what its harness knows with the last backup, which helps when its memory went wrong. Its files, settings and keys stay.

Bring back an agent whose machine is gone

Bring back an agent from its bucket after its box was removed or its computer lost.

lnk agent restore work                    # finds its bucket in your cloud accounts
lnk agent connect telegram --agent work   # its bot, again

How it finds it

Link finds the bucket in your lnk cloud accounts, asks for the encryption password shown when the bucket was made, and starts the same agent with its files and memory. It asks again for the model key and the connections' tokens, which are never in a bucket. Only buckets in AWS and Google Cloud are found.

Move a team to a cloud that hosts agents

A cloud that hosts teams can move a team and its shared folder together:

lnk agent team move design --cloud my-cloud
lnk agent team move design@my-cloud --here

Its copy and switch

Run the first command on the machine holding all the team's own members. The copy runs while they answer. The switch pauses every member, prepares each member and the shared folder, then activates the complete team. A failed preparation leaves the source authoritative.

One member alone

A cloud may refuse an individual member's move while it shares a team's folder; its refusal names the team and the whole-team command.

Coming to a machine

A team coming to a machine must contain only that account's agents. Remove outside members first. The receiving machine chooses its own shared-folder path under ~/Link/Teams/<team>/; it never trusts a remote absolute path.

Its folder there

lnk bucket push and lnk bucket pull reach a hosted team's folder through its hosting adapter, using its local ~/Link/Teams/<team>/Shared folder. The cloud keeps a folder backup with lnk agent team backup design --cloud my-cloud and restores it with lnk agent team restore design --cloud my-cloud.

Who reads its files

Anyone who can talk to a member can receive the shared files it reads; an outside member's owner can read those conversations.

More about it

When a move doesn't go as it should, or an agent on a box has no internet, see Troubleshooting.

Docs

  • Troubleshooting: What to do when a move doesn't go as it should, or your agent on a box has no internet (Move Machines)