Agent Files

Every file lnk agent keeps for an agent, its harness and its moves, and what each one holds (Configuration).

Settings and grants

What you chose for the agent, what you granted it and its harness, and what a start remembers of the last one. ~/.lnk/agents/<name>/ (700) holds its log, its foreground lock and its proxy's sockets.

~/Link/Agents/<name>/Config/agent.toml (600)

An agent's setup and [behavior] in one editable file (Configuration). Commands save choices here, and no agent sandbox reaches it. This machine's agent is main. A missing file is recreated with default configuration.

~/Link/Agents/<name>/Config/sandbox.toml (600)

What you grant the agent, whichever harness runs it (Configuration). Missing files are recreated with closed permissions. Permission loading stays closed independently of whether recreation succeeds.

~/.lnk/agents/<name>/identity.json (600)

The stable agent ID and owner retained by configuration saves, so deleting editable configuration does not create a new identity. This runtime record holds no credentials and is inaccessible to the agent's sandbox.

~/.lnk/harnesses/<harness>.toml (600)

What a harness said it needs here and you allowed, for every agent that runs it (Configuration).

~/.lnk/agent-defaults.toml (600)

The proxy upstream each new agent here starts with (lnk agent route --default).

~/.lnk/agent/hosts.toml (600)

Whether each cloud account hosts agents, as its adapter answered agent-host once, with the kind and identity it was asked as: lnk agent list asks only those that do, and an account connected again as another is asked again.

~/.lnk/agents/<name>/ports.json

The harness's ports at its last start, which lnk agent status shows for the agent.

<harness home>/.lnk/configured and the rest

A hash of the settings, versions and files the last configure left, so a start with nothing changed skips it; delete it to configure again. What else a harness from outside Link keeps in its home, its repository's README says.

Keys, bridges and sockets

How the agent's bridge reaches it and proves who calls, and what a shared bridge or harness keeps.

~/.lnk/agents/<name>/way-in.sock (600)

The bridge's way in: messages for the agent from its schedules and subagents, each proved as the agent that hands it.

~/.lnk/agents/.keys/<id>.json (600)

The keyring: each running agent's identity and its key for this start, which every bridge checks a call's proof against; removed at its stop.

~/.lnk/agents/.net/<id>/ (700)

url.secret (600) is the agent's proxy secret, in its tool and local model URLs, by the agent's ID. <harness> is sockets between the harness's network and its proxy; <harness>-<step> for a setup step's (install, configure, ...), and <harness>-health for the health check's relay to the harness's ports.

~/.lnk/agents/<name>/bridge.json (600)

For a harness with an endpoint: its endpoint, key, proof, connections and storage plan. Made at each start and used by the agent bridge to carry the connections the harness delegates to Link.

~/.lnk/agents/<name>/bridge.log

The log of the connections Link carries, written by the agent's bridge as it carries them.

~/.lnk/agents/<name>/sleep.sock (600)

Where the bridge tells an agent started in a terminal to stop its program for being idle, or start it again ([run] idle_after).

~/Link/Agents/.bridge/ (700)

The bridge every agent here shares where shared_bridge is on: whom it carries (agents/<id>.json, written at each start, removed at each stop), each time zone's scheduler runner's agents (runners/), the agents asleep for being idle (asleep/<id>), and bridges.log.

~/Link/Agents/.harness/<owner>/ (700)

The harness an owner's agents share where shared_harness is on, and its HOME: what each agent is served with (agents/<id>.json), the agents' file it's started with, configure.lock, held by a start while it configures and joins, and shared.log.

~/.lnk/agents/<name>/hooks-seen.json (600)

The id of each post its webhooks took, kept 30 days, so a repeat is refused. Written whole by the bridge, never through a link.

Storage and context

The agent's storage bridges, and what a harness keeps of the context it was given.

The agent's storage bridge, for a harness that keeps Link's collections with a restricted folder layout: each call answered by the driver of the place its collection is kept at here (lnk-sqlite, lnk-bucket), run outside the sandbox. Legacy adapters reach it directly.

~/Link/Agents/.memory/<owner>/bridges/<agent>/storage.sock

The same storage bridge, for the agent's memory: alone in its folder, which memory's sandbox reads and every agent's sandbox hides, its calls proved with the agent's key. Besides what the agent's sandbox writes, it changes only its memory collection and, where its notes are written, memory/notes.md.

<harness's home>/.lnk/agent-context/binding.json (600)

A host-supplied native-hook binding: its storage socket and adapter name. A host that supplies one regenerates it for each binding and excludes it from move state; an adapter has no storage opt-in.

