@embassys/ambassador 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +17 -7
  2. package/dist/agent-capabilities.d.ts +6 -0
  3. package/dist/agent-capabilities.js +61 -1
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/ambassador-options.d.ts +4 -0
  6. package/dist/ambassador-options.js +7 -1
  7. package/dist/ambassador-options.js.map +1 -1
  8. package/dist/central-enrollment.js +1 -5
  9. package/dist/central-enrollment.js.map +1 -1
  10. package/dist/cli.js +17 -2
  11. package/dist/cli.js.map +1 -1
  12. package/dist/credential-store.d.ts +4 -4
  13. package/dist/credential-store.js +6 -98
  14. package/dist/credential-store.js.map +1 -1
  15. package/dist/delivery-profile.d.ts +10 -7
  16. package/dist/delivery-profile.js +62 -44
  17. package/dist/delivery-profile.js.map +1 -1
  18. package/dist/direct-delivery.d.ts +3 -1
  19. package/dist/direct-delivery.js +114 -12
  20. package/dist/direct-delivery.js.map +1 -1
  21. package/dist/gateway-application.d.ts +4 -0
  22. package/dist/gateway-application.js +14 -6
  23. package/dist/gateway-application.js.map +1 -1
  24. package/dist/gateway-paths.d.ts +2 -0
  25. package/dist/gateway-paths.js +2 -0
  26. package/dist/gateway-paths.js.map +1 -1
  27. package/dist/guided-registration.d.ts +2 -1
  28. package/dist/guided-registration.js +15 -7
  29. package/dist/guided-registration.js.map +1 -1
  30. package/dist/process-lock.js +1 -0
  31. package/dist/process-lock.js.map +1 -1
  32. package/dist/sqlite-artifact.d.ts +9 -1
  33. package/dist/sqlite-artifact.js +23 -8
  34. package/dist/sqlite-artifact.js.map +1 -1
  35. package/dist/webhook-secret-store.d.ts +16 -0
  36. package/dist/webhook-secret-store.js +49 -0
  37. package/dist/webhook-secret-store.js.map +1 -0
  38. package/dist/windows-access-control.d.ts +6 -0
  39. package/dist/windows-access-control.js +161 -0
  40. package/dist/windows-access-control.js.map +1 -0
  41. package/docs/development-reset.md +27 -0
  42. package/docs/getting-started-claude.md +3 -3
  43. package/docs/getting-started-codex.md +3 -3
  44. package/docs/getting-started-gemini.md +1 -1
  45. package/docs/getting-started-hermes.md +78 -26
  46. package/docs/getting-started-openclaw.md +92 -31
  47. package/docs/live-qualification.md +73 -2
  48. package/integrations/openclaw-ambassador/index.mjs +171 -0
  49. package/integrations/openclaw-ambassador/openclaw.plugin.json +73 -0
  50. package/integrations/openclaw-ambassador/package.json +11 -0
  51. package/integrations/openclaw-ambassador/receiver.d.mts +43 -0
  52. package/integrations/openclaw-ambassador/receiver.mjs +164 -0
  53. package/package.json +3 -1
@@ -0,0 +1,161 @@
1
+ import { execFile, execFileSync } from "node:child_process";
2
+ import { win32 } from "node:path";
3
+ const SYSTEM_SID = "S-1-5-18";
4
+ const POWERSHELL_TIMEOUT_MS = 30_000;
5
+ const WINDOWS_HELPER_ENVIRONMENT_NAMES = [
6
+ "SystemRoot",
7
+ "WINDIR",
8
+ "ComSpec",
9
+ "PATHEXT",
10
+ "PATH",
11
+ "TEMP",
12
+ "TMP",
13
+ "USERPROFILE",
14
+ "LOCALAPPDATA",
15
+ "APPDATA",
16
+ "PROGRAMDATA",
17
+ ];
18
+ const WINDOWS_ACL_SCRIPT = `
19
+ $ErrorActionPreference = 'Stop'
20
+ if ($args.Count -ne 0) { exit 41 }
21
+ $target = [Environment]::GetEnvironmentVariable('AMBASSADOR_ACL_PATH', 'Process')
22
+ $kind = [Environment]::GetEnvironmentVariable('AMBASSADOR_ACL_KIND', 'Process')
23
+ if ([String]::IsNullOrEmpty($target)) { exit 42 }
24
+ $attributes = [System.IO.File]::GetAttributes($target)
25
+ if (($attributes -band [System.IO.FileAttributes]::ReparsePoint) -ne 0) { exit 43 }
26
+ $isDirectory = ($attributes -band [System.IO.FileAttributes]::Directory) -ne 0
27
+ if (($kind -eq 'directory') -ne $isDirectory) { exit 44 }
28
+ if ($kind -ne 'directory' -and $kind -ne 'file') { exit 45 }
29
+ $userIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent().User
30
+ $userSid = $userIdentity.Value
31
+ $artifact = if ($isDirectory) {
32
+ [System.IO.DirectoryInfo]::new($target)
33
+ } else {
34
+ [System.IO.FileInfo]::new($target)
35
+ }
36
+ $security = if ($isDirectory) {
37
+ [System.Security.AccessControl.DirectorySecurity]::new()
38
+ } else {
39
+ [System.Security.AccessControl.FileSecurity]::new()
40
+ }
41
+ $security.SetOwner($userIdentity)
42
+ $security.SetAccessRuleProtection($true, $false)
43
+ $inheritance = if ($isDirectory) {
44
+ [System.Security.AccessControl.InheritanceFlags]'ContainerInherit,ObjectInherit'
45
+ } else {
46
+ [System.Security.AccessControl.InheritanceFlags]::None
47
+ }
48
+ $expected = [System.Collections.Generic.HashSet[string]]::new(
49
+ [System.StringComparer]::OrdinalIgnoreCase
50
+ )
51
+ [void]$expected.Add($userSid)
52
+ [void]$expected.Add('${SYSTEM_SID}')
53
+ foreach ($sid in $expected) {
54
+ $identity = [System.Security.Principal.SecurityIdentifier]::new($sid)
55
+ $rule = [System.Security.AccessControl.FileSystemAccessRule]::new(
56
+ $identity,
57
+ [System.Security.AccessControl.FileSystemRights]::FullControl,
58
+ $inheritance,
59
+ [System.Security.AccessControl.PropagationFlags]::None,
60
+ [System.Security.AccessControl.AccessControlType]::Allow
61
+ )
62
+ [void]$security.AddAccessRule($rule)
63
+ }
64
+ $artifact.SetAccessControl($security)
65
+ $actual = $artifact.GetAccessControl(
66
+ [System.Security.AccessControl.AccessControlSections]'Access,Owner'
67
+ )
68
+ if (-not $actual.AreAccessRulesProtected) { exit 46 }
69
+ if ($actual.GetOwner([System.Security.Principal.SecurityIdentifier]).Value -ne $userSid) {
70
+ exit 47
71
+ }
72
+ $rules = @($actual.GetAccessRules(
73
+ $true,
74
+ $true,
75
+ [System.Security.Principal.SecurityIdentifier]
76
+ ))
77
+ if ($rules.Count -ne $expected.Count) { exit 48 }
78
+ foreach ($rule in $rules) {
79
+ if (-not $expected.Contains($rule.IdentityReference.Value)) { exit 49 }
80
+ if ($rule.IsInherited) { exit 50 }
81
+ if ($rule.AccessControlType -ne [System.Security.AccessControl.AccessControlType]::Allow) {
82
+ exit 51
83
+ }
84
+ if ([int]$rule.FileSystemRights -ne [int][System.Security.AccessControl.FileSystemRights]::FullControl) {
85
+ exit 52
86
+ }
87
+ if ($rule.InheritanceFlags -ne $inheritance) { exit 53 }
88
+ if ($rule.PropagationFlags -ne [System.Security.AccessControl.PropagationFlags]::None) {
89
+ exit 54
90
+ }
91
+ }
92
+ [Console]::Out.Write('AMBASSADOR_ACL_OK')
93
+ `;
94
+ function powershellExecutable() {
95
+ const systemRoot = process.env.SystemRoot;
96
+ if (systemRoot === undefined ||
97
+ !win32.isAbsolute(systemRoot) ||
98
+ systemRoot.includes("\u0000") ||
99
+ systemRoot.includes("\r") ||
100
+ systemRoot.includes("\n")) {
101
+ throw new Error("Windows state access control failed");
102
+ }
103
+ return win32.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
104
+ }
105
+ function helperEnvironment(path, kind) {
106
+ if (path.length < 1 || path.length > 32_768 || path.includes("\u0000")) {
107
+ throw new Error("Windows state access control failed");
108
+ }
109
+ const environment = {};
110
+ for (const name of WINDOWS_HELPER_ENVIRONMENT_NAMES) {
111
+ const value = process.env[name];
112
+ if (value !== undefined)
113
+ environment[name] = value;
114
+ }
115
+ environment.AMBASSADOR_ACL_PATH = path;
116
+ environment.AMBASSADOR_ACL_KIND = kind;
117
+ return environment;
118
+ }
119
+ function arguments_() {
120
+ return [
121
+ "-NoLogo",
122
+ "-NoProfile",
123
+ "-NonInteractive",
124
+ "-EncodedCommand",
125
+ Buffer.from(WINDOWS_ACL_SCRIPT, "utf16le").toString("base64"),
126
+ ];
127
+ }
128
+ function options(path, kind) {
129
+ return {
130
+ encoding: "utf8",
131
+ env: helperEnvironment(path, kind),
132
+ maxBuffer: 32 * 1024,
133
+ timeout: POWERSHELL_TIMEOUT_MS,
134
+ windowsHide: true,
135
+ };
136
+ }
137
+ export async function secureWindowsArtifact(path, kind) {
138
+ const output = await new Promise((resolve, reject) => {
139
+ execFile(powershellExecutable(), arguments_(), options(path, kind), (error, stdout, stderr) => {
140
+ if (error !== null || stderr.length !== 0 || stdout !== "AMBASSADOR_ACL_OK") {
141
+ reject(new Error("Windows state access control failed"));
142
+ return;
143
+ }
144
+ resolve(stdout);
145
+ });
146
+ });
147
+ if (output !== "AMBASSADOR_ACL_OK")
148
+ throw new Error("Windows state access control failed");
149
+ }
150
+ export function secureWindowsArtifactSync(path, kind) {
151
+ let output;
152
+ try {
153
+ output = execFileSync(powershellExecutable(), arguments_(), options(path, kind));
154
+ }
155
+ catch {
156
+ throw new Error("Windows state access control failed");
157
+ }
158
+ if (output !== "AMBASSADOR_ACL_OK")
159
+ throw new Error("Windows state access control failed");
160
+ }
161
+ //# sourceMappingURL=windows-access-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windows-access-control.js","sourceRoot":"","sources":["../src/windows-access-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAQlC,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,gCAAgC,GAAG;IACvC,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,KAAK;IACL,aAAa;IACb,cAAc;IACd,SAAS;IACT,aAAa;CACL,CAAC;AAEX,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAkCJ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyChC,CAAC;AAEF,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IAC1C,IACE,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AK,CAAC,qCAAqC,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,27 @@
1
+ # Reset local test state
2
+
3
+ This removes only local Ambassador test residue. It does not call the central
4
+ service or delete a registered central identity.
5
+
6
+ 1. Stop `ambassador start`.
7
+ 2. Delete the complete Ambassador state directory for the test account:
8
+
9
+ | Platform | Default state directory |
10
+ | --- | --- |
11
+ | macOS | `~/Library/Application Support/ambassador` |
12
+ | Linux | `${XDG_STATE_HOME:-~/.local/state}/ambassador` |
13
+ | Windows | `%LOCALAPPDATA%\ambassador` |
14
+
15
+ The directory contains the encrypted central credential and key, encrypted
16
+ webhook secret and key, delivery profile, ID-only notification journal, and
17
+ process lock. Delete the directory only after checking the exact path.
18
+
19
+ 3. Remove any test-only Ambassador MCP entry, Hermes webhook route, or
20
+ OpenClaw plugin configuration that you created for the run. Do not remove
21
+ normal provider credentials.
22
+ 4. Start Ambassador again from the working directory you want the new direct
23
+ profile to use.
24
+
25
+ Because this is a local-only reset, central still owns the old email identity.
26
+ Use a new disposable email when repeating registration. A `409` for the old
27
+ address is expected and is not fixed by deleting local files.
@@ -3,9 +3,9 @@
3
3
  ## Before you start
4
4
 
5
5
  - Install Node.js `>=24.19.0 <25`.
6
- - Install and authenticate the latest Claude Code release.
7
- - For direct delivery, install the latest
8
- `@agentclientprotocol/claude-agent-acp` so `claude-agent-acp` is on `PATH`.
6
+ - Install Claude Code.
7
+ - For direct delivery, install `@agentclientprotocol/claude-agent-acp` so
8
+ `claude-agent-acp` is on `PATH`.
9
9
  - Sign in to Claude Code normally. Ambassador never receives your Claude
10
10
  credential.
11
11
 
@@ -3,9 +3,9 @@
3
3
  ## Before you start
4
4
 
5
5
  - Install Node.js `>=24.19.0 <25`.
6
- - Install and authenticate the latest Codex release.
7
- - For direct delivery, install the latest `@agentclientprotocol/codex-acp` so
8
- `codex-acp` is on `PATH`.
6
+ - Install Codex.
7
+ - For direct delivery, install `@agentclientprotocol/codex-acp` so `codex-acp`
8
+ is on `PATH`.
9
9
  - Sign in to Codex normally. Ambassador never receives your Codex credential.
10
10
 
11
11
  ## Set up direct delivery
@@ -3,7 +3,7 @@
3
3
  ## Before you start
