The ward commands you'll use most, the ward.json file, how agent runs are limited, the word list and exit codes.
Commands
ward help lists every command, and ward help <command> explains one.
| Command | What it does |
|---|---|
ward login --web |
Sign in by approving a code in the console. |
ward init <project> |
Link this folder to a project. Writes ward.json. |
ward check |
Find passwords and keys written into your code. Never prints a value. |
ward templates |
List the rules you can get a key from. |
ward run --lease VAR=RULE -- <cmd> |
Run a command with a key in $VAR, revoked when it exits. |
ward leases |
List keys that haven't expired. |
ward revoke <id> |
Revoke a key. |
ward connector enrol <service> [--replicas N] |
Get setup tokens for a connector, one per replica. |
ward agent run --policy <name> -- <cmd> |
Run an AI agent with its own temporary identity. |
ward agent ls, ward agent end <id> |
See running agents, and stop one with every key it holds. |
ward audit [--since 1h] [--csv] |
Read the audit log, or export it as CSV. |
ward.json
ward init writes this file at the root of your project. It holds no secrets, so commit it. List keys under leases and every ward run in this folder gets them.
ward.json
{
"project": "shop",
"environment": "dev",
"leases": {
"DATABASE_URL": "orders-read",
"REDIS_URL": "cart-cache-read"
}
}Agent runs & policies
An agent started with ward agent run gets less room than a person:
- Its own identity. Each run is a new identity that ends with the run, so the audit log tells runs apart.
- Never more than you. An agent can't get a key the person who started it couldn't get.
- No agents starting agents. An agent can't start another agent.
- Keys end with the run. A key never outlasts the agent's session. Ending the agent revokes its keys.
- Secrets only where named. An agent reads secrets only in the projects its policy names.
An admin writes the policy that says which rules an agent may use:
ward agent policy create analyst --templates orders-read --projects shop --max-ttl 1hOn Linux, ward agent run also hides your saved sign-in from the agent. Elsewhere, run the agent in a container or as another user.
Word list
The docs and console use plain words. The CLI and API keep their older names.
| In the docs | In the CLI and API | Meaning |
|---|---|---|
| key | lease |
A temporary login made for one program or run. |
| rule | template |
What a key allows and how long it may last. |
| service | provider |
A database or API that keys are made for. |
| connector | connector |
The small service in your network that holds the admin login and makes keys. |
| agent run | agent session |
One AI agent run, with its own temporary identity. |
| audit log | audit_event |
The record of every request, refusal and revocation. |
Exit codes
| Code | Meaning |
|---|---|
0 |
It worked. For ward check, nothing was found. |
1 |
It failed: not found, refused, a network error. ward check found credentials. |
2 |
A usage error: an unknown command or flag, or a missing argument. |
4 |
You're not signed in, or your sign-in was refused. |
130 |
You answered no, or cancelled. |
125 to 127 |
ward run couldn't start the command. Otherwise ward run exits with the command's own status. |