You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rust/haiai/docs/knowledge/haiai-guides/agents.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ If you add a tool to MCP but not CLI (or vice versa), you must add it to the app
130
130
Each SDK pins a published JACS version for CI/release, but supports local path overrides for development:
131
131
132
132
-**Node:**`npm run deps:local` switches `@hai.ai/jacs` to `file:../../JACS/jacsnpm`. Use `npm run deps:prod` to switch back. The committed `package.json` must always use the published version.
133
-
-**Rust:** Uncomment the `[patch.crates-io]` block in `rust/Cargo.toml` to build against `../../JACS/`. Must be commented out before publish.
133
+
-**Rust:** Uncomment the `[patch.crates-io]` block in `rust/Cargo.toml` to build against `../../JACS/`. Must be commented out before publish. Building with the patch block (even temporarily) adds `[[patch.unused]]` entries to `rust/Cargo.lock` — the git clean filter in `.gitattributes` strips these automatically on staging. **First-time setup:** run `git config filter.clean-cargo-lock.clean 'sed "/^\[\[patch\.unused\]\]/,/^$/d"'` and `git config filter.clean-cargo-lock.smudge cat` to activate the filter.
134
134
-**Python:** Pin in `pyproject.toml` (`jacs==X.Y.Z`). For local dev, use `pip install -e ../../JACS/jacspy` (or equivalent) to shadow the published version.
135
135
136
136
`make check-jacs-versions` verifies all SDKs agree on the published JACS version.
Copy file name to clipboardExpand all lines: rust/haiai/docs/knowledge/haiai-sdk/root.md
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,29 +21,37 @@ brew install haiai
21
21
cargo install haiai-cli
22
22
```
23
23
24
-
This gives you the `haiai` binary — CLI and MCP server in one.
25
-
26
-
## Quickstart
24
+
### Shell script
27
25
28
-
### 1. Create an agent identity
26
+
No package manager? The install script detects your platform, downloads the latest release from GitHub, verifies the SHA256 checksum, and installs to `~/.haiai/bin`. Handles upgrades and downgrades.
29
27
30
28
```bash
31
-
export JACS_PRIVATE_KEY_PASSWORD='your-password'
29
+
curl -fsSL https://raw.githubusercontent.com/HumanAssisted/haiai/main/install.sh | sh
30
+
```
32
31
33
-
haiai init \
34
-
--name my-agent \
35
-
--domain example.com
32
+
Pin a version or change the install directory:
33
+
34
+
```bash
35
+
curl -fsSL https://raw.githubusercontent.com/HumanAssisted/haiai/main/install.sh | sh -s -- --version 0.2.1
36
+
curl -fsSL https://raw.githubusercontent.com/HumanAssisted/haiai/main/install.sh | sh -s -- --dir /usr/local/bin
36
37
```
37
38
38
-
This generates a JACS keypair and config. No separate install needed.
39
+
Works on macOS (Intel & Apple Silicon) and Linux (x64 & ARM64).
39
40
40
-
### 2. Register and get your email address
41
+
This gives you the `haiai` binary — CLI and MCP server in one.
Get your registration key from the [dashboard](https://hai.ai/dashboard) after reserving your username. Your agent now has the address `myagent@hai.ai`.
53
+
This generates a JACS keypair, registers with HAI, and assigns `myagent@hai.ai`.
54
+
Get your registration key from the [dashboard](https://hai.ai/dashboard) after reserving a username.
47
55
48
56
### 3. Send and receive email
49
57
@@ -80,7 +88,7 @@ Your AI agent now has access to all HAI tools — identity, email, signing, and
Native SDKs for Python, Node.js, and Go are available on npm, pypi, and here but are **pre-alpha** — APIs may change. The MCP server is the recommended integration path.
119
+
Native SDKs for Python, Node.js, and Go are available on npm, pypi, and here and are in **beta** — APIs may change. The MCP server is the recommended integration path.
Copy file name to clipboardExpand all lines: rust/haiai/docs/knowledge/jacsbook/advanced/key-rotation.md
+71-7Lines changed: 71 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,24 +136,88 @@ This signed message:
136
136
- Provides an audit trail
137
137
- Binds old and new keys together cryptographically
138
138
139
-
### CLI Commands (Planned)
140
-
141
-
> **Note**: These CLI commands are planned for a future release. Currently, key rotation must be performed programmatically using the Rust API.
139
+
### CLI Commands
142
140
143
141
```bash
144
-
# Rotate keys with default algorithm (Coming Soon)
142
+
# Rotate keys with default algorithm
145
143
jacs agent rotate-keys
146
144
147
-
# Rotate to post-quantum algorithm (Coming Soon)
145
+
# Rotate to post-quantum algorithm
148
146
jacs agent rotate-keys --algorithm pq2025
149
147
150
-
# List key history (Coming Soon)
151
-
jacs agent keys list
148
+
# List key history (active and archived keys)
149
+
jacs agent keys-list
150
+
151
+
# Repair config after a crash during rotation
152
+
jacs agent repair
152
153
153
154
# Revoke a compromised key (Coming Soon)
154
155
jacs agent keys revoke <key-hash>
155
156
```
156
157
158
+
### Transition Signature
159
+
160
+
During key rotation, JACS produces a cryptographic transition proof that binds the old key to the new key. This proof is embedded in the agent document as `jacsKeyRotationProof`:
The transition message is signed with the **old** private key before it is archived. This proves:
176
+
- The rotation was authorized by the holder of the previous key
177
+
- The old and new keys are cryptographically linked
178
+
- An attacker cannot forge a rotation without the old private key
179
+
180
+
You can verify a transition proof programmatically using `Agent::verify_transition_proof()`.
181
+
182
+
### Crash Recovery
183
+
184
+
JACS uses a write-ahead journal to recover from crashes during key rotation. Before rotation begins, a journal file is written to `{key_directory}/.jacs_rotation_journal.json`. The journal tracks the rotation stage:
185
+
186
+
1.`started` - Rotation initiated
187
+
2.`keys_rotated` - New keys generated, old keys archived
188
+
3.`agent_saved` - New agent version saved to disk
189
+
4.`config_signed` - Config re-signed with new key (journal deleted on success)
190
+
191
+
If the process crashes mid-rotation, the next agent load detects the journal and automatically repairs the config by re-signing it with the current key. No manual intervention is required for the common case.
192
+
193
+
For manual recovery: `jacs agent repair`
194
+
195
+
### Cross-Algorithm Rotation
196
+
197
+
You can change the signing algorithm during rotation:
const result =awaitclient.rotateKeys({ algorithm: 'pq2025' });
217
+
```
218
+
219
+
After cross-algorithm rotation, the config file's `jacs_agent_key_algorithm` field is updated atomically. Documents signed before the rotation remain verifiable using the archived old key.
0 commit comments