4
4
 
5
5
  - Install Node.js `>=24.19.0 <25`.
6
- - Install and sign in to the latest Gemini CLI release.
6
+ - Install and sign in to Gemini CLI.
7
7
  - Gemini supplies native ACP through `gemini --acp`; no adapter is needed.
8
8
  - Ambassador never receives your Gemini or Google credential.
9
9
 
@@ -3,49 +3,101 @@
3
3
  ## Before you start
4
4
 
5
5
  - Install Node.js `>=24.19.0 <25`.
6
- - Install and authenticate the latest Hermes Agent release.
6
+ - Install and authenticate Hermes Agent.
7
7
  - Make sure `hermes-acp` is on `PATH` for direct delivery.
8
8
  - Ambassador never receives your provider credential.
9
9
 
10
10
  ## Set up direct delivery
11
11
 
12
- 1. From the directory Hermes may access, keep Ambassador running:
12
+ 1. From the directory Hermes may access, keep the latest Ambassador running:
13
13
 
14
14
  ```sh
15
15
  npx --yes @embassys/ambassador@latest start
16
16
  ```
17
17
 
18
- 2. Add `http://127.0.0.1:8787/mcp` as a Streamable HTTP MCP server in Hermes's
19
- normal MCP configuration. Do not configure authentication.
18
+ 2. Add the endpoint printed by Ambassador as an unauthenticated Streamable
19
+ HTTP MCP server:
20
+
21
+ ```sh
22
+ hermes mcp add ambassador \
23
+ --url http://127.0.0.1:8787/mcp \
24
+ --connect-timeout 15
25
+ ```
26
+
27
+ Replace the URL if Ambassador printed a different loopback port. Do not
28
+ configure authentication.
20
29
  3. Start or restart Hermes so it sees the MCP server.
21
- 4. Ask Hermes to register your email; it calls Ambassador's `register_agent`
30
+ 4. Ask Hermes to register your email. It calls Ambassador's `register_agent`
22
31
  tool.
23
32
  5. Choose **Send directly to this Hermes agent**.
24
33
  6. Enter the six-digit code sent to your email.
25
34
 
26
- Ambassador will launch `hermes-acp` when a central message arrives. That is a
27
- new gateway-managed session, not the chat used for registration.
35
+ Ambassador launches `hermes-acp` when a central message arrives. That is a new
36
+ gateway-managed session, not the chat used for registration. Reported versions
37
+ are diagnostic only: Ambassador tries the fixed ACP v1 command and exact
38
+ `hermes-agent` identity, then reports a bounded startup, initialization,
39
+ session, or delivery failure if they are incompatible.
40
+
41
+ ## Set up webhook delivery
28
42
 
29
- ## Use a webhook instead
43
+ Hermes has a native generic webhook receiver. Configure one owner-controlled
44
+ route that uses the same value for Ambassador's bearer and HMAC V2 contract:
45
+
46
+ 1. With Ambassador running, choose **Send to a webhook** during registration.
47
+ Ambassador responds with:
48
+
49
+ ```sh
50
+ npx --yes @embassys/ambassador@latest webhook-secret
51
+ ```
52
+
53
+ Ambassador creates the secret, encrypts it in its own owner-only state, and
54
+ displays it. Repeating the command displays the same value; it does not
55
+ rotate it.
56
+
57
+ 2. Enable Hermes webhooks with `WEBHOOK_ENABLED=true` and your chosen
58
+ `WEBHOOK_PORT` in Hermes's owner-only `.hermes/.env`. Add this route to
59
+ `.hermes/webhook_subscriptions.json`, replacing both placeholders with the
60
+ displayed value and preserving any existing routes:
61
+
62
+ ```json
63
+ {
64
+ "embassys": {
65
+ "description": "Embassys Ambassador",
66
+ "events": [],
67
+ "filters": [
68
+ {
69
+ "field": "headers.Authorization",
70
+ "equals": "Bearer PASTE_AMBASSADOR_SECRET_HERE"
71
+ }
72
+ ],
73
+ "prompt": "",
74
+ "skills": [],
75
+ "deliver": "log",
76
+ "secret": "PASTE_AMBASSADOR_SECRET_HERE"
77
+ }
78
+ }
79
+ ```
80
+
81
+ Keep the file mode `0600`. An empty prompt passes the complete canonical
82
+ JSON to the model. The route uses Hermes's normal tool configuration, so
83
+ keep the Ambassador MCP server enabled there.
84
+
85
+ 3. Start or restart `hermes gateway run`. The local receiver URL is normally:
86
+
87
+ ```text
88
+ http://127.0.0.1:8644/webhooks/embassys
89
+ ```
30
90
 
31
- - Before step 1, set the receiver secret in the same shell:
91
+ Use the actual configured port. A non-loopback receiver must use an HTTPS
92
+ URL.
32
93
 
33
- ```sh
34
- export AMBASSADOR_WEBHOOK_SECRET="$(
35
- node -e "process.stdout.write(require('node:crypto').randomBytes(24).toString('hex'))"
36
- )"
37
- ```
94
+ 4. Retry `register_agent` with webhook selected and that URL. MCP carries only
95
+ `delivery.mode` and `delivery.url`; it never carries the secret or a secret
96
+ name.
38
97
 
39
- - During registration, choose **Send to a webhook**.
40
- - Give Hermes the HTTPS webhook URL and the variable name
41
- `AMBASSADOR_WEBHOOK_SECRET`.
42
- - Hermes supplies `delivery.url` and `delivery.secret_env`; it never receives
43
- the secret value.
98
+ Hermes validates the bearer filter and HMAC V2 timestamp/signature before its
99
+ model runs. A webhook `2xx` proves custody only. Keep both Hermes and
100
+ Ambassador running until the model calls `respond_to_permission` or
101
+ `submit_action_result` and the requester receives the correlated response.
44
102
 
45
- Ambassador selects this profile by the exact known MCP client name, then tries
46
- the fixed `hermes-acp` ACP v1 contract for direct delivery. Reported client and
47
- agent versions are diagnostic only. An incompatible release fails at startup,
48
- ACP initialization, session creation, or delivery instead of being rejected by
49
- a version list. See
50
- [Qualification](qualification.md) for the artifact-specific compatibility
51
- evidence.
103
+ For local reruns, see [Reset local test state](development-reset.md).
@@ -3,49 +3,110 @@
3
3
  ## Before you start
4
4
 
5
5
  - Install Node.js `>=24.19.0 <25`.
6
- - Install and authenticate the latest OpenClaw release.
6
+ - Install and authenticate OpenClaw.
7
7
  - Make sure `openclaw` is on `PATH` for direct delivery.
8
8
  - Ambassador never receives your provider credential.
9
9
 
10
10
  ## Set up direct delivery
11
11
 
12
- 1. From the directory OpenClaw may access, keep Ambassador running:
12
+ 1. From the directory OpenClaw may access, keep the latest Ambassador running:
13
13
 
14
14
  ```sh
15
15
  npx --yes @embassys/ambassador@latest start
16
16
  ```
