Register an agent
Create an agent key and give it a policy on your wallet.
1. Create the key on the agent's machine
npx @kryptwarden/sdk keygen --out .env.agentThis writes KW_AGENT_SECRET_KEY=S… (and the public key) to .env.agent with file mode 0600, and prints the public G… key. The secret never needs to leave that machine, and the key needs no XLM.
Add .env.agent to .gitignore. Anyone with the secret can spend up to this agent's limits until you revoke it.
The dashboard's Register Agent page can also generate a key in your browser. That's handy for a demo, but generating it where the agent runs is safer.
2. Register it with a policy
In the dashboard, open Register Agent, paste the G… key and choose:
| Field | Meaning |
|---|---|
| Agent name, purpose | Labels for the dashboard. Stored by the indexer, not on-chain |
| Daily budget | Hard cap per UTC day, including open holds |
| Auto-approve up to | Payments at or under this settle without asking. 0 sends everything to you |
| Key expires after | Days until the key stops working |
| Hold timeout | Minutes a hold waits for you before it's denied |
| Allowed sellers | Who the agent may pay. The three demo sellers are listed; add any other G… address |
Signing calls register_agent(agent_key, policy) on your wallet. See Policies for the exact rules.
Change or stop an agent later
From Agents, select an agent:
| Action | Contract call | Effect |
|---|---|---|
| Edit policy | update_policy | New limits apply to the next payment. Bumps policy_version |
| Pause | pause_agent | Stops payments, keeps everything else |
| Resume | resume_agent | Back to Active |
| Revoke | revoke_agent | Permanent. Cancels its open holds |
Check it from the terminal
npx @kryptwarden/sdk inspect --wallet C... --agent G...This reads the live policy, today's spend, reserved holds and remaining budget straight from the contract.