Set up Loxmith

Your coding agent sets Loxmith up for you. Signing in and anything that gives access stay with you.

With your coding agent

Open Claude Code, Codex or any agent that works in your terminal, in your project's folder, and paste this:

Set up Loxmith in this project. Follow the agent steps at
https://loxmith.dev/docs/setup#agent-steps.
Never ask me for a password, token or key, and never print one.

Your agent finds the passwords and keys written into your project, swaps each one it can for a temporary key, and changes how your app starts. It stops and asks you for two things:

  • Signing in. You run ward login --web yourself. Loxmith won't let an agent sign in as you.
  • Anything that gives access, like a new rule or connector. You approve it in the console.

Agent steps

For the agent. Run each command from the project's folder.

  1. Run ward status. If it says you are not signed in, ask the person to run ward login --web in their own terminal, then wait. Don't try to sign in yourself.
  2. Ask the person which Loxmith project this folder belongs to, then run ward init <project> --no-import. It writes ward.json, which holds no secrets.
  3. Run ward check --json to find hard-coded passwords and keys. It never prints a value.
  4. Run ward templates --json to see the rules this person can use.
  5. For each finding a rule covers, add it to ward.json under leases, for example "DATABASE_URL": "orders-read", and remove the hard-coded value from the code and from .env. Ask before deleting a file.
  6. Change the project's start and test commands to run through ward run --, for example ward run -- npm start. Each lease goes into its variable and ends when the command exits.
  7. Run the tests through ward run, then run ward check again. It exits 0 when nothing is left.
  8. For a finding no rule covers, don't make a rule. Tell the person which one it is: an admin can add a rule, and it waits for their approval in the console.
  9. Finish with a short summary: what moved, what is left, and that next time they can start you with ward agent run --policy <policy> -- <command> so you run with your own temporary keys.

Never ask for, print or write down a credential, never use --show-secrets, and never run ward login.

By hand

The same setup, one command at a time.

1. Sign in

Point the ward CLI at your Loxmith server, then approve the code it shows in the console.

export WARD_URL=https://your-loxmith-server
ward login --web
ward init shop --no-import

3. Find hard-coded passwords and keys

ward check

4. See the rules you can use

ward templates

5. Swap a password for a temporary key

List the key in ward.json, take the password out of your code and .env, and start your app through ward run.

ward.json
{
  "project": "shop",
  "environment": "dev",
  "leases": { "DATABASE_URL": "orders-read" }
}
ward run -- npm start

6. Give your agent its own keys

ward agent run --policy analyst -- claude

7. Take a key back

ward leases
ward revoke 8fde951c