17
17
 
18
- 2. Add `http://127.0.0.1:8787/mcp` as a Streamable HTTP MCP server in
19
- OpenClaw's normal MCP configuration. Do not configure authentication.
18
+ 2. Add the endpoint printed by Ambassador as an unauthenticated Streamable
19
+ HTTP MCP server, then probe it:
20
+
21
+ ```sh
22
+ openclaw mcp set ambassador \
23
+ '{"url":"http://127.0.0.1:8787/mcp","transport":"streamable-http","enabled":true}'
24
+ openclaw mcp doctor ambassador --probe
25
+ ```
26
+
27
+ Replace the URL if Ambassador printed a different loopback port. Do not
28
+ configure authentication.
20
29
  3. Start or restart OpenClaw so it sees the MCP server.
21
- 4. Ask OpenClaw to register your email; it calls Ambassador's `register_agent`
22
- tool.
30
+ 4. Ask OpenClaw to register your email. It calls Ambassador's
31
+ `register_agent` tool.
23
32
  5. Choose **Send directly to this OpenClaw agent**.
24
33
  6. Enter the six-digit code sent to your email.
25
34
 
26
- Ambassador will launch `openclaw acp` when a central message arrives. OpenClaw
35
+ Ambassador launches `openclaw acp` when a central message arrives. OpenClaw
27
36
  does not accept session MCP injection, so keep the provider-side MCP entry from
28
- step 2 configured.
29
-
30
- ## Use a webhook instead
31
-
32
- - Before step 1, set the receiver secret in the same shell:
33
-
34
- ```sh
35
- export AMBASSADOR_WEBHOOK_SECRET="$(
36
- node -e "process.stdout.write(require('node:crypto').randomBytes(24).toString('hex'))"
37
- )"
38
- ```
39
-
40
- - During registration, choose **Send to a webhook**.
41
- - Give OpenClaw the HTTPS webhook URL and the variable name
42
- `AMBASSADOR_WEBHOOK_SECRET`.
43
- - OpenClaw supplies `delivery.url` and `delivery.secret_env`; it never receives
44
- the secret value.
45
-
46
- Ambassador selects this profile by the exact known MCP client name, then tries
47
- the fixed `openclaw acp` ACP v1 contract for direct delivery. Reported client
48
- and agent versions are diagnostic only. An incompatible release fails at
49
- startup, ACP initialization, session creation, or delivery instead of being
50
- rejected by a version list. See
51
- [Qualification](qualification.md) for compatibility evidence.
37
+ step 2 configured. Reported versions are diagnostic only: Ambassador tries the
38
+ fixed ACP v1 command and exact `openclaw-acp` identity, then reports a bounded
39
+ startup, initialization, session, or delivery failure if they are incompatible.
40
+
41
+ ## Set up webhook delivery
42
+
43
+ Webhook mode needs the receiver plugin shipped inside the latest Ambassador
44
+ package. Install Ambassador and the plugin once:
45
+
46
+ ```sh
47
+ npm install --global @embassys/ambassador@latest
48
+ openclaw plugins install --accept-capabilities \
49
+ "$(npm root --global)/@embassys/ambassador/integrations/openclaw-ambassador"
50
+ ```
51
+
52
+ The capability is an exact authenticated HTTP route. Review and accept it only
53
+ from the Ambassador package you installed.
54
+
55
+ 1. With `ambassador start` still running, choose **Send to a webhook** during
56
+ registration. Ambassador responds with this setup command:
57
+
58
+ ```sh
59
+ ambassador webhook-secret
60
+ ```
61
+
62
+ Ambassador creates the secret, encrypts it in its own owner-only state, and
63
+ displays it. Repeating the command displays the same value; it does not
64
+ rotate it.
65
+
66
+ 2. Store the displayed value in OpenClaw without putting it in shell history:
67
+
68
+ ```sh
69
+ openclaw secrets store set AMBASSADOR_WEBHOOK_SECRET --value-file -
70
+ ```
71
+
72
+ Paste the value, press Enter, then send end-of-file (`Ctrl-D`). Point the
73
+ plugin at that store entry:
74
+
75
+ ```sh
76
+ openclaw config set plugins.entries.embassys-ambassador.config.secret \
77
+ --ref-source store --ref-provider default \
78
+ --ref-id AMBASSADOR_WEBHOOK_SECRET
79
+ openclaw plugins enable embassys-ambassador --accept-capabilities
80
+ ```
81
+
82
+ The plugin starts the configured OpenClaw agent, which defaults to `main`.
83
+ It does not select a model or expose the webhook secret to the model.
84
+
85
+ 3. Restart the OpenClaw gateway and run `openclaw plugins doctor`. The local
86
+ receiver URL is normally:
87
+
88
+ ```text
89
+ http://127.0.0.1:18789/embassys/ambassador
90
+ ```
91
+
92
+ Use the actual configured gateway port. A non-loopback receiver must use an
93
+ HTTPS URL.
94
+
95
+ 4. Retry `register_agent` with webhook selected and that URL. MCP carries only
96
+ `delivery.mode` and `delivery.url`; it never carries the secret or a secret
97
+ name.
98
+
99
+ The plugin verifies Ambassador's bearer token, exact-body HMAC V2 signature,
100
+ five-minute timestamp window, request ID, and idempotency key before placing the
101
+ message on a bounded in-memory service queue. That service starts the normal
102
+ OpenClaw model turn outside the completed HTTP request. A webhook `202` proves
103
+ that OpenClaw accepted custody. It does not by itself prove that the model later
104
+ called Ambassador MCP; end-to-end checks must wait for the correlated
105
+ permission or action response.
106
+
107
+ If OpenClaw reports `model execution failed`, run `openclaw plugins doctor` and
108
+ check that the agent's own provider credential and Ambassador MCP entry are
109
+ available to the OpenClaw gateway. Ambassador intentionally logs only a safe
110
+ failure category, not the provider error or message body.
111
+
112
+ For local reruns, see [Reset local test state](development-reset.md).
@@ -11,7 +11,7 @@ general reply operations. It does test the deployed, action-specific
11
11
  The runner covers the current package name, guided registration, one
12
12
  full-message webhook target, and one direct target. The default direct target
13
13
  is the deterministic mock ACP agent. Separately confirmed modes use the fixed
14
- Codex or Hermes profiles. Real-provider modes use isolated provider
14
+ Codex, Hermes, or OpenClaw profiles. Real-provider modes use isolated provider
15
15
  configuration copies. Installed-version probes are observational; production
16
16
  requires the exact known client and ACP agent names and then tries the fixed
17
17
  ACP v1 contract.
@@ -33,7 +33,8 @@ ACP v1 contract.
33
33
  direct profile. Prove a dual-mode profile advertises direct as its default;
34
34
  prove a direct-only profile proceeds without a delivery question.
35
35
  4. Receive and use both verification emails without persisting their codes.
36
- 5. Restart and prove encrypted credential and nonsecret profile loading.
36
+ 5. Restart and prove encrypted credential, encrypted webhook-secret, and
37
+ nonsecret profile loading.
37
38
  6. Prove valid Bearer plus DPoP requests and the negative DPoP matrix.
38
39
  7. Validate the live action catalog against the recorded fixture schemas.
39
40
  8. Request and decide one synthetic `get_phone_number` permission.
@@ -113,6 +114,37 @@ mode starts Hermes's authenticated generic route,
113
114
  requires its bearer filter and native HMAC V2 validation, and suppresses
114
115
  provider output. Delete the isolated home after every attempt.
115
116
 
117
+ For OpenClaw, prepare an owner-only temporary home containing copies of
118
+ `.openclaw/openclaw.json`, `.openclaw/state/openclaw.sqlite`, and
119
+ `.openclaw/agents/main/agent/openclaw-agent.sqlite`. Copy only the provider
120
+ credential used by that OpenClaw agent; for the tested Codex-backed agent this
121
+ also means `.codex/auth.json` and its provider configuration. Use SQLite's
122
+ backup operation for live database copies. Put the installed `openclaw` on
123
+ `PATH`, then choose one fixed mode:
124
+
125
+ ```sh
126
+ export AMBASSADOR_OPENCLAW_QUALIFICATION_HOME=/absolute/path/to/isolated/home
127
+ export AMBASSADOR_LIVE_DIRECT_AGENT=openclaw-direct
128
+ export AMBASSADOR_CONFIRM_LIVE_QUALIFICATION=run-live-qualification-with-real-openclaw-direct-and-two-disposable-mailosaur-identities
129
+ pnpm run qualify:live
130
+ ```
131
+
132
+ or:
133
+
134
+ ```sh
135
+ export AMBASSADOR_OPENCLAW_QUALIFICATION_HOME=/absolute/path/to/isolated/home
136
+ export AMBASSADOR_LIVE_DIRECT_AGENT=openclaw-webhook
137
+ export AMBASSADOR_CONFIRM_LIVE_QUALIFICATION=run-live-qualification-with-real-openclaw-webhook-and-two-disposable-mailosaur-identities
138
+ pnpm run qualify:live
139
+ ```
140
+
141
+ The runner rejects the ordinary OpenClaw home. It configures Ambassador MCP
142
+ only in the copy. Direct mode launches the fixed `openclaw acp` profile and
143
+ requires ACP v1 plus exact agent name `openclaw-acp`. Webhook mode installs the
144
+ package-shipped receiver into the copy, creates the secret through the packed
145
+ Ambassador CLI, stores it through OpenClaw's secret store, and runs the real
146
+ OpenClaw gateway. Delete the isolated home after every attempt.
147
+
116
148
  ## Required report
117
149
 
118
150
  Record only:
@@ -264,6 +296,45 @@ These observations approve the source registry's exact Hermes ACP 0.20.5
264
296
  entry. They do not show that published Ambassador 0.2.7 supports Hermes 0.20.5
265
297
  direct mode. Ambassador 0.2.8 contains the candidate change.
266
298
 
299
+ ## OpenClaw observations
300
+
301
+ On 2026-09-03, authenticated OpenClaw 2026.8.2 ran on macOS arm64 with Node
302
+ 24.19.0 and passed the complete live correlated-result flow in direct and
303
+ webhook modes with the Ambassador 0.2.10 candidate. Both modes registered and
304
+ verified two disposable identities, reloaded encrypted Ambassador state after
305
+ restart, exercised live REST and DPoP plus the deployed action catalog, and
306
+ completed the synthetic phone-number permission and action round trip. The
307
+ real OpenClaw model called `respond_to_permission` and called
308
+ `submit_action_result` exactly once. The controlled requester received the
309
+ correlated final response, and local completion or webhook custody preceded
310
+ central acknowledgement. Final candidate digests and the separate mode results
311
+ are recorded in [Delivery qualification](qualification.md).
312
+
313
+ Direct mode proved ACP v1 initialization through fixed `openclaw acp`, exact
314
+ agent name `openclaw-acp`, provider-side Ambassador MCP configuration, real
315
+ model execution, and correlated submission. An earlier isolation attempt
316
+ omitted the credential for the agent's configured provider backend; OpenClaw
317
+ then ended the model turn with an authentication failure before any Ambassador
318
+ MCP call. Adding that owner-only credential to the isolated copy made the
319
+ unchanged direct flow pass. This was an isolation-fixture failure, not an
320
+ Ambassador ACP incompatibility.
321
+
322
+ Webhook mode proved the package-shipped route's bearer and exact-body HMAC V2
323
+ checks, bounded custody queue, real model execution, Ambassador MCP calls, and
324
+ the final response. Earlier receiver attempts returned `202` and Ambassador
325
+ correctly acknowledged central, but OpenClaw made no model or MCP call. The
326
+ first implementation omitted required embedded-run fields. After those were
327
+ added, the detached run inherited the HTTP handler's released work-admission
328
+ lease and OpenClaw rejected it with the safe class `GatewayDrainingError`. A
329
+ plugin-service queue created outside the request context removes that false
330
+ drain path. A `202` still proves custody only; the passing run waited for the
331
+ model calls and requester response.
332
+
333
+ All OpenClaw attempts used an owner-only isolated home. Mailosaur messages,
334
+ temporary Ambassador state, the OpenClaw copy, and copied provider credentials
335
+ were removed after qualification. No provider output or message content was
336
+ recorded.
337
+
267
338
  ## Earlier direct observation
268
339
 
269
340
  On 2026-09-02, real Codex had already passed delivery, injected Ambassador MCP