Install guide · ~10 minutes

Put the doorman on your machine in one command.

KnowMyAgents runs locally, next to your agents, from prebuilt images — no source code, no compilers, nothing added to your agents. This guide covers everything: what you need, what the installer does, approving the machine, routing your first program, what you'll see, updating, backup, uninstall, and what to do when something doesn't work.

1What gets installed

A small, self-contained stack on your machine, started by Docker with one command. Together it's "the doorman":

The gateway

The single door your agents call through. Listens only on this machine by default.

The engine

Checks every call against your rules and charters, meters usage, and enforces.

The audit log

A tamper-evident, hash-chained record of every call — kept on this machine.

The passport issuer

Mints verifiable identities (passports) for your agents. Keys never leave the machine.

The Local Viewer

Your own window into the full record — request and reply detail the hosted console never sees.

A local database

Holds the log and credential records in a named Docker volume, so it survives restarts.

Your agents are not modified. You point a program at the gateway (Section 6) and its calls flow through KMA. That's the whole integration.

2Before you start

Docker, installed and running

Windows / macOS: Docker Desktop. Linux: Docker Engine with the Compose plugin. The installer checks and tells you if either is missing or too old. Get Docker →

A console account

Free, self-serve. Sign up with Google, GitHub, or your work email. If a colleague already set up your organisation, ask them for an invitation instead.

A registration token

In the console: Settings → Registration tokens → Mint. It's shown once and used once. It's the only value the installer asks you for — it looks up your organisation from the token.

You start in watch-only mode: install, see your agents and where they go, block nothing. Enforcement is switched on later, when you decide.

3Install — one command

Open a terminal and paste the line for your system. Pick the tab that matches.

PS> irm https://knowmyagents.com/install.ps1 | iex

It asks two things: where to install (press Enter for the default, ~/kma — or type a folder like C:\kma) and your registration token. Then it does the rest. First run pulls the images, so give it a few minutes on a slow connection.

Already installed? Run the same command again. It notices KMA is there and updates it instead — your secrets, registration, audit log and passports are kept. See Updating.

4What the installer does, step by step