<harness's home>/.lnk/agent-context/ (700)

Adapter-owned finite cursors, native-memory export digests/versions and a serialized hook-client lock. Retained across restart and declared by native adapters as state.

captures/

It keeps private pending record batches until storage confirms them, at most 1,024 batches and 64 MiB.

<harness's home>/.lnk/agent-context/client

A sandbox-local copy of the adapter executable used by native hooks. Regenerated by configure.

<host-selected protected directory>/authority.json (600)

The explicit host-only session/approval Ledger: versioned session mappings, active attempt/generation and durable tool decisions, at most 1 MiB. Its directory is private (700) and outside runtime mounts. No command or adapter creates it by default (Portable context).

~/Link/Agents/<name>/Harnesses/link/config.json (600)

Link Harness's model and endpoint key, read at each message; written at each start.

Memory and tools

What Link's tools keep for an agent, and what its background commands and answers leave.

~/Link/Agents/.memory/<owner>/ (700)

The memory service an owner's agents on this machine share, and its HOME: what each agent is served with (agents/<id>.json), its socket while it runs, and service.log.

generation.json

The generation those records make, with each record file's inode, time and size, so a session reads it alone while they're unchanged.

A bound embedding endpoint

Shared memory's bound embedding endpoint is unix:<path> when supplied as --embed-url. Each request proves the current agent binding; the receiver resolves its owner from that proof and its Unix peer. A bound endpoint over HTTP is refused (embedding credentials).

~/.lnk/sandbox/tools/memory-<id>.json (600)

Its memory, as a tool (lnk agent memory start), by the agent's ID. Defined again at a start only when something it's made from changed.

~/.lnk/agents/<name>/memory.json

What the memory tool was last defined from, so a start with nothing changed leaves it as it is.

~/.lnk/agents/<name>/run.json, file.json and code.json (600)

What its run, file and code tools were last defined from, there while each is defined.

~/Link/Agents/<name>/Run/

Its background commands' records (600), written by run and each one's supervisor, swept by its bridge; each kept [tool.run] background_keep once it ended and was told. started says when each of the last day's started (background_per_day).

<files folder>/background/<id>.out

A background command's output, both streams as one, its last [tool.run] background_output kept; read by the agent, written only by its supervisor.

~/.lnk/agents/<name>/owed/ (700)

Where an answer to a message from others goes (its chat, another conversation, or nowhere), kept by the bridge until it went, so an answer finished after a crash goes there too; a subagent's conversation's is kept for its own subagents' answers.

~/.lnk/agents/<name>/received/<id>.json (700, 600)

How many messages each teammate (by its ID) sent the agent today (UTC), one file each: the bridge takes no more from one a day than the agent's own [tool.scheduler] per_day, and a message the harness never took counts nothing.

Teams

What Link keeps for a team, and for its memory.

~/.lnk/teams/<team>.toml (600)

A team's file: its members, the folder they share, and the opinions they share (Team File), written by lnk agent team.

~/.lnk/teams/<team>.memory.json (600)

What the team's memory tool was last defined from, there while it's defined: while it's there, the team's memory is the tool team-<team id>-memory, and without it the team has none.

~/Link/Teams/<team>/ (700)

What Link keeps for a team: its shared folder (Shared) and its memory's index (Memory/<engine>).

Moves

What a move leaves behind, holds on its way, and copies aside.

~/.lnk/moved/<id>.toml (600)

A note left when an agent moved away: where to ([to] name, and hosted = true for a cloud account that hosts it, whose Home lnk bucket push and pull then reach, as lnk agent list --json --here says), and when.

~/Link/History/Agents/<name>-<date> (700)

A moved or removed agent's own folder and its Home, when it's its own, as Agent/ and Home/, kept 30 days, or as machine.toml's keep_moved says. Hidden from every sandbox. An older Link's ~/Link/Agents/.moved moves here at the first lnk agent command.

~/Link/Agents/.moving/<id>/ (700)

An arriving agent's copy and switch, by its ID, with move.json (its move, and when its copy came), before it's put in place; removed then, when its switch fails, or 7 days after a copy no switch came for.

~/Link/Agents/.sending/ (700)

Where a move copies a file over 8 MB, or memory's index, aside, unnamed, to hash and send it as it was hashed.

~/.lnk/agents/<name>/paused

The agent is paused for a move's switch: what carries its connections takes no message; paused.quiet beside it, once it stopped. A start removes both.

~/.lnk/agent/.spool/ (700)

Where a hosted Home's push or pull (lnk bucket push and pull) copies a large file aside to hash it, and unpacks a pull before it's put in place.