Skip to content

Commit 00b831e

Browse files
committed
Sync open source content 🐝 (from f9294e30e518936fcc472f139628fc0b7e728af8)
1 parent 9068126 commit 00b831e

7 files changed

Lines changed: 165 additions & 12 deletions

File tree

β€Ždocs/ai-control-plane/distribute/plugins/index.mdxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Create a plugin with a name and description, then manage its contents from the d
2323

2424
- Add and remove MCP servers, and manage bundled skills
2525
- **Assignments** β€” manage which roles or members receive the plugin
26-
- **Install** β€” per-client installation instructions with copy buttons for Claude Code, Claude Cowork, Cursor, Codex, and OpenCode, covering per-user marketplace registration, org-wide managed settings, and team marketplace registration
26+
- **Install** β€” per-client installation instructions with copy buttons for Claude Code, Claude Cowork, Cursor, Codex, OpenCode, and OpenClaw, covering per-user marketplace registration, org-wide managed settings, and team marketplace registration
2727
- **Publish** β€” push the plugin to the GitHub marketplace
2828

2929
A **Platform Plugins** section provides the observability plugin per platform β€” the component that feeds the [Observe](/docs/ai-control-plane/observe) section's data.
3030

31-
Per-platform setup differs enough to warrant its own page for some agents. See [Anthropic](/docs/ai-control-plane/distribute/plugins/anthropic) for Claude Code and Claude Cowork, and [OpenCode](/docs/ai-control-plane/distribute/plugins/opencode), which has no marketplace and installs the observability plugin as a downloadable package instead.
31+
Per-platform setup differs enough to warrant its own page for some agents. See [Anthropic](/docs/ai-control-plane/distribute/plugins/anthropic) for Claude Code and Claude Cowork. Neither [OpenCode](/docs/ai-control-plane/distribute/plugins/opencode) nor [OpenClaw](/docs/ai-control-plane/distribute/plugins/openclaw) has a marketplace; both install the observability plugin as a downloadable package instead.
3232

3333
## Assignments
3434

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
title: "OpenClaw"
3+
description: "Instrument OpenClaw with the observability plugin so Gateway sessions and tool calls reach Observe and risk policies are enforced on OpenClaw traffic."
4+
---
5+
6+
import { Callout } from "@/mdx/components";
7+
8+
OpenClaw loads plugins in-process when its Gateway starts, so the observability plugin ships as a native OpenClaw plugin package rather than a marketplace entry. The package is installed with `openclaw plugins install`, granted conversation access in the OpenClaw config, and picked up on the next Gateway restart. This page covers rendering that package, the two configuration steps it depends on, and verifying that events arrive.
9+
10+
Once installed, the plugin captures OpenClaw sessions and tool calls for [Observe](/docs/ai-control-plane/observe) and enforces [risk policies](/docs/ai-control-plane/secure/guardrails) on prompts and tool calls.
11+
12+
<Callout title="Hooks require OpenClaw's embedded runtime" type="warning">
13+
When a model is configured with Claude CLI OAuth authentication, OpenClaw
14+
delegates the model and tool loop out of process to the Claude Code CLI, and
15+
none of the plugin's hooks fire β€” no prompts, tool calls, replies, or usage
16+
are recorded for that model. This is the login default whenever a
17+
`claude-cli` profile exists. Coverage requires a model whose agent runtime is
18+
OpenClaw's embedded runtime. Instrument Claude Code itself through the
19+
[Anthropic plugin](/docs/ai-control-plane/distribute/plugins/anthropic) to
20+
cover the delegated path.
21+
</Callout>
22+
23+
<Callout title="OpenClaw has no OTEL exporter" type="info">
24+
Claude Code and Codex export OpenTelemetry alongside their hooks. OpenClaw has
25+
no equivalent, so every OpenClaw signal arrives through the observability
26+
plugin. Sessions, tool calls, token counts, cost, and policy enforcement all
27+
work; the OTEL-derived detail described in [What the plugin
28+
captures](#what-the-plugin-captures) does not apply. No Claude-side OTEL
29+
configuration is needed for OpenClaw.
30+
</Callout>
31+
32+
## Access requirements
33+
34+
<Callout type="info">
35+
Downloading the observability plugin requires the `org:admin` scope, and so
36+
does creating the API key the CLI path uses. Both are held by the default
37+
[Admin role](/docs/ai-control-plane/org-admin/roles-and-permissions).
38+
</Callout>
39+
40+
## Download the plugin package
41+
42+
On the dashboard's **Distribute > Plugins** page, open the **Platform Plugins** section, select **openclaw**, and click **Download Plugin**. The download is a ZIP with a hooks-scoped API key already embedded, so no key needs to be created or exported separately.
43+
44+
Extract it into a directory of its own:
45+
46+
```bash
47+
unzip observability-openclaw.zip -d speakeasy-observability
48+
```
49+
50+
The package contains `openclaw.plugin.json`, which declares the plugin id `speakeasy-observability` and activates it on startup, `index.js`, which proxies OpenClaw's typed hooks to the hooks runtime, `package.json`, which registers `index.js` as the extension entry point, `speakeasy.json`, which carries the deployment identity and the embedded key, and the bootstrap scripts that fetch the hooks runtime on first run.
51+
52+
## Render the package with the CLI
53+
54+
Use this path when the package needs to be rendered from a script or checked into a repository template. Install the `speakeasy-hooks` binary:
55+
56+
```bash
57+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/gram/main/hooks/install.sh | sh
58+
```
59+
60+
Create an API key with the **Hooks** scope on the [API keys](/docs/ai-control-plane/org-admin/api-keys) page, then render the package:
61+
62+
```bash
63+
GRAM_HOOKS_ORG_KEY="<hooks-scoped-api-key>" \
64+
speakeasy-hooks install --provider=openclaw --dir=./speakeasy-observability --project=<project-slug>
65+
```
66+
67+
Useful flags:
68+
69+
- `--provider` β€” the agent to render for, `openclaw` here
70+
- `--dir` β€” where the package is written
71+
- `--project` β€” the project slug events are attributed to, defaulting to `default`
72+
- `--browser-login` β€” let each developer sign in through the browser so events record under their own identity rather than the organization key
73+
74+
## Install the package into OpenClaw
75+
76+
Register the rendered directory with the Gateway:
77+
78+
```bash
79+
openclaw plugins install ./speakeasy-observability
80+
```
81+
82+
Conversation-scope hooks β€” prompt submission, model replies, and turn end β€” are gated behind a per-plugin flag. Until it is set, those hooks never fire and no error is reported. Grant it:
83+
84+
```bash
85+
openclaw config set plugins.entries.speakeasy-observability.hooks.allowConversationAccess true
86+
```
87+
88+
OpenClaw loads plugins at startup only, so restart the Gateway to activate the hooks:
89+
90+
```bash
91+
openclaw gateway restart
92+
```
93+
94+
<Callout type="warning">
95+
A live session that records tool calls but no prompts, replies, or token
96+
usage is the signature of a missing `allowConversationAccess`. Set the flag
97+
and restart the Gateway.
98+
</Callout>
99+
100+
## Roll out across a fleet
101+
102+
The [device agent](/docs/ai-control-plane/org-admin/device-agent) installs and maintains the OpenClaw package on every enrolled machine and reapplies it every minute, so organizations running it can skip the manual steps above. It installs each assigned package under `~/.openclaw/extensions/<plugin-id>/` and forces two leaves in `~/.openclaw/openclaw.json` β€” `plugins.entries.<plugin-id>.enabled` and `plugins.entries.<plugin-id>.hooks.allowConversationAccess` β€” leaving every other value in the file intact. A developer who switches the plugin off has it re-enabled on the next tick.
103+
104+
Two behaviors are worth setting expectations on:
105+
106+
- The agent never restarts the Gateway. A newly installed extension stays dormant until the developer's next Gateway restart.
107+
- An extension directory the agent does not own β€” one a developer installed manually before management began β€” is never overwritten, though its config entry is still enforced. Removing the manual copy hands it to the agent on the next tick.
108+
109+
The agent skips OpenClaw silently on machines where `~/.openclaw` does not exist. OpenClaw is managed by default wherever it is installed. To exclude it on a given fleet, set the `platforms` key in the agent's managed configuration:
110+
111+
```json
112+
{
113+
"platforms": {
114+
"openclaw": false
115+
}
116+
}
117+
```
118+
119+
Unlike Claude Code, Codex, Cursor, and GitHub Copilot, OpenClaw has no admin-layer enforcement mode today, so `"managed"` behaves as user-layer management. See the [device agent reference](/docs/ai-control-plane/reference/device-agent) for the full managed configuration.
120+
121+
## Verify the installation
122+
123+
Restart the Gateway, then run any tool call β€” an MCP tool, or a prompt such as `echo hi there`. Confirm both surfaces:
124+
125+
- The call appears in [Tool Logs](/docs/ai-control-plane/observe/tool-logs). For a local tool call, set the **Type** filter to include local tools.
126+
- The conversation appears in [Agent Sessions](/docs/ai-control-plane/observe/agent-sessions) with **Agent type** filtered to openclaw. Transcripts require **Agent Session Capture** on the [Logging & Telemetry](/docs/ai-control-plane/org-admin/logging-and-telemetry) page.
127+
128+
If tool calls arrive but prompts do not, check `allowConversationAccess`. If nothing arrives at all, check whether the model in use runs on OpenClaw's embedded runtime rather than the delegated Claude CLI path.
129+
130+
## What the plugin captures
131+
132+
The plugin translates OpenClaw's typed plugin hooks into the platform's canonical hook events:
133+
134+
| OpenClaw hook | Recorded as |
135+
| ----------------------------------- | ------------------------------------------------------- |
136+
| `session_start`, `session_end` | Session start and end |
137+
| `before_agent_run` | User prompt |
138+
| `before_tool_call`, `after_tool_call` | Tool call and result |
139+
| `agent_end` | Assistant response, with the turn's token and cost usage |
140+
| `subagent_spawned`, `subagent_ended` | Subagent start and end |
141+
| `llm_input`, `llm_output` | Model request and response |
142+
| `before_compaction`, `after_compaction` | Context compaction |
143+
144+
Prompt submission and tool calls are blocking, so a risk policy set to block denies the action in OpenClaw rather than only recording it, and [spend rules](/docs/ai-control-plane/observe/costs/budgets) deny prompts and tool calls once an actor is over budget. Tool results, errors, subagent lifecycle, model traffic, and compaction are recorded without blocking. A blocked tool call is recorded as an error rather than a success, even though OpenClaw reports the block through the same hook it uses for completed calls.
145+
146+
Because there is no OTEL stream, a few details available for Claude Code are not available for OpenClaw:
147+
148+
- No permission-request surface, so permission prompts are neither recorded nor gated β€” OpenClaw exposes approval only as a response to a tool-call gate
149+
- No skill source resolution or prompt attachment capture
150+
- No MCP inventory, so configured MCP servers are not reported as part of the session
151+
- [OTEL forwarding](/docs/ai-control-plane/org-admin/logging-and-telemetry/otel-forwarding) copies OTEL payloads only, so OpenClaw events are not forwarded to an external collector
152+
153+
Token and cost totals are unaffected: OpenClaw reports usage at the end of each turn and the plugin forwards it, so [Costs](/docs/ai-control-plane/observe/costs) attributes OpenClaw spend normally.

β€Ždocs/ai-control-plane/getting-started/index.mdxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Choose MCP servers from the catalog to roll out to the organization. Selected se
4545

4646
### Instrument agent platforms
4747

48-
Choose how the team's AI coding assistants get instrumented. **Manual Setup** walks through per-platform hooks for Claude Code, Claude Cowork, OpenAI Codex, Cursor, and OpenCode, with more platforms on the way. OpenCode has no plugin marketplace, so its steps render the observability plugin straight into a repository β€” see [distributing plugins to OpenCode](/docs/ai-control-plane/distribute/plugins/opencode).
48+
Choose how the team's AI coding assistants get instrumented. **Manual Setup** walks through per-platform hooks for Claude Code, Claude Cowork, OpenAI Codex, Cursor, OpenCode, and OpenClaw, with more platforms on the way. Neither OpenCode nor OpenClaw has a plugin marketplace, so their steps render the observability plugin as a package instead β€” see [distributing plugins to OpenCode](/docs/ai-control-plane/distribute/plugins/opencode) and [distributing plugins to OpenClaw](/docs/ai-control-plane/distribute/plugins/openclaw).
4949

5050
![The Instrument agent platforms step with per-platform manual setup entries](/assets/docs/ai-control-plane/getting-started/setup-instrument-agents-manual.webp)
5151

@@ -63,7 +63,7 @@ Optionally connect admin and compliance APIs so the platform can import usage, s
6363

6464
### Confirm traffic
6565

66-
The wizard listens for events from the instrumented agent platforms. Trigger any action in Claude Code, Cursor, Codex, or OpenCode on a managed machine, or in an instrumented Claude Code on the web session, and the live activity feed shows tool-call events arriving, followed by confirmation that the organization is receiving hook events.
66+
The wizard listens for events from the instrumented agent platforms. Trigger any action in Claude Code, Cursor, Codex, OpenCode, or OpenClaw on a managed machine, or in an instrumented Claude Code on the web session, and the live activity feed shows tool-call events arriving, followed by confirmation that the organization is receiving hook events.
6767

6868
![The Confirm traffic step with a live feed of arriving tool-call events](/assets/docs/ai-control-plane/getting-started/setup-confirm-traffic.webp)
6969

β€Ždocs/ai-control-plane/observe/index.mdxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ Adoption tracking for the organization: who is enrolled, who isn't, and how acti
5050

5151
## Getting data into Observe
5252

53-
Observe pages populate once the observability plugin is installed in the AI agents used across the organization (Claude, Cursor, Codex, and OpenCode are supported from the setup dialog). Until then, pages show a setup prompt with per-provider installation steps.
53+
Observe pages populate once the observability plugin is installed in the AI agents used across the organization (Claude, Cursor, Codex, OpenCode, and OpenClaw are supported from the setup dialog). Until then, pages show a setup prompt with per-provider installation steps.
5454

55-
OpenCode has no OpenTelemetry exporter, so its sessions, tool calls, tokens, and cost arrive entirely through the observability plugin. See [distributing plugins to OpenCode](/docs/ai-control-plane/distribute/plugins/opencode) for what that changes.
55+
Neither OpenCode nor OpenClaw has an OpenTelemetry exporter, so their sessions, tool calls, tokens, and cost arrive entirely through the observability plugin. See [distributing plugins to OpenCode](/docs/ai-control-plane/distribute/plugins/opencode) and [distributing plugins to OpenClaw](/docs/ai-control-plane/distribute/plugins/openclaw) for what that changes.

β€Ždocs/ai-control-plane/org-admin/logging-and-telemetry/index.mdxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The page presents a set of toggle rows that control what the platform records. E
2828
- **Enable Logs** records tool-call traces and telemetry. This is the master switch for the settings below it.
2929
- **Upload Skill Content** uploads each skill's SKILL.md content at activation so captured skills can be inspected. When disabled, the platform receives only skill names, source details, hashes, users, and hostnames at activation. This row appears only when skills are enabled for the organization, and it is on by default. The same toggle also appears on the [Skills settings page](/docs/ai-control-plane/org-admin/skills), and the two stay in sync.
3030
- **Record Tool I/O** stores the inputs and outputs of tool calls. Stored payloads may expose sensitive data, so enable it deliberately.
31-
- **Agent Session Capture** captures user prompts and assistant responses from supported coding agents. Captured sessions appear in [Agent Sessions](/docs/ai-control-plane/observe/agent-sessions). The toggle applies to every instrumented agent, including ones without an OpenTelemetry exporter such as OpenCode, whose transcripts arrive through the observability plugin instead.
31+
- **Agent Session Capture** captures user prompts and assistant responses from supported coding agents. Captured sessions appear in [Agent Sessions](/docs/ai-control-plane/observe/agent-sessions). The toggle applies to every instrumented agent, including ones without an OpenTelemetry exporter such as OpenCode and OpenClaw, whose transcripts arrive through the observability plugin instead.
3232
- **Fail Open During Outages** lets tool calls proceed when the platform is unreachable instead of blocking them (blocking is the default). Blocking policies go unenforced during the outage; events are still recorded and scanned after recovery, and invalid credentials always block. Flipping this setting is recorded in [Audit Logs](/docs/ai-control-plane/org-admin/audit-logs).
3333
- **Hook Browser Sign-In** lets hook plugins sign users in through the browser so events record under their own identity. When off, plugins use the organization key or explicitly configured credentials.
3434

β€Ždocs/ai-control-plane/org-admin/logging-and-telemetry/otel-forwarding.mdxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ The same configuration applies to each supported OTEL signal:
4343
- Logs and metrics received on the hooks endpoint are copied to `/v1/logs` and `/v1/metrics` with their original body and content type. Payloads larger than 4 MiB are still processed by the platform but are not forwarded, and delivery failures are not retried.
4444
- Forwarding failures never affect the source agent or signals that the platform processes for its own Observe and Secure views.
4545
- Requests must carry a recognized Hooks API key so the platform can select the correct organization's destination.
46-
- Plugin hook events from agents that emit no OTEL, such as [OpenCode](/docs/ai-control-plane/distribute/plugins/opencode), are not forwarded today.
46+
- Plugin hook events from agents that emit no OTEL, such as [OpenCode](/docs/ai-control-plane/distribute/plugins/opencode) and [OpenClaw](/docs/ai-control-plane/distribute/plugins/openclaw), are not forwarded today.
4747

4848
## Sending telemetry to the platform
4949

50-
See [Data Export](/docs/ai-control-plane/observe/opentelemetry) for the OTLP endpoint, authentication headers, enrichment attributes, destination compatibility, and delivery behavior. Agent-specific setup is documented under [Anthropic plugins](/docs/ai-control-plane/distribute/plugins/anthropic), [OpenCode plugins](/docs/ai-control-plane/distribute/plugins/opencode), and the [device agent](/docs/ai-control-plane/org-admin/device-agent).
50+
See [Data Export](/docs/ai-control-plane/observe/opentelemetry) for the OTLP endpoint, authentication headers, enrichment attributes, destination compatibility, and delivery behavior. Agent-specific setup is documented under [Anthropic plugins](/docs/ai-control-plane/distribute/plugins/anthropic), [OpenCode plugins](/docs/ai-control-plane/distribute/plugins/opencode), [OpenClaw plugins](/docs/ai-control-plane/distribute/plugins/openclaw), and the [device agent](/docs/ai-control-plane/org-admin/device-agent).

0 commit comments

Comments
Β (0)