Nothing hidden. In order:

  1. Checks Docker is installed, running, and new enough (needs docker compose). Stops with a clear message if not.
  2. Asks where to install. Default ~/kma (%USERPROFILE%\kma on Windows). Enter accepts the default. Scripted installs set KMA_DIR instead and are never prompted.
  3. Detects an existing install in that folder and switches to update mode (keeps everything). Set KMA_FRESH=1 to force a brand-new install with a new machine identity.
  4. Probes four local ports (viewer, log, passport, gateway). If one is already taken, KMA quietly moves to the next free one, tells you, and records it in .env. You can also choose your own with KMA_<NAME>_PORT (e.g. KMA_VIEWER_PORT).
  5. Asks for your registration token and looks up your organisation from it (a read-only lookup — the token isn't consumed until the kit actually enrols).
  6. Downloads the kit into the folder: the Compose file, the enrollment script, and the helper scripts for update, backup and restore, plus the kit's own INSTALL.md.
  7. Generates your machine's local secrets (admin tokens, wallet key) and writes .env. These are made on your machine and never leave it.
  8. Starts the stack (docker compose up -d --wait) and enrols the machine with your console using the token. Your machine creates its own key pair; only the public half is registered.
  9. Skips the optional sensors (things that run beside the gateway rather than through it, such as coding-assistant hooks). They are installed only when you ask for them with KMA_SENSORS=1.

The installer is a plain script you can read: install.ps1 · install.sh. Everything it writes lives in the folder you chose.

5Approve the machine

After enrolment the machine appears in your console as pending. Open console.knowmyagents.com → Settings → Registrations (or the Add a machine page) and approve it.

This is deliberate — the second lock. A registration token alone can never attach a machine to your organisation; a person has to say yes. Until you approve, the kit still runs fully on the machine (it observes and enforces locally) — it just doesn't report to the console yet.

6Route your first program through the gateway

Now point an agent program at the gateway so its calls go through KMA. Nothing inside the program changes.

  1. In the console open Programs → Add a program.
  2. Tell it how your program runs (a command on this machine, a container, or a deployment). KMA hands you the exact thing to use: an overlay or a command that starts your program through the gateway.
  3. Start your program that way. From its first call, KMA sees it.

Under the hood the program's outbound calls are routed via the local gateway, and — if you switch on "inside the call" for its doors — the program trusts KMA's local certificate so KMA can read the call and identify which agent made it. The console's Add a program page gives you the precise, copy-paste form for your setup; that page is the source of truth, so this guide doesn't hardcode addresses.

Agents on other machines or in Kubernetes? By default the gateway listens only on this machine (loopback). For a cluster or a VM, set KMA_GATEWAY_BIND in .env to 0.0.0.0 or this machine's private IP — only on a private network behind a firewall, because whoever can reach the door can call through it. The console's Add a program page includes a Kubernetes patch.

7What you'll see

Doors discover themselves

The places your program reaches appear on the Doors page on their own. Approve or refuse each one — no allow-lists to maintain.

Shadow Agents

Every unidentified caller KMA sees, surfaced the moment it makes a call — before it has a passport.

Live activity

Each call, with its decision ("would allow" / "would refuse" in watch-only mode) and the reason.

The Local Viewer

Open http://localhost:8085 on this machine (or the port the installer told you). It shows the full record — detail that stays here and is never synced.

8Next steps in the console

  1. Issue passports. Give each Shadow Agent a verifiable identity from the Identity page. Shadow becomes identified.
  2. Write rules. On Policies, write a rule in plain words and let KMA draft it — "only agents with a passport may call", a daily spend cap, per-door allow or refuse.
  3. Write a charter — a plain-English conduct rule (e.g. "never trade defense-sector stocks"), judged for intent by an AI judge on every call it covers. Set your AI provider key and judge model in Settings → AI assistant first.
  4. Watch, then enforce. On Doors, keep the mode on observe until the "would allow / would refuse" decisions look right, then flip to enforce. Set "Sees" to inside the call to identify agents and enable charters.
Open the console →

9Updating

Re-run the install one-liner from Section 3. It detects the existing install and updates it to the latest kit — your secrets, registration, audit log and passports are kept. It works from any older version.

Or run the updater directly from your kit folder:

PS> .\update.ps1 # Windows — latest kit $ ./update.sh # macOS / Linux $ ./update.sh 0.9.8 # pin a specific version

The updater backs up the previous Compose file, fetches the new kit files, pulls the new images and restarts the stack. It never runs docker compose down -v, so your data can't be lost by an update.

10Backup & restore

Your kit folder contains backup.ps1 / backup.sh and restore.ps1 / restore.sh. Back up before major changes and on a schedule that matches how much history you're willing to lose:

PS> .\backup.ps1 # Windows $ ./backup.sh # macOS / Linux — hot backup, stack keeps running $ ./backup.sh --pause # pause the database briefly for a fully consistent snapshot $ ./backup.sh --out /some/dir # write the archive somewhere else

One timestamped archive captures all three data volumes — the audit log database, your machine's private key and configuration, and the passport issuer's signing key — plus your agents' passports from the kit folder (from kit 0.9.11; older backups restore without them and the agents need re-issuing). It's a raw copy, so the log's hash chain still verifies after a restore.

The archive contains private keys. Store it somewhere secure and off this machine.

Restore on a fresh machine (or to roll back) with ./restore.sh <archive> / .\restore.ps1 <archive>. Restore is destructive — it overwrites the current keys and log with the archive's, and asks you to confirm.

11Uninstall or start fresh

You wantRun in your kit folderWhat happens
Stop KMA, keep everythingdocker compose downContainers stop. Data, keys and registration remain. docker compose up -d brings it back.
Remove KMA completelydocker compose down -v, then delete the folderRemoves containers and volumes: the audit log, keys and machine identity are gone. Back up first if you want the record.
Start over with a new identityRe-run the installer with KMA_FRESH=1Fresh install; the machine gets a new identity and must be approved again in the console.

Also revoke the old machine in the console (Settings → Registrations) so a removed machine can't reappear as trusted.

12Advanced options

All are environment variables set before running the installer.

VariablePurpose
KMA_DIRInstall folder (skips the prompt). Default ~/kma.
KMA_TOKEN, KMA_TENANTPreset the token (and organisation id) for a fully non-interactive install, e.g. in a script or CI.
KMA_VERSIONInstall or pin a specific kit version instead of the latest.
KMA_FRESH=1Force a fresh install over an existing one (new machine identity).
KMA_VIEWER_PORT, KMA_LOG_PORT, KMA_PASSPORT_PORT, KMA_GATEWAY_PORTChoose your own local ports instead of the defaults / auto-moved ones.
KMA_GATEWAY_BINDMake the gateway reachable from other machines (private network only). Default: this machine only.
MACHINE_NAME, LEGAL_NAMEThe name this machine registers under; your organisation's legal name on passports.
KMA_SENSORS=1Also install the optional local sensors (skipped unless set).

Prefer a fully manual install on a locked-down box? The kit is just a folder with a Compose file and a .env. The same steps by hand are in the kit's own guide: INSTALL.md.

13What leaves your machine — and what doesn't

Stays on this machineYour full audit record
  • Every request and reply, in full detail
  • Your machine's keys and the passport keys
  • Your local secrets and configuration
Synced to the hosted consoleMetadata only
  • Which agent called, which door
  • Allowed or refused, and why
  • Usage and cost
  • Never the content of a call

The hosted console is a window, not the doorman. Enforcement never depends on it — if the console goes dark, your gateway keeps working. The full record is always available to you in the Local Viewer, on your machine.

14Troubleshooting

The install command fails with "The underlying connection was closed", "connection forcibly closed by the remote host", or an SSL error

The download to your machine is being cut off before it finishes. The site is fine; something between your machine and it is interfering. In order of likelihood:

  1. Old TLS on Windows PowerShell 5. Force modern TLS first, in the same window, then re-run:
    PS> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 PS> irm https://knowmyagents.com/install.ps1 | iex
    Or use PowerShell 7 (pwsh), which does this by default.
  2. Antivirus / endpoint security or a VPN inspecting HTTPS and resetting the stream. Pause it for the install, or try from a phone hotspot to confirm.
  3. An unstable connection. Try again, or download the script in a browser (install.ps1 / install.sh), save it, and run it locally — the browser uses a different network path.
"Docker isn't installed" / "Docker is installed but not running" / "Your Docker is too old"

Install Docker Desktop (Windows/macOS) or Docker Engine + the Compose plugin (Linux), make sure it's started (the whale icon is up), and re-run. KMA needs the modern docker compose command (not the old docker-compose).

"port … is taken — … moves to …"

Not an error. Something on your machine already uses one of KMA's default ports, so KMA picked the next free one and saved it in .env. The message tells you which container or program had it. To choose your own, preset KMA_<NAME>_PORT before installing.

"Couldn't read your organization from that token"

The token is wrong, expired, or already used. Tokens are shown once and are single-use. Mint a fresh one in the console (Settings → Registration tokens → Mint) and paste it exactly.

The machine shows as "pending" in the console

Expected — approve it (Section 5). Until then the kit runs fully on your machine but doesn't report to the console.

The machine is approved but nothing appears in the console

Check three things: (1) the stack is healthy — in your kit folder run docker compose ps; everything should be "healthy" or "running"; (2) the engine can reach the console — docker compose logs kma-engine should say sync is active, not disabled; (3) something is actually calling through the gateway — the console only shows calls that go through KMA, so make sure your program is started the way Add a program told you (Section 6).

My program runs, but I see no doors or agents

Its calls aren't going through the gateway. Start it via the overlay/command from the console's Add a program page rather than directly. If you changed KMA's install (fresh reinstall), restart the program too, so it reconnects to the new gateway and trusts the new local certificate.

I see doors but agents are "unidentified" / no names

KMA can see where a call went but not who made it until it can look inside the call. On the Doors page set "Sees" to inside the call (your programs trust KMA's local certificate for this), then issue passports. Charters also need this.

Where are the logs?

In your kit folder: docker compose logs (all services) or docker compose logs kma-engine, kma-gateway, kma-log, kma-passport, kma-viewer for one. Add -f to follow.

Something else

Write to hello@primethoughts.com with your OS, the exact command you ran, and the last ~20 lines of output. We answer quickly.

KnowMyAgents — Identity & Governance for your AI Agents. knowmyagents.com · console · kit INSTALL.md