Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Send cloud-agent telemetry to Asymptote Managed ingest

shukieshah90256f317b9b
diff --git a/CLAUDE.md b/CLAUDE.md
index 371537ae..09120ef5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -19,7 +19,7 @@ Do not recreate or depend on removed `asymptote` mirror trees. Keep new work foc
- Beacon is visibility-first endpoint telemetry for local AI agent runtimes, not a hosted policy service or general endpoint protection product.
- Preserve the local-only default. The public Beacon build must not require a hosted account, remote policy fetch, hosted dashboard, or external network dependency during normal hook execution, and hooks themselves never touch the network.
-- Asymptote Managed forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint asymptote`) is the one destination that sends telemetry to an Asymptote-run service, and it is an explicit, opt-in, revocable Vector destination shaped like every other pack: Beacon stays the local JSONL producer, Vector does the network, and the per-device key lives in a `0600` secrets file read through Vector's secret backend, never in `config.json`, `vector.toml`, or the process environment. Nothing is forwarded until a member of the organization approves the specific device in the browser; only lines written after that are shipped (`read_from = "end"`); revocation from the dashboard takes effect at the ingest service within a minute. The wire contract (gzip NDJSON to `/v1/ingest/{runtime,inventory}`, bearer `bcn_device_*` key, `/v1/ingest/health` credential check) is owned by the `beacon-ingest` service in beacon-mdr; change both sides together. Do not add a second network channel, and do not let the ingest URL be anything but `https://`.
+- Asymptote Managed forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint asymptote`) is the one destination that sends telemetry to an Asymptote-run service, and it is an explicit, opt-in, revocable Vector destination shaped like every other pack: Beacon stays the local JSONL producer, Vector does the network, and the per-device key lives in a `0600` secrets file read through Vector's secret backend, never in `config.json`, `vector.toml`, or the process environment. Nothing is forwarded until a member of the organization approves the specific device in the browser; only lines written after that are shipped (`read_from = "end"`); revocation from the dashboard takes effect at the ingest service within a minute. The wire contract (gzip NDJSON to `/v1/ingest/{runtime,inventory}`, bearer `bcn_device_*` key, `/v1/ingest/health` credential check) is owned by the `beacon-ingest` service in beacon-mdr; change both sides together. Do not add a second network channel, and do not let the ingest URL be anything but `https://`. The one exception to the no-environment rule is the cloud-sandbox shuttle (`cli/beacon-hooks/internal/cloudshuttle`, active only when `BEACON_ORIGIN=cloud`, where hooks are the only process): a Claude Code web sandbox has no Vector, no service manager, no browser and no persistent disk, so it ships its runtime log itself, and `BEACON_CLOUD_UPLOAD=asymptote` sends new lines to the same `/v1/ingest/runtime` contract with a device key an operator minted for that environment (`BEACON_CLOUD_DEVICE_KEY`), alongside the existing GCS and S3 targets. It is still `https://`-only, still a `bcn_device_*` key, still revocable from the dashboard, and never used on an endpoint install.
- Two bounded network channels exist, both explicit. The first: `beacon endpoint install` asks for an email and work/personal intent once per machine and POSTs that plus install context (OS, arch, version, install method, detected runtime names, a random install ID) to an Asymptote-run signup endpoint. The same first-run prompt ends with a telemetry destination question (arrow-key picker, local first so Enter forwards nothing): keep it local, forward to the user's own infrastructure (prints the log-forwarding docs URL, nothing else changes), or forward to Asymptote Managed. `BEACON_MANAGED_INGEST=0` hides the Asymptote row; `install --connect` skips the question and connects. Local and own-infrastructure answers are recorded in the profile and never asked again; the Asymptote answer runs `connect` after the install, is recorded only once that connect succeeds so a failed install or connect is asked again rather than remembered as done, and is the only way onboarding ever forwards telemetry. The answer is never sent. The second channel is that forwarder, described below. This is intentional product behavior for open-source attribution, not an oversight — do not remove it. It is strictly bounded: interactive TTY only, once per machine, never during hook execution, never on `--system`/root/CI/piped-stdin/`--dry-run` installs, and always skippable with `BEACON_ONBOARDING=0`. A failed submission never fails an install. No prompt text, telemetry event, file content, or command ever leaves the machine through it. Implementation lives in `cli/beacon/internal/onboarding` and `cli/beacon/cmd/endpoint_onboarding.go`; the README documents the payload field-by-field, so changing the fields means changing that table too.
- Do not add dependency vulnerability scanning, OSV/GHSA lookups, package remediation, or other vulnerability-enforcement flows to the public hook path.
- Do not add broad runtime enforcement unless explicitly requested. Current control behavior is limited to hook-native approvals/denials exposed by supported agent runtimes.
diff --git a/cli/beacon-hooks/internal/cloudshuttle/asymptote.go b/cli/beacon-hooks/internal/cloudshuttle/asymptote.go
new file mode 100644
index 00000000..12fa6a8e
--- /dev/null
+++ b/cli/beacon-hooks/internal/cloudshuttle/asymptote.go
@@ -0,0 +1,155 @@
+package cloudshuttle
+
+import (
+ "bufio"
+ "bytes"
+ "compress/gzip"
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "time"
+)
+
+// Asymptote managed ingest as a cloud upload target.
+//
+// A cloud sandbox cannot enroll interactively, so it is configured with a per-device key an
+// organization admin minted for it (BEACON_CLOUD_DEVICE_KEY) and the ingest URL
+// (BEACON_CLOUD_INGEST_URL), the same wire contract the laptops' Vector forwarders use:
+// gzip NDJSON POSTed to /v1/ingest/runtime with the key as a bearer token. Unlike the bucket
+// targets, which re-upload the whole log under one object name per run, this target sends
+// only the lines appended since the last successful upload, in batches under the ingest
+// limits, and remembers the offset in the shuttle state. A revoked key (401) or a rejected
+// batch leaves the offset where it was, so the next hook retries the same lines.
+const (
+ uploadAsymptote = "asymptote"
+ ingestRuntimePath = "/v1/ingest/runtime"
+ deviceKeyPrefix = "bcn_device_"
+ asymptoteUserAgent = "beacon-hooks-cloud"
+ maxIngestBatchLines = 5000
+ maxIngestBatchBytes = 4 << 20 // uncompressed; the service caps compressed bodies at 8 MiB
+)
+
+// asymptoteBatchLines is a variable so tests can force several batches from a small log.
+var asymptoteBatchLines = maxIngestBatchLines
+
+// IsSecureIngestURL mirrors the CLI's rule for where a device key may be sent: https
+// anywhere, plain http only to loopback for local development.
+func IsSecureIngestURL(raw string) bool {
+ u, err := url.Parse(strings.TrimSpace(raw))
+ if err != nil || u.Host == "" {
+ return false
+ }
+ switch strings.ToLower(u.Scheme) {
+ case "https":
+ return true
+ case "http":
+ host := u.Hostname()
+ return host == "127.0.0.1" || host == "localhost" || host == "::1"
+ }
+ return false
+}
+
+func asymptoteConfigured(cfg Config) bool {
+ return IsSecureIngestURL(cfg.IngestURL) && strings.HasPrefix(strings.TrimSpace(cfg.DeviceKey), deviceKeyPrefix)
+}
+
+// uploadAsymptoteIncremental sends the log's new lines to managed ingest and updates the
+// shuttle state. `snapshot` is a consistent copy of the log; `size` its length.
+func uploadAsymptoteIncremental(ctx context.Context, cfg Config, snapshot string, size int64) error {
+ offset := int64(0)
+ if st, err := readState(cfg.StatePath); err == nil && st.Provider == cfg.Provider && st.RunID == cfg.RunID && st.LastSize > 0 && st.LastSize <= size {
+ offset = st.LastSize
+ }
+ if offset >= size {
+ return nil
+ }
+ file, err := os.Open(snapshot)
+ if err != nil {
+ return err
+ }
+ defer file.Close()
+ if _, err := file.Seek(offset, io.SeekStart); err != nil {
+ return err
+ }
+
+ reader := bufio.NewReaderSize(file, 1<<20)
+ sent := offset
+ var batch bytes.Buffer
+ lines := 0
+ flush := func() error {
+ if lines == 0 {
+ return nil
+ }
+ if err := postIngestBatch(ctx, cfg, batch.Bytes()); err != nil {
+ return err
+ }
+ sent += int64(batch.Len())
+ batch.Reset()
+ lines = 0
+ return writeState(cfg.StatePath, state{
+ LastUpload: time.Now().UTC().Format(time.RFC3339),
+ LastSize: sent,
+ LastObject: cfg.IngestURL + ingestRuntimePath,
+ Provider: cfg.Provider,
+ RunID: cfg.RunID,
+ })
+ }
+ for {
+ line, err := reader.ReadBytes('\n')
+ if len(line) > 0 && line[len(line)-1] == '\n' {
+ // Only complete lines are shipped; a partial trailing line waits for the next hook.
+ batch.Write(line)
+ lines++
+ if lines >= asymptoteBatchLines || batch.Len() >= maxIngestBatchBytes {
+ if err := flush(); err != nil {
+ return err
+ }
+ }
+ }
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ break
+ }
+ return err
+ }
+ }
+ return flush()
+}
+
+func postIngestBatch(ctx context.Context, cfg Config, ndjson []byte) error {
+ var body bytes.Buffer
+ gz := gzip.NewWriter(&body)
+ if _, err := gz.Write(ndjson); err != nil {
+ return err
+ }
+ if err := gz.Close(); err != nil {
+ return err
+ }
+ req, err := http.NewRequestWithContext(ctx, http.MethodPost, strings.TrimRight(cfg.IngestURL, "/")+ingestRuntimePath, &body)
+ if err != nil {
+ return err
+ }
+ req.Header.Set("Authorization", "Bearer "+strings.TrimSpace(cfg.DeviceKey))
+ req.Header.Set("Content-Type", contentTypeJSONL)
+ req.Header.Set("Content-Encoding", contentEncoding)
+ req.Header.Set("User-Agent", asymptoteUserAgent)
+ resp, err := httpClient.Do(req)
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+ respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 64*1024))
+ switch {
+ case resp.StatusCode >= 200 && resp.StatusCode < 300:
+ return nil
+ case resp.StatusCode == http.StatusUnauthorized:
+ return fmt.Errorf("managed ingest rejected the device key (HTTP 401): revoked, expired, or its approver left the organization")
+ default:
+ return fmt.Errorf("managed ingest upload failed: %s: %s", resp.Status, strings.TrimSpace(string(respBody)))
+ }
+}
diff --git a/cli/beacon-hooks/internal/cloudshuttle/asymptote_test.go b/cli/beacon-hooks/internal/cloudshuttle/asymptote_test.go
new file mode 100644
index 00000000..5aff0dfa
--- /dev/null
+++ b/cli/beacon-hooks/internal/cloudshuttle/asymptote_test.go
@@ -0,0 +1,226 @@
+package cloudshuttle
+
+import (
+ "compress/gzip"
+ "context"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync"
+ "testing"
+)
+
+type ingestCall struct {
+ auth, contentType, encoding, userAgent, path string
+ lines []string
+}
+
+func startFakeIngest(t *testing.T, status int) (*httptest.Server, *[]ingestCall) {
+ t.Helper()
+ var mu sync.Mutex
+ calls := &[]ingestCall{}
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ gz, err := gzip.NewReader(r.Body)
+ if err != nil {
+ t.Errorf("body is not gzip: %v", err)
+ w.WriteHeader(400)
+ return
+ }
+ raw, _ := io.ReadAll(gz)
+ mu.Lock()
+ *calls = append(*calls, ingestCall{
+ auth: r.Header.Get("Authorization"),
+ contentType: r.Header.Get("Content-Type"),
+ encoding: r.Header.Get("Content-Encoding"),
+ userAgent: r.Header.Get("User-Agent"),
+ path: r.URL.Path,
+ lines: strings.Split(strings.TrimRight(string(raw), "\n"), "\n"),
+ })
+ mu.Unlock()
+ w.WriteHeader(status)
+ _, _ = w.Write([]byte(`{"accepted":1}`))
+ }))
+ t.Cleanup(server.Close)
+ oldClient := httpClient
+ httpClient = server.Client()
+ t.Cleanup(func() { httpClient = oldClient })
+ return server, calls
+}
+
+func asymptoteConfig(t *testing.T, server *httptest.Server) Config {
+ t.Helper()
+ dir := t.TempDir()
+ return Config{
+ Upload: uploadAsymptote,
+ LogPath: filepath.Join(dir, "runtime.jsonl"),
+ StatePath: filepath.Join(dir, "state.json"),
+ IngestURL: server.URL,
+ DeviceKey: "bcn_device_test0000_" + strings.Repeat("k", 43),
+ Provider: "claude_code_web",
+ RunID: "run-1",
+ }
+}
+
+func appendLines(t *testing.T, path string, lines ...string) {
+ t.Helper()
+ f, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o644)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer f.Close()
+ for _, line := range lines {
+ if _, err := f.WriteString(line + "\n"); err != nil {
+ t.Fatal(err)
+ }
+ }
+}
+
+func TestConfigFromEnvSelectsAsymptote(t *testing.T) {
+ t.Setenv("BEACON_CLOUD_UPLOAD", "asymptote")
+ t.Setenv("BEACON_CLOUD_INGEST_URL", "https://ingest.example/")
+ t.Setenv("BEACON_CLOUD_DEVICE_KEY", "bcn_device_abc")
+ t.Setenv("BEACON_RUN_ID", "run-9")
+ cfg := normalizeConfig(ConfigFromEnv())
+ if cfg.Upload != uploadAsymptote || cfg.IngestURL != "https://ingest.example" || cfg.DeviceKey != "bcn_device_abc" {
+ t.Fatalf("unexpected config: %+v", cfg)
+ }
+ if !uploadConfigured(cfg) {
+ t.Fatal("asymptote target with https URL and device key should be configured without a bucket")
+ }
+}
+
+func TestAsymptoteTargetRefusesInsecureURLsAndForeignKeys(t *testing.T) {
+ base := Config{Upload: uploadAsymptote, DeviceKey: "bcn_device_x", IngestURL: "https://ingest.example"}
+ if !uploadConfigured(base) {
+ t.Fatal("baseline should be configured")
+ }
+ insecure := base
+ insecure.IngestURL = "http://ingest.example"
+ if uploadConfigured(insecure) {
+ t.Fatal("plain http to a remote host must not carry a device key")
+ }
+ loopback := base
+ loopback.IngestURL = "http://127.0.0.1:8080"
+ if !uploadConfigured(loopback) {
+ t.Fatal("plain http to loopback is allowed for local development")
+ }
+ foreign := base
+ foreign.DeviceKey = "ask_live_notadevicekey"
+ if uploadConfigured(foreign) {
+ t.Fatal("only bcn_device_ keys may be sent to managed ingest")
+ }
+}
+
+func TestUploadPostsOnlyNewLinesToManagedIngest(t *testing.T) {
+ server, calls := startFakeIngest(t, 200)
+ cfg := asymptoteConfig(t, server)
+ appendLines(t, cfg.LogPath, `{"event":1}`, `{"event":2}`)
+
+ if err := Upload(context.Background(), cfg, true); err != nil {
+ t.Fatalf("first upload: %v", err)
+ }
+ if len(*calls) != 1 {
+ t.Fatalf("expected one POST, got %d", len(*calls))
+ }
+ first := (*calls)[0]
+ if first.path != "/v1/ingest/runtime" || first.auth != "Bearer "+cfg.DeviceKey || first.contentType != "application/x-ndjson" || first.encoding != "gzip" || first.userAgent != "beacon-hooks-cloud" {
+ t.Fatalf("unexpected request shape: %+v", first)
+ }
+ if strings.Join(first.lines, "|") != `{"event":1}|{"event":2}` {
+ t.Fatalf("first batch lines = %v", first.lines)
+ }
+
+ // The next Stop ships only what was appended since, plus never a partial trailing line.
+ appendLines(t, cfg.LogPath, `{"event":3}`)
+ f, _ := os.OpenFile(cfg.LogPath, os.O_APPEND|os.O_WRONLY, 0o644)
+ _, _ = f.WriteString(`{"event":4,"partial":`)
+ _ = f.Close()
+ if err := Upload(context.Background(), cfg, true); err != nil {
+ t.Fatalf("second upload: %v", err)
+ }
+ if len(*calls) != 2 || strings.Join((*calls)[1].lines, "|") != `{"event":3}` {
+ t.Fatalf("second batch should carry only the new complete line: %+v", *calls)
+ }
+
+ // Nothing new: no request.
+ if err := Upload(context.Background(), cfg, true); err != nil {
+ t.Fatal(err)
+ }
+ if len(*calls) != 2 {
+ t.Fatalf("no new complete lines must mean no POST, got %d calls", len(*calls))
+ }
+}
+
+func TestUploadSplitsLargeLogsIntoBatchesUnderTheIngestLimits(t *testing.T) {
+ server, calls := startFakeIngest(t, 200)
+ cfg := asymptoteConfig(t, server)
+ old := asymptoteBatchLines
+ asymptoteBatchLines = 2
+ t.Cleanup(func() { asymptoteBatchLines = old })
+ appendLines(t, cfg.LogPath, `{"n":1}`, `{"n":2}`, `{"n":3}`, `{"n":4}`, `{"n":5}`)
+ if err := Upload(context.Background(), cfg, true); err != nil {
+ t.Fatal(err)
+ }
+ var sizes []int
+ for _, c := range *calls {
+ sizes = append(sizes, len(c.lines))
+ }
+ if len(sizes) != 3 || sizes[0] != 2 || sizes[1] != 2 || sizes[2] != 1 {
+ t.Fatalf("batches = %v, want 2,2,1", sizes)
+ }
+}
+
+func TestUploadKeepsTheOffsetWhenTheKeyIsRejected(t *testing.T) {
+ server, calls := startFakeIngest(t, 401)
+ cfg := asymptoteConfig(t, server)
+ appendLines(t, cfg.LogPath, `{"event":1}`)
+ err := Upload(context.Background(), cfg, true)
+ if err == nil || !strings.Contains(err.Error(), "401") {
+ t.Fatalf("expected a revoked-key error, got %v", err)
+ }
+ if _, statErr := os.Stat(cfg.StatePath); !os.IsNotExist(statErr) {
+ t.Fatal("a rejected batch must not advance the offset")
+ }
+ if len(*calls) != 1 {
+ t.Fatalf("calls = %d", len(*calls))
+ }
+}
+
+func TestUploadNoopsWithoutForceOrRunID(t *testing.T) {
+ server, calls := startFakeIngest(t, 200)
+ cfg := asymptoteConfig(t, server)
+ appendLines(t, cfg.LogPath, `{"event":1}`)
+ if err := Upload(context.Background(), cfg, false); err != nil || len(*calls) != 0 {
+ t.Fatalf("non-forced upload must not post: err=%v calls=%d", err, len(*calls))
+ }
+ cfg.RunID = ""
+ if err := Upload(context.Background(), cfg, true); err != nil || len(*calls) != 0 {
+ t.Fatalf("no run id must not post: err=%v calls=%d", err, len(*calls))
+ }
+}
+
+func TestSessionStartFlushesThePreviousRunsTailToManagedIngest(t *testing.T) {
+ server, calls := startFakeIngest(t, 200)
+ cfg := asymptoteConfig(t, server)
+ appendLines(t, cfg.LogPath, `{"event":1}`)
+ if err := Upload(context.Background(), cfg, true); err != nil {
+ t.Fatal(err)
+ }
+ appendLines(t, cfg.LogPath, `{"event":2}`) // written after the last Stop hook ran
+
+ // A new run starts in the same sandbox: only the unsent line goes out, then the log is cleared.
+ next := cfg
+ next.RunID = "run-2"
+ if err := preserveExistingLog(next); err != nil {
+ t.Fatal(err)
+ }
+ if len(*calls) != 2 || strings.Join((*calls)[1].lines, "|") != `{"event":2}` {
+ t.Fatalf("expected exactly the unsent tail to be flushed: %+v", *calls)
+ }
+ if _, err := os.Stat(cfg.LogPath); !os.IsNotExist(err) {
+ t.Fatal("the flushed log should be removed before the new run starts")
+ }
+}
diff --git a/cli/beacon-hooks/internal/cloudshuttle/shuttle.go b/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
index 0c166fd1..47118397 100644
--- a/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
+++ b/cli/beacon-hooks/internal/cloudshuttle/shuttle.go
@@ -61,6 +61,9 @@ type Config struct {
S3SecretKey string
S3SessionToken string
S3Endpoint string
+ // Asymptote managed ingest target (Upload == "asymptote").
+ IngestURL string
+ DeviceKey string
}
type serviceAccount struct {
@@ -109,6 +112,8 @@ func ConfigFromEnv() Config {
S3SecretKey: firstEnv("AWS_SECRET_ACCESS_KEY"),
S3SessionToken: firstEnv("AWS_SESSION_TOKEN"),
S3Endpoint: firstEnv("BEACON_CLOUD_S3_ENDPOINT"),
+ IngestURL: strings.TrimRight(firstEnv("BEACON_CLOUD_INGEST_URL"), "/"),
+ DeviceKey: firstEnv("BEACON_CLOUD_DEVICE_KEY"),
}
}
@@ -161,6 +166,9 @@ func Upload(ctx context.Context, cfg Config, force bool) error {
return err
}
defer cleanup()
+ if cfg.Upload == uploadAsymptote {
+ return uploadAsymptoteIncremental(ctx, cfg, snapshot, info.Size())
+ }
objectName := uploadObjectName(cfg)
if err := uploadSnapshot(ctx, cfg, objectName, snapshot); err != nil {
return err
@@ -563,7 +571,17 @@ func preserveExistingLog(cfg Config) error {
defer cleanup()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
- if uploadErr := uploadSnapshot(ctx, cfg, st.LastObject, snapshot); uploadErr == nil {
+ var uploadErr error
+ if cfg.Upload == uploadAsymptote {
+ // Ship whatever the previous run's last hook did not get to, under that run's
+ // identity so the stored offset applies and nothing is sent twice.
+ previous := cfg
+ previous.Provider, previous.RunID = st.Provider, st.RunID
+ uploadErr = uploadAsymptoteIncremental(ctx, previous, snapshot, info.Size())
+ } else {
+ uploadErr = uploadSnapshot(ctx, cfg, st.LastObject, snapshot)
+ }
+ if uploadErr == nil {
return os.Remove(cfg.LogPath)
}
}
@@ -586,6 +604,8 @@ func cloudUploadFromEnv() string {
return uploadS3
case uploadGCS:
return uploadGCS
+ case uploadAsymptote:
+ return uploadAsymptote
}
return uploadGCS
}
@@ -616,6 +636,9 @@ func normalizeConfig(cfg Config) Config {
}
func uploadConfigured(cfg Config) bool {
+ if cfg.Upload == uploadAsymptote {
+ return asymptoteConfigured(cfg)
+ }
if strings.TrimSpace(cfg.Bucket) == "" {
return false
}
diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdx
index 4916362a..0d12b257 100644
--- a/docs/changelog/cli.mdx
+++ b/docs/changelog/cli.mdx
@@ -11,6 +11,10 @@ Stay up to date with the latest changes to the Agent Beacon CLI.
## September 2026
+### Unreleased
+
+- **Cloud agents can send telemetry to Asymptote Managed** · Claude Code cloud sandboxes had two upload targets, a GCS or S3 bucket you own. `BEACON_CLOUD_UPLOAD=asymptote` with `BEACON_CLOUD_INGEST_URL` and a `BEACON_CLOUD_DEVICE_KEY` minted for the environment now posts the sandbox log to managed ingest, the same endpoint the laptop forwarder uses, so cloud-agent sessions appear in the dashboard beside endpoint sessions. New lines are sent on every Stop, in batches under the ingest limits; a revoked key is reported, never retried past the offset. See [Claude Code Cloud Agents](/runtimes/claude-code-cloud-agents).
+
### v1.3.3 · September 4, 2026
- **Homebrew installs Vector again** · `brew install asymptote-labs/tap/beacon` failed
diff --git a/docs/runtimes/claude-code-cloud-agents.mdx b/docs/runtimes/claude-code-cloud-agents.mdx
index ca2593dc..b17ee348 100644
--- a/docs/runtimes/claude-code-cloud-agents.mdx
+++ b/docs/runtimes/claude-code-cloud-agents.mdx
@@ -1,6 +1,6 @@
---
title: "Claude Code Cloud Agents"
-description: "Capture Claude Code cloud agent telemetry and forward cloud-agent runtime logs to customer-managed object storage"
+description: "Capture Claude Code cloud agent telemetry and send each session log to Asymptote Managed or to object storage you own"
---
<Frame>
@@ -14,43 +14,44 @@ description: "Capture Claude Code cloud agent telemetry and forward cloud-agent
## Overview
-Use this integration to capture Claude Code cloud-agent activity and upload each
-session log to your own Google Cloud Storage or Amazon S3 bucket. It is meant
-for testing cloud-agent telemetry without running a hosted Asymptote backend.
+Use this integration to capture Claude Code cloud-agent activity and send each
+session log to one of three places: [Asymptote Managed](/deployment/managed),
+where it appears in your dashboard next to your laptops' sessions, or a Google
+Cloud Storage or Amazon S3 bucket you own.
This flow depends on the Beacon CLI. You run `beacon cloud` commands from your
-workstation to create the object-storage upload path, print Claude environment
-variables, and generate the setup script that runs inside the Claude cloud
-sandbox.
-
-<Info>
- If you're interested in leveraging this telemetry ingest across your
- enterprise, [Asymptote Managed](/deployment/managed) is designed for
- production cloud-agent telemetry ingest at scale.
-</Info>
+workstation to create a bucket upload path if you want one, print Claude
+environment variables, and generate the setup script that runs inside the Claude
+cloud sandbox.
## How it works
Claude Code Cloud Agents run in Anthropic's cloud environment, so Beacon cannot
use the long-running endpoint agent that local installs use. Instead, the setup
script installs Beacon hooks inside the sandbox. During a cloud-agent session,
-those hooks write `/tmp/beacon/runtime.jsonl`; at the end of the session, Beacon
-uploads that file to customer-managed object storage.
+those hooks write `/tmp/beacon/runtime.jsonl`. When the agent stops, Beacon
+ships that file: to Asymptote Managed it posts the new lines to the same ingest
+endpoint the laptop forwarder uses, so the session shows up in the dashboard a
+minute or two later; to a bucket it uploads the whole file as one object.
```mermaid
flowchart LR
ClaudeWeb["Claude Code Cloud Agents"] --> Hooks["Beacon hooks in sandbox"]
Hooks --> RuntimeLog["/tmp/beacon/runtime.jsonl"]
- RuntimeLog --> Storage["Customer-managed GCS or S3 bucket"]
+ RuntimeLog --> Managed["Asymptote Managed ingest → dashboard"]
+ RuntimeLog --> Storage["Your GCS or S3 bucket"]
```
The setup has three parts:
-1. Create a dedicated GCS or S3 upload path with Beacon.
+1. Get a device key from Asymptote, or create a GCS or S3 upload path with Beacon.
2. Add Beacon cloud telemetry environment variables to the Claude Code cloud environment.
3. Paste a Beacon-generated setup script into the Claude cloud environment.
-Each Claude Code cloud agent session writes one readable JSONL object:
+With Asymptote Managed, the sessions land in the same per-organization tables as
+your endpoints' telemetry, attributed to the device you created for the cloud
+environment. With a bucket, each Claude Code cloud agent session writes one
+readable JSONL object:
```text
gs://<bucket>/<prefix>/runtime/date=YYYY-MM-DD/<timestamp>-claude_code_web-<claude_session_id>.jsonl.gz
@@ -71,6 +72,8 @@ s3://<bucket>/<prefix>/runtime/date=YYYY-MM-DD/<timestamp>-claude_code_web-<clau
create buckets, IAM users, inline IAM policies, and access keys.
- Claude Code cloud agent access for the repository you want to test.
- A Claude cloud environment with outbound access to:
+ - For Asymptote Managed: the ingest host from your device key hand-off
+ (currently `beacon-ingest-gulcylfs4a-uw.a.run.app`)
- For GCS: `oauth2.googleapis.com` and `storage.googleapis.com`
- For S3: `s3.<region>.amazonaws.com`
- `github.com`
@@ -100,7 +103,19 @@ aws sts get-caller-identity
## 1. Create the upload path
-Choose GCS or S3 for the cloud-agent session logs.
+Choose Asymptote Managed, GCS, or S3 for the cloud-agent session logs.
+
+### Asymptote Managed
+
+A cloud sandbox has no browser and no Vector, so it cannot run
+[`beacon endpoint connect`](/cli/endpoint-connect). Instead it authenticates with
+a device key that an Asymptote operator mints for the environment itself: one
+key per cloud environment, bound to your organization, listed on
+`/dashboard/endpoints` like any laptop and revocable from there. Ask your
+Asymptote contact for a key, naming the environment (for example
+"Claude Code web, acme/frontend"). You receive three values to put in the
+environment in step 2: `BEACON_CLOUD_UPLOAD=asymptote`, the ingest URL, and the
+key itself. Self-serve headless enrollment is on the roadmap.
### GCS
@@ -202,13 +217,13 @@ repository.
Set network access to **Custom** and allow:
```text
-s3.<region>.amazonaws.com
+beacon-ingest-gulcylfs4a-uw.a.run.app
github.com
*.githubusercontent.com
```
For GCS, allow `oauth2.googleapis.com` and `storage.googleapis.com` instead of
-the S3 regional hostname.
+the ingest host; for S3, allow `s3.<region>.amazonaws.com`.
Add these common environment variables:
@@ -219,6 +234,14 @@ BEACON_RUN_EPHEMERAL=true
BEACON_CLOUD_USER_ID_HASH=<stable-user-or-test-id>
```
+For Asymptote Managed, add:
+
+```bash
+BEACON_CLOUD_UPLOAD=asymptote
+BEACON_CLOUD_INGEST_URL=<ingest-url-from-asymptote>
+BEACON_CLOUD_DEVICE_KEY=<bcn_device_...-from-asymptote>
+```
+
For GCS, add:
```bash
@@ -280,6 +303,18 @@ Read the README, run pwd && ls, create a tiny temporary markdown note under /tmp
## 5. Verify upload
+For Asymptote Managed, open `/dashboard/endpoints`: the cloud environment's
+device shows a fresh **last seen** time as soon as the first batch is accepted,
+and the session appears on `/dashboard/telemetry` within a couple of minutes,
+with `run.provider=claude_code_web` and the Claude session id as the run id.
+To check the key itself from your workstation:
+
+```bash
+curl -sS -o /dev/null -w '%{http_code}\n' \
+ -H "Authorization: Bearer $BEACON_CLOUD_DEVICE_KEY" \
+ "$BEACON_CLOUD_INGEST_URL/v1/ingest/health" # 200 valid, 401 revoked
+```
+
For GCS, list the uploaded session objects:
```bash
@@ -328,11 +363,18 @@ run.run_id=cse_...
## Security note
+The Asymptote Managed flow puts a per-device key in the Claude Code environment.
+It can only append telemetry to your organization's ingest stream; it reads
+nothing and grants no dashboard access, and revoking the device on
+`/dashboard/endpoints` stops it within a minute. This is the one place a Beacon
+device key lives in an environment variable: a sandbox has no keychain and no
+secrets file to hold it, unlike a laptop, where the key stays in a `0600` file.
+
The self-serve GCS flow above creates a dedicated service account scoped to
object uploads for one bucket. The S3 flow creates a dedicated IAM user scoped
-to `s3:PutObject` under one prefix. Both flows store credentials in the Claude
-Code environment. This is useful for proof-of-concept testing, but treat those
-environment variables as sensitive credentials.
+to `s3:PutObject` under one prefix. All three flows store credentials in the
+Claude Code environment, so treat those environment variables as sensitive
+credentials.
Claude notes that cloud environment variables are visible to users of that
environment and recommends avoiding secrets there when possible. Avoid broad
@@ -341,6 +383,14 @@ before using this flow with sensitive telemetry.
## Troubleshooting
+### Nothing reaches the dashboard
+
+Run the health check from step 5. A `401` means the key was revoked or the
+approver left the organization; ask for a new key. A `200` with no sessions
+usually means the ingest host is not in the environment's allowed network
+domains, or the Stop hook did not run (the upload happens on Stop and
+SessionEnd). Beacon logs upload failures to the hook log with the HTTP status.
+
### The bucket is empty
Confirm the Claude setup script ran and generated hooks: