Skip to content

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

Add managed forwarding privacy modes

Justin D'Souza0a7295191d3a
diff --git a/CLAUDE.md b/CLAUDE.md
index f066f909..0457e206 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -24,9 +24,9 @@ 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.
-- `beacon login` is the account-identity channel for interactive users and is required by the interactive `beacon endpoint install` wizard. It uses browser PKCE against beacon.sh, stores the scoped CLI token only in `~/.beacon/auth/session.json` (0600 under a 0700 directory), and is separate from endpoint enrollment: signing in alone never starts forwarding or sends telemetry. System/root/package/MDM/CI/piped-stdin/dry-run installs stay noninteractive and account-free. Keep account credentials out of endpoint config, hook environments, logs, and command output.
-- Asymptote Managed forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint connect`, `beacon endpoint asymptote`) is opt-in and Vector-shaped: Beacon writes local JSONL, Vector ships new lines after browser approval, and the `bcn_device_*` key stays only in `<BaseDir>/asymptote/vector-secrets.json` via Vector's secret backend. Keep the ingest URL `https://`, the wire contract aligned with `beacon-ingest` (`/v1/ingest/{runtime,inventory}` and `/v1/ingest/health`), and do not add another endpoint network channel. The cloud-sandbox shuttle is the bounded exception: only with `BEACON_ORIGIN=cloud`, it can upload new runtime lines to GCS, S3, or the same Asymptote ingest contract because no Vector/service manager/browser/persistent disk exists there.
-- `beacon endpoint install` has a full-screen onboarding wizard on interactive user TTYs. It signs in, then preselects Beacon Managed and requires an explicit choice to opt out to Local; accepting Managed still only records intent and prints `beacon endpoint connect`, so no telemetry moves during onboarding. Explicit `install --connect` still enrolls after installation. The wizard is skipped for system/root/CI/piped-stdin/dry-run or `BEACON_ONBOARDING=0`; those unattended paths must never gain an account or browser dependency. Legacy `BEACON_ONBOARDING_EMAIL`/`USAGE` submissions remain only for fleet compatibility. Implementation lives in `cli/beacon/internal/onboarding` and `cli/beacon/cmd/endpoint_onboarding.go`; keep `docs/cli/endpoint-onboarding.mdx` in sync.
+- `beacon login` is the account-identity channel for interactive users and is required by the interactive `beacon endpoint install` wizard. It uses browser PKCE against beacon.sh and stores the scoped CLI token only in `~/.beacon/auth/session.json` (0600 under a 0700 directory). Signing in alone never starts forwarding. User-mode `beacon endpoint connect` may send that token once to `POST /api/cli/enroll/account` to authorize minting a separate device ingest key; never copy the account token into endpoint config, Vector, hook environments, logs, or command output. System/root/package/MDM/CI/piped-stdin/dry-run installs stay noninteractive and account-free.
+- Beacon Managed forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint connect`, `beacon endpoint asymptote`) is Vector-shaped: Beacon writes local JSONL, Vector ships only new lines after connection, and the `bcn_device_*` key stays only in `<BaseDir>/asymptote/vector-secrets.json` via Vector's secret backend. The onboarding wizard preselects Managed but connect remains a separate action. Standard mode ships locally sanitized retained content; metadata-only uses local Vector transforms to remove prompts, responses, reasoning, tool arguments/results, command output, raw fields, diffs, inventory content, and MCP definitions before buffering/upload. Keep the ingest URL `https://`, the wire contract aligned with `beacon-ingest` (`/v1/ingest/{runtime,inventory}` and `/v1/ingest/health`), and do not add another endpoint network channel. The cloud-sandbox shuttle is the bounded exception: only with `BEACON_ORIGIN=cloud`, it can upload new runtime lines to GCS, S3, or the same Beacon ingest contract because no Vector/service manager/browser/persistent disk exists there.
+- `beacon endpoint install` has a full-screen onboarding wizard on interactive user TTYs. It signs in, preselects Beacon Managed, requires an explicit choice to opt out to Local, and asks Managed users to choose Standard or Metadata-only privacy. Accepting Managed still only records intent and prints `beacon endpoint connect`, so no telemetry moves during onboarding. Explicit `install --connect` still enrolls after installation. The wizard is skipped for system/root/CI/piped-stdin/dry-run or `BEACON_ONBOARDING=0`; those unattended paths must never gain an account or browser dependency. Legacy `BEACON_ONBOARDING_EMAIL`/`USAGE` submissions remain only for fleet compatibility. Implementation lives in `cli/beacon/internal/onboarding` and `cli/beacon/cmd/endpoint_onboarding.go`; keep `docs/cli/endpoint-onboarding.mdx` in sync.
- 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.
- Keep destination support shaped like the existing local JSONL and customer-managed forwarding paths. Beacon may render supported packs or token-based endpoint forwarders, but should not add hosted SIEM dependencies or store third-party service credentials beyond the explicit supported configs. Elastic remains a file-tailing pack over local JSONL.
@@ -56,7 +56,7 @@ Supported runtime surfaces today:
- Browser chat telemetry through an optional Chrome MV3 extension (`browser-extension/`) covering claude.ai and chatgpt.com. A main-world interceptor tees the streamed response, a per-site adapter parses it into a normalized turn, and the service worker POSTs OTLP GenAI logs to the local collector on `127.0.0.1:4318`; the extension never writes files and never contacts a remote endpoint. `harness.name` resolves to `claude_web` or `chatgpt_web` (already handled by `NormalizeHarnessName` in `pkg/asymptoteobserve/harness.go`, where the browser cases must stay above the generic `claude` rule) and `harness.collection_method` is `otlp`. Scope is deliberately narrow: only those origins' chat streams, never other tabs or general browsing. Retention defaults to `full`, so prompt and response text is retained by default; this is documented rather than defaulted down, because browser chat telemetry without content has no investigative value. Treat the adapters as experimental, since both sites' stream formats are private and undocumented.
- `beaconjson` OpenTelemetry Collector exporter that converts OTLP logs, traces, metrics, and resource attributes into Beacon endpoint JSONL.
- Endpoint inventory (`inventory.heartbeat` / `inventory.snapshot` in `inventory_state.jsonl`) is written by a scheduled job, `com.beacon.endpoint.inventory` (`service.InventoryManager`, user LaunchAgent or system LaunchDaemon, `beacon-inventory.timer` on systemd), every six hours and once at load, on by default and reconciled by `lifecycle.ReconcileInventoryJob` on every install, repair and package upgrade (`beacon endpoint inventory install-daemon`). Agent hooks do not trigger inventory any more; the hook binary's `--cli` flag and `inventory-heartbeat` subcommand survive only as no-ops for hook commands written by older versions, and `beacon endpoint inventory heartbeat --trigger hook` is likewise retired. A system-mode run inventories the active console user's home and still writes the liveness heartbeat when nobody is logged in; the scheduled scan has no working directory, so project-scoped config is only in `beacon endpoint inventory`.
-- Asymptote Managed forwarding, the one opt-in network channel for telemetry: `beacon endpoint connect` (`cli/beacon/cmd/endpoint_connect.go`, `cli/beacon/internal/endpoint/asymptote`) runs a browser PKCE approval against the dashboard's `/cli/enroll` page, stores the per-device key in `<BaseDir>/asymptote/vector-secrets.json` (0600, 0700 dir), renders the `asymptote` pack into `vector.toml`, validates it, and runs Vector as `com.beacon.endpoint.asymptote-forwarder` / `beacon-asymptote-forwarder.service` through `service.ForwarderManager` (user or system mode; refused in supervised mode). `enrollment.json` and `config.json`'s `managed_ingest` block carry only non-secret identity; `beacon endpoint status` reports forwarder state and a live credential check (`GET /v1/ingest/health`, 3 s timeout); `disconnect` and `uninstall` remove the forwarder and credentials but never revoke server-side.
+- Beacon Managed forwarding, the one Beacon-hosted network channel for endpoint telemetry: user-mode `beacon endpoint connect` authorizes device enrollment with the signed-in CLI account; system mode uses browser PKCE at `/cli/enroll`. Both store only the per-device key in `<BaseDir>/asymptote/vector-secrets.json` (0600, 0700 dir), render the selected privacy mode into `vector.toml`, validate it, and run Vector as `com.beacon.endpoint.asymptote-forwarder` / `beacon-asymptote-forwarder.service` through `service.ForwarderManager` (refused in supervised mode). `enrollment.json` and `config.json`'s `managed_ingest` block carry only non-secret identity and privacy mode; `beacon endpoint status` reports forwarder state and a live credential check (`GET /v1/ingest/health`, 3 s timeout); `disconnect` and `uninstall` remove the forwarder and credentials but never revoke server-side.
- Asymptote Observe TypeScript SDK instrumentation for cloud applications, starting from OpenTelemetry/OpenLLMetry patterns and `observe()` wrappers.
- Elasticsearch/Filebeat content pack generation for forwarding local Beacon JSONL into customer-managed Elastic deployments or the bundled loopback-only development stack.
- A local-only dashboard served by `beacon endpoint dashboard`, bound to loopback by default and backed by the runtime JSONL log.
diff --git a/README.md b/README.md
index 2d0aa1ff..ffa15dcb 100644
--- a/README.md
+++ b/README.md
@@ -124,7 +124,7 @@ Or inspect the raw event stream:
```
> [!NOTE]
-> Local by default: signing in does not enable forwarding, and nothing leaves your machine unless you configure it to.
+> Local until connected: signing in or accepting the preselected Managed option does not enable forwarding. The separate connect step offers Standard or Metadata-only upload privacy.
Inspect the account used during interactive setup:
@@ -299,6 +299,7 @@ You can also forward the same normalized session history into infrastructure you
| Destination | Category | Support Path |
| --- | --- | --- |
| Local JSONL | Local | Default endpoint log and local dashboard source |
+| Beacon Managed | Hosted forwarding | Signed-in device enrollment with Standard or Metadata-only privacy |
| CrowdStrike Falcon LogScale HEC | SIEM | Endpoint forwarding with LogScale ingest tokens |
| Microsoft Sentinel | SIEM | Azure Monitor Agent and Data Collection Rule content pack |
| Rapid7 InsightIDR | SIEM | Custom Logs webhook content pack |
diff --git a/cli/beacon/README.md b/cli/beacon/README.md
index 9b2c582e..cfb3194e 100644
--- a/cli/beacon/README.md
+++ b/cli/beacon/README.md
@@ -512,7 +512,7 @@ and a `BeaconRuntime_CL` custom Log Analytics table. Store Azure workspace,
DCR, endpoint, and credential details in Azure or customer-managed deployment
tooling, not in Beacon endpoint configuration.
-## Asymptote Managed
+## Beacon Managed
```bash
./beacon endpoint connect
@@ -520,14 +520,16 @@ tooling, not in Beacon endpoint configuration.
./beacon endpoint disconnect
```
-Asymptote Managed is the one destination that forwards telemetry to an
-Asymptote-run service, and it is opt-in. `beacon endpoint connect` opens the
-Asymptote dashboard so a member of your organization can approve this device,
-stores the per-device key in a `0600` secrets file, and runs Vector as the
+Beacon Managed is the Beacon-hosted forwarding destination. User-mode connect
+uses the signed-in account to authorize a separate device key; system mode keeps
+browser approval. The account token is never given to Vector. Connect stores the
+device key in a `0600` secrets file and runs Vector as the
`com.beacon.endpoint.asymptote-forwarder` (launchd) or
`beacon-asymptote-forwarder.service` (systemd) service. Beacon stays the local
-JSONL producer and Vector does the network. Only lines written after approval
-are shipped, and revoking the device from the dashboard stops ingestion within
+JSONL producer and Vector does the network. Standard privacy forwards locally
+sanitized retained content; `--privacy-mode metadata-only` strips retained text,
+raw fields, diffs, inventory content, and MCP definitions locally before upload.
+Only lines written after connection are shipped, and revoking the device stops ingestion within
about a minute. Vector 0.50 or newer is required: `/opt/beacon/bin/vector` from
the signed package, the `beacon-vector` keg that `brew install beacon` pulls in on
macOS, any other Vector 0.50+ already on the machine, or the Linux package from
diff --git a/cli/beacon/cmd/endpoint_connect.go b/cli/beacon/cmd/endpoint_connect.go
index c96b0e16..97a23c3f 100644
--- a/cli/beacon/cmd/endpoint_connect.go
+++ b/cli/beacon/cmd/endpoint_connect.go
@@ -3,17 +3,22 @@ package cmd
import (
"context"
"encoding/json"
+ "errors"
"fmt"
"os"
"os/exec"
"runtime"
"strings"
+ "time"
"github.com/spf13/cobra"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/account"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/asymptote"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/lifecycle"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/onboarding"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/version"
)
@@ -22,18 +27,23 @@ var connectOpts struct {
noBrowser bool
vectorBin string
keepCredentials bool
+ privacyMode string
}
+var (
+ connectAccountLoad = account.Load
+ connectManagedEndpoint = asymptote.Connect
+)
+
var endpointConnectCmd = &cobra.Command{
Use: "connect",
- Short: "Forward this endpoint's telemetry to Asymptote managed ingest",
- Long: `Connect this endpoint to Asymptote managed ingest.
+ Short: "Forward this endpoint's telemetry to Beacon Managed",
+ Long: `Connect this endpoint to Beacon Managed.
-Opens the Asymptote dashboard so a member of your organization can approve this
-device, then stores the per-device key it receives in a private secrets file
-and starts a Vector forwarder that ships the runtime and inventory JSONL to
-Asymptote. Nothing recorded before approval is sent. Re-running on a connected
-machine rotates its key in place.
+For a user endpoint, uses the signed-in Beacon account to mint a device-specific
+ingest key, stores that key in a private secrets file, and starts a Vector
+forwarder. The account token is never given to Vector or copied into endpoint
+configuration. System mode retains browser device approval.
Requires Vector 0.50 or newer: the signed macOS package installs it at
/opt/beacon/bin/vector, Homebrew provides it as "vector", and Linux packages are
@@ -60,9 +70,10 @@ func init() {
addEndpointPathFlags(c)
c.Flags().BoolVar(&endpointOpts.jsonOutput, "json", false, "Print output as JSON")
}
- endpointConnectCmd.Flags().StringVar(&connectOpts.dashboardURL, "dashboard-url", "", "Asymptote dashboard URL (defaults to "+auth.DefaultDashboardURL+", or "+auth.DashboardURLEnv+")")
- endpointConnectCmd.Flags().BoolVar(&connectOpts.noBrowser, "no-browser", false, "Print the approval URL instead of opening a browser")
+ endpointConnectCmd.Flags().StringVar(&connectOpts.dashboardURL, "dashboard-url", "", "Beacon service URL (defaults to "+auth.DefaultDashboardURL+", or "+auth.DashboardURLEnv+")")
+ endpointConnectCmd.Flags().BoolVar(&connectOpts.noBrowser, "no-browser", false, "System mode: print the device approval URL instead of opening a browser")
endpointConnectCmd.Flags().StringVar(&connectOpts.vectorBin, "vector-bin", "", "Vector binary to run (defaults to "+asymptote.VectorBinEnv+", "+asymptote.PackagedVectorPath+", Homebrew, then PATH)")
+ endpointConnectCmd.Flags().StringVar(&connectOpts.privacyMode, "privacy-mode", "", "Managed forwarding privacy: standard or metadata-only (defaults to onboarding choice)")
endpointDisconnectCmd.Flags().BoolVar(&connectOpts.keepCredentials, "keep-credentials", false, "Keep the enrollment record and device key so a later connect can reuse this device")
endpointCmd.AddCommand(endpointConnectCmd)
endpointCmd.AddCommand(endpointDisconnectCmd)
@@ -85,11 +96,16 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string) error {
if endpointOpts.jsonOutput {
out = cmd.ErrOrStderr()
}
- result, err := asymptote.Connect(context.Background(), asymptote.ConnectOptions{
- UserMode: userMode,
- LogPath: logPath,
- VectorBin: connectOpts.vectorBin,
- Out: out,
+ privacyMode, err := selectedManagedPrivacyMode(userMode)
+ if err != nil {
+ return err
+ }
+ options := asymptote.ConnectOptions{
+ UserMode: userMode,
+ LogPath: logPath,
+ VectorBin: connectOpts.vectorBin,
+ PrivacyMode: privacyMode,
+ Out: out,
Enroll: asymptote.EnrollOptions{
DashboardURL: connectOpts.dashboardURL,
NoBrowser: connectOpts.noBrowser,
@@ -101,19 +117,45 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string) error {
BeaconVersion: version.GetVersion(),
},
},
- })
+ }
+ if userMode {
+ session, err := connectAccountLoad()
+ if err != nil {
+ return fmt.Errorf("Beacon account sign-in is required: run `beacon login` first: %w", err)
+ }
+ if session.Expired(time.Now()) {
+ return errors.New("Beacon account session expired: run `beacon login` again")
+ }
+ if !hasAccountScope(session.Scopes, account.ScopeDeviceEnroll) {
+ return fmt.Errorf("Beacon account session lacks %s: run `beacon login` again", account.ScopeDeviceEnroll)
+ }
+ requestedDashboard := connectOpts.dashboardURL
+ if requestedDashboard == "" {
+ requestedDashboard = os.Getenv(auth.DashboardURLEnv)
+ }
+ if requestedDashboard != "" && auth.NormalizeDashboardURL(requestedDashboard) != auth.NormalizeDashboardURL(session.BaseURL) {
+ return errors.New("--dashboard-url must match the signed-in Beacon account service")
+ }
+ options.Enroll.DashboardURL = session.BaseURL
+ options.AccountEnroll = &asymptote.AccountEnrollOptions{
+ BaseURL: session.BaseURL,
+ AccessToken: session.AccessToken,
+ }
+ }
+ result, err := connectManagedEndpoint(context.Background(), options)
if err != nil {
return err
}
if endpointOpts.jsonOutput {
return json.NewEncoder(os.Stdout).Encode(result)
}
- fmt.Fprintf(out, "Connected to Asymptote as device %s", result.Enrollment.DeviceID)
+ fmt.Fprintf(out, "Connected to Beacon Managed as device %s", result.Enrollment.DeviceID)
if result.Enrollment.OrganizationName != "" {
fmt.Fprintf(out, " for %s", result.Enrollment.OrganizationName)
}
fmt.Fprintln(out)
fmt.Fprintf(out, "Forwarder: %s (loaded=%t running=%t)\n", result.Forwarder, result.ForwarderState.Loaded, result.ForwarderState.Running)
+ fmt.Fprintf(out, "Managed privacy: %s\n", managedprivacy.Label(result.Enrollment.PrivacyMode))
fmt.Fprintf(out, "Vector config: %s\n", result.VectorConfig)
fmt.Fprintf(out, "Device key: %s (never printed; the Vector forwarder reads it)\n", result.SecretsFile)
fmt.Fprintf(out, "Events recorded from now on appear on %s/dashboard/telemetry. Revoke this device from %s/dashboard/endpoints.\n",
@@ -121,6 +163,31 @@ func connectEndpoint(cmd *cobra.Command, userMode bool, logPath string) error {
return nil
}
+func selectedManagedPrivacyMode(userMode bool) (string, error) {
+ if connectOpts.privacyMode != "" {
+ return managedprivacy.Normalize(connectOpts.privacyMode)
+ }
+ if enrollment, err := asymptote.LoadEnrollment(userMode); err == nil && enrollment.PrivacyMode != "" {
+ return managedprivacy.Normalize(enrollment.PrivacyMode)
+ }
+ if userMode {
+ profile := onboarding.Load()
+ if profile.Onboarding.PrivacyMode != "" {
+ return managedprivacy.Normalize(profile.Onboarding.PrivacyMode)
+ }
+ }
+ return managedprivacy.Standard, nil
+}
+
+func hasAccountScope(scopes []string, target string) bool {
+ for _, scope := range scopes {
+ if scope == target {
+ return true
+ }
+ }
+ return false
+}
+
func runEndpointDisconnect(cmd *cobra.Command, args []string) error {
userMode := endpointUserMode()
if !userMode && !lifecycle.HasSystemPrivileges() {
@@ -196,17 +263,20 @@ func connectBrowserOpener(userMode bool) func(string) error {
func managedIngestStatusLine(status asymptote.ManagedIngestStatus) string {
if !status.Enabled {
if status.Message != "" {
- return "Asymptote managed ingest: not connected (" + status.Message + ")"
+ return "Beacon Managed: not connected (" + status.Message + ")"
}
- return "Asymptote managed ingest: not connected (run `beacon endpoint connect`)"
+ return "Beacon Managed: not connected (run `beacon endpoint connect`)"
}
var b strings.Builder
- b.WriteString("Asymptote managed ingest: connected")
+ b.WriteString("Beacon Managed: connected")
if status.OrganizationName != "" {
fmt.Fprintf(&b, " to %s", status.OrganizationName)
}
fmt.Fprintf(&b, " as device %s", status.DeviceID)
fmt.Fprintf(&b, "; forwarder loaded=%t running=%t", status.Forwarder.Loaded, status.Forwarder.Running)
+ if status.PrivacyMode != "" {
+ fmt.Fprintf(&b, "; privacy %s", managedprivacy.Label(status.PrivacyMode))
+ }
switch status.Credential {
case "valid":
b.WriteString("; credential valid")
diff --git a/cli/beacon/cmd/endpoint_connect_test.go b/cli/beacon/cmd/endpoint_connect_test.go
index 84e4786b..74d19990 100644
--- a/cli/beacon/cmd/endpoint_connect_test.go
+++ b/cli/beacon/cmd/endpoint_connect_test.go
@@ -1,11 +1,20 @@
package cmd
import (
+ "bytes"
+ "context"
+ "errors"
"strings"
"testing"
+ "time"
+ "github.com/spf13/cobra"
+
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/account"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/asymptote"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/onboarding"
)
func TestEndpointConnectAndDisconnectCommandsRegistered(t *testing.T) {
@@ -21,7 +30,7 @@ func TestEndpointConnectAndDisconnectCommandsRegistered(t *testing.T) {
}
}
connect, _, _ := endpointCmd.Find([]string{"connect"})
- for _, flag := range []string{"dashboard-url", "no-browser", "vector-bin"} {
+ for _, flag := range []string{"dashboard-url", "no-browser", "vector-bin", "privacy-mode"} {
if connect.Flags().Lookup(flag) == nil {
t.Fatalf("connect missing --%s", flag)
}
@@ -49,8 +58,9 @@ func TestManagedIngestStatusLine(t *testing.T) {
Forwarder: service.Status{Loaded: true, Running: true},
Credential: "valid",
BufferBytes: 3 * 1024 * 1024,
+ PrivacyMode: managedprivacy.MetadataOnly,
})
- for _, want := range []string{"connected to Asymptote Test as device dev-1", "forwarder loaded=true running=true", "credential valid", "buffer 3.0 MiB"} {
+ for _, want := range []string{"connected to Asymptote Test as device dev-1", "forwarder loaded=true running=true", "credential valid", "buffer 3.0 MiB", "privacy Metadata only"} {
if !strings.Contains(connected, want) {
t.Fatalf("connected line missing %q: %s", want, connected)
}
@@ -68,6 +78,101 @@ func TestManagedIngestStatusLine(t *testing.T) {
}
}
+func TestConnectUsesSignedInAccountAndSelectedPrivacy(t *testing.T) {
+ originalLoad, originalConnect := connectAccountLoad, connectManagedEndpoint
+ originalConnectOpts, originalEndpointOpts := connectOpts, endpointOpts
+ t.Cleanup(func() {
+ connectAccountLoad, connectManagedEndpoint = originalLoad, originalConnect
+ connectOpts, endpointOpts = originalConnectOpts, originalEndpointOpts
+ })
+ connectOpts.privacyMode = "metadata-only"
+ connectAccountLoad = func() (*account.Session, error) {
+ return &account.Session{
+ BaseURL: "https://beacon.sh",
+ AccessToken: "bcn_cli_secret",
+ ExpiresAt: time.Now().Add(time.Hour),
+ Scopes: []string{account.ScopeProfileRead, account.ScopeDeviceEnroll},
+ User: account.User{ID: "usr_1", Email: "[email protected]"},
+ }, nil
+ }
+ var captured asymptote.ConnectOptions
+ connectManagedEndpoint = func(_ context.Context, options asymptote.ConnectOptions) (*asymptote.ConnectResult, error) {
+ captured = options
+ return &asymptote.ConnectResult{
+ Enrollment: asymptote.Enrollment{
+ DeviceID: "dev-1", DashboardURL: "https://beacon.sh", PrivacyMode: options.PrivacyMode,
+ },
+ Forwarder: "test",
+ ForwarderState: service.Status{Loaded: true, Running: true},
+ VectorConfig: "/tmp/vector.toml",
+ SecretsFile: "/tmp/secrets.json",
+ }, nil
+ }
+ var out bytes.Buffer
+ command := &cobra.Command{}
+ command.SetOut(&out)
+ command.SetErr(&out)
+ if err := connectEndpoint(command, true, "/tmp/runtime.jsonl"); err != nil {
+ t.Fatalf("connectEndpoint returned error: %v", err)
+ }
+ if captured.AccountEnroll == nil || captured.AccountEnroll.AccessToken != "bcn_cli_secret" {
+ t.Fatalf("account enrollment = %#v", captured.AccountEnroll)
+ }
+ if captured.PrivacyMode != managedprivacy.MetadataOnly {
+ t.Fatalf("privacy mode = %q", captured.PrivacyMode)
+ }
+ if strings.Contains(out.String(), "bcn_cli_secret") || !strings.Contains(out.String(), "Managed privacy: Metadata only") {
+ t.Fatalf("output = %q", out.String())
+ }
+}
+
+func TestConnectRequiresSignedInAccountInUserMode(t *testing.T) {
+ originalLoad, originalConnect := connectAccountLoad, connectManagedEndpoint
+ t.Cleanup(func() {
+ connectAccountLoad, connectManagedEndpoint = originalLoad, originalConnect
+ })
+ connectAccountLoad = func() (*account.Session, error) { return nil, account.ErrNotSignedIn }
+ connectManagedEndpoint = func(context.Context, asymptote.ConnectOptions) (*asymptote.ConnectResult, error) {
+ return nil, errors.New("must not run")
+ }
+ command := &cobra.Command{}
+ err := connectEndpoint(command, true, "/tmp/runtime.jsonl")
+ if err == nil || !strings.Contains(err.Error(), "beacon login") {
+ t.Fatalf("error = %v", err)
+ }
+}
+
+func TestSelectedManagedPrivacyModePrefersFlagThenActiveEnrollment(t *testing.T) {
+ home := t.TempDir()
+ t.Setenv("HOME", home)
+ originalOpts := connectOpts
+ t.Cleanup(func() { connectOpts = originalOpts })
+ if err := onboarding.Save(onboarding.Profile{Onboarding: onboarding.Onboarding{
+ CompletedAt: "2026-09-21T08:00:00Z",
+ Destination: onboarding.DestinationAsymptote,
+ PrivacyMode: managedprivacy.Standard,
+ }}); err != nil {
+ t.Fatal(err)
+ }
+ if err := asymptote.SaveEnrollment(true, asymptote.Enrollment{
+ InstallID: "install-1",
+ IngestURL: "https://ingest.beacon.sh",
+ DeviceID: "dev-1",
+ PrivacyMode: managedprivacy.MetadataOnly,
+ }); err != nil {
+ t.Fatal(err)
+ }
+ got, err := selectedManagedPrivacyMode(true)
+ if err != nil || got != managedprivacy.MetadataOnly {
+ t.Fatalf("active enrollment mode = %q, %v", got, err)
+ }
+ connectOpts.privacyMode = managedprivacy.Standard
+ got, err = selectedManagedPrivacyMode(true)
+ if err != nil || got != managedprivacy.Standard {
+ t.Fatalf("flag mode = %q, %v", got, err)
+ }
+}
+
func TestHumanBytes(t *testing.T) {
cases := map[int64]string{0: "0 B", 512: "512 B", 1024: "1.0 KiB", 1536: "1.5 KiB", 536870912: "512.0 MiB"}
for in, want := range cases {
diff --git a/cli/beacon/cmd/endpoint_onboarding.go b/cli/beacon/cmd/endpoint_onboarding.go
index 148ee124..64b9e431 100644
--- a/cli/beacon/cmd/endpoint_onboarding.go
+++ b/cli/beacon/cmd/endpoint_onboarding.go
@@ -11,6 +11,7 @@ import (
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/account"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/asymptote"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/onboarding"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/version"
"github.com/spf13/cobra"
@@ -130,6 +131,7 @@ func runAccountOnboarding(cmd *cobra.Command, profile *onboarding.Profile, desti
OfferManaged: managedIngestEnabledByEnv(),
DestinationOnly: destinationOnly,
PresetDestination: preset,
+ PresetPrivacyMode: profile.Onboarding.PrivacyMode,
}
result, err := onboardingRunWizard(onboardingStdin, cmd.OutOrStdout(), options)
if err != nil {
@@ -161,6 +163,13 @@ func runAccountOnboarding(cmd *cobra.Command, profile *onboarding.Profile, desti
}
recordedDestination := result.Destination
+ privacyMode := ""
+ if result.Destination == onboarding.DestinationAsymptote {
+ privacyMode, err = managedprivacy.Normalize(result.PrivacyMode)
+ if err != nil {
+ return false, err
+ }
+ }
connectAfterInstall := endpointOpts.connect && result.Destination == onboarding.DestinationAsymptote
if connectAfterInstall {
// Explicit --connect still records managed only after device enrollment
@@ -174,10 +183,12 @@ func runAccountOnboarding(cmd *cobra.Command, profile *onboarding.Profile, desti
Email: status.User.Email,
BeaconVersion: version.GetVersion(),
Destination: recordedDestination,
+ PrivacyMode: privacyMode,
}
profile.Pending = nil
} else {
profile.Onboarding.Destination = recordedDestination
+ profile.Onboarding.PrivacyMode = privacyMode
}
if _, err := onboarding.EnsureInstallID(profile); err != nil {
return false, fmt.Errorf("create onboarding install id: %w", err)
@@ -187,7 +198,7 @@ func runAccountOnboarding(cmd *cobra.Command, profile *onboarding.Profile, desti
}
if result.Destination == onboarding.DestinationAsymptote && !connectAfterInstall {
- fmt.Fprintln(cmd.OutOrStdout(), "Beacon Managed selected. After installation, run `beacon endpoint connect`.")
+ fmt.Fprintf(cmd.OutOrStdout(), "Beacon Managed selected with %s privacy. After installation, run `beacon endpoint connect`.\n", managedprivacy.Label(privacyMode))
} else if result.Destination == onboarding.DestinationLocal {
fmt.Fprintln(cmd.OutOrStdout(), "Local-only telemetry selected. Open it with `beacon traces`.")
}
@@ -432,6 +443,7 @@ type endpointOnboardingStatus struct {
InstallID string `json:"install_id,omitempty"`
BeaconVersion string `json:"beacon_version,omitempty"`
Destination string `json:"destination,omitempty"`
+ PrivacyMode string `json:"privacy_mode,omitempty"`
Pending bool `json:"pending_submission"`
SkipReason string `json:"skip_reason,omitempty"`
ProfilePath string `json:"profile_path"`
@@ -471,6 +483,7 @@ func runEndpointOnboarding(cmd *cobra.Command, args []string) error {
InstallID: profile.InstallID,
BeaconVersion: profile.Onboarding.BeaconVersion,
Destination: profile.Onboarding.Destination,
+ PrivacyMode: profile.Onboarding.PrivacyMode,
Pending: profile.Pending != nil,
SkipReason: reason,
ProfilePath: onboarding.Path(),
@@ -498,6 +511,9 @@ func runEndpointOnboarding(cmd *cobra.Command, args []string) error {
if status.Destination != "" {
fmt.Fprintf(out, "Telemetry destination: %s\n", destinationLabel(status.Destination))
}
+ if status.PrivacyMode != "" {
+ fmt.Fprintf(out, "Managed privacy: %s\n", managedprivacy.Label(status.PrivacyMode))
+ }
fmt.Fprintf(out, "Install ID: %s\n", status.InstallID)
fmt.Fprintf(out, "Profile: %s\n", status.ProfilePath)
if status.Outcome != onboarding.OutcomeAuthenticated {
diff --git a/cli/beacon/cmd/endpoint_onboarding_test.go b/cli/beacon/cmd/endpoint_onboarding_test.go
index 58bac1b9..2eb32151 100644
--- a/cli/beacon/cmd/endpoint_onboarding_test.go
+++ b/cli/beacon/cmd/endpoint_onboarding_test.go
@@ -40,6 +40,7 @@ type onboardingHarness struct {
accountStatus account.Status
loginRuns int
loginErr error
+ wizardPrivacyMode string
}
func newOnboardingHarness(t *testing.T) *onboardingHarness {
@@ -122,7 +123,7 @@ func newOnboardingHarness(t *testing.T) *onboardingHarness {
destination = onboarding.DestinationAsymptote
}
}
- return onboarding.WizardResult{Completed: true, Destination: destination}, nil
+ return onboarding.WizardResult{Completed: true, Destination: destination, PrivacyMode: h.wizardPrivacyMode}, nil
}
onboardingAccountInspect = func(time.Time) account.Status { return h.accountStatus }
onboardingAccountLogin = func(context.Context, account.LoginOptions) (*account.Session, error) {
@@ -623,6 +624,7 @@ func TestMaybeRunOnboardingRecordsLocalOrManagedIntent(t *testing.T) {
h.askable = true
h.answers.DestinationAsked = true
h.answers.Destination = onboarding.DestinationAsymptote
+ h.wizardPrivacyMode = "metadata-only"
connect, err := maybeRunOnboarding(h.cmd)
if err != nil || connect {
t.Fatalf("managed intent should leave connect as a separate step: connect=%t err=%v", connect, err)
@@ -742,6 +744,7 @@ func TestManagedDestinationIsRecordedAsIntent(t *testing.T) {
h.askable = true
h.answers.DestinationAsked = true
h.answers.Destination = onboarding.DestinationAsymptote
+ h.wizardPrivacyMode = "metadata-only"
if connect, err := maybeRunOnboarding(h.cmd); err != nil || connect {
t.Fatalf("connect=%t err=%v", connect, err)
}
@@ -749,6 +752,9 @@ func TestManagedDestinationIsRecordedAsIntent(t *testing.T) {
if afterPrompt.Onboarding.Destination != onboarding.DestinationAsymptote {
t.Fatalf("managed intent = %q", afterPrompt.Onboarding.Destination)
}
+ if afterPrompt.Onboarding.PrivacyMode != "metadata_only" {
+ t.Fatalf("managed privacy = %q", afterPrompt.Onboarding.PrivacyMode)
+ }
if !strings.Contains(h.stdout.String(), "beacon endpoint connect") {
t.Fatalf("managed next step missing: %s", h.stdout.String())
}
@@ -820,4 +826,18 @@ func TestEndpointOnboardingShowsDestination(t *testing.T) {
if strings.Contains(h.stdout.String(), "Telemetry destination") {
t.Fatalf("no destination line before the question is answered:\n%s", h.stdout.String())
}
+
+ h = newOnboardingHarness(t)
+ h.loaded = onboarding.Profile{InstallID: "abc", Onboarding: onboarding.Onboarding{
+ CompletedAt: "2026-09-21T08:00:00Z",
+ Outcome: onboarding.OutcomeAuthenticated,
+ Destination: onboarding.DestinationAsymptote,
+ PrivacyMode: "metadata_only",
+ }}
+ if err := runEndpointOnboarding(h.cmd, nil); err != nil {
+ t.Fatal(err)
+ }
+ if !strings.Contains(h.stdout.String(), "Managed privacy: Metadata only") {
+ t.Fatalf("privacy missing:\n%s", h.stdout.String())
+ }
}
diff --git a/cli/beacon/internal/auth/dashboard.go b/cli/beacon/internal/auth/dashboard.go
index 47a7763c..77e5b1b5 100644
--- a/cli/beacon/internal/auth/dashboard.go
+++ b/cli/beacon/internal/auth/dashboard.go
@@ -21,7 +21,7 @@ import (
)
const (
- DefaultDashboardURL = "https://asymptotelabs.ai"
+ DefaultDashboardURL = "https://beacon.sh"
DashboardURLEnv = "BEACON_DASHBOARD_URL"
// AuthTimeout bounds how long a command waits for the browser step.
AuthTimeout = 5 * time.Minute
diff --git a/cli/beacon/internal/endpoint/asymptote/account_enroll.go b/cli/beacon/internal/endpoint/asymptote/account_enroll.go
new file mode 100644
index 00000000..a3a650cc
--- /dev/null
+++ b/cli/beacon/internal/endpoint/asymptote/account_enroll.go
@@ -0,0 +1,95 @@
+package asymptote
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "strings"
+ "time"
+)
+
+const AccountEnrollPath = "/api/cli/enroll/account"
+
+type AccountEnrollOptions struct {
+ BaseURL string
+ AccessToken string
+ Device DeviceInfo
+ HTTPClient *http.Client
+}
+
+type accountEnrollRequest struct {
+ Device DeviceInfo `json:"device"`
+}
+
+// EnrollAccount uses a signed-in CLI identity to mint a device-specific ingest
+// credential. The account token authorizes enrollment but is never returned,
+// persisted in endpoint state, or exposed to Vector.
+func EnrollAccount(ctx context.Context, opts AccountEnrollOptions) (*EnrollResult, error) {
+ baseURL := strings.TrimRight(strings.TrimSpace(opts.BaseURL), "/")
+ if !IsSecureURL(baseURL) {
+ return nil, fmt.Errorf("account enrollment URL must use https://: %s", baseURL)
+ }
+ if !strings.HasPrefix(opts.AccessToken, "bcn_cli_") {
+ return nil, errors.New("account enrollment needs a Beacon CLI access token")
+ }
+ if opts.Device.InstallID == "" {
+ return nil, errors.New("account enrollment needs an install id")
+ }
+ client := opts.HTTPClient
+ if client == nil {
+ client = &http.Client{Timeout: 30 * time.Second}
+ }
+ clientCopy := *client
+ clientCopy.CheckRedirect = func(*http.Request, []*http.Request) error {
+ return http.ErrUseLastResponse
+ }
+ client = &clientCopy
+ payload, err := json.Marshal(accountEnrollRequest{Device: opts.Device})
+ if err != nil {
+ return nil, err
+ }
+ req, err := http.NewRequestWithContext(ctx, http.MethodPost, baseURL+AccountEnrollPath, bytes.NewReader(payload))
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Authorization", "Bearer "+opts.AccessToken)
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("Accept", "application/json")
+ req.Header.Set("User-Agent", "beacon-cli")
+ resp, err := client.Do(req)
+ if err != nil {
+ return nil, fmt.Errorf("account device enrollment failed: %w", err)
+ }
+ defer resp.Body.Close()
+ body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20))
+ if err != nil {
+ return nil, err
+ }
+ if resp.StatusCode < 200 || resp.StatusCode > 299 {
+ var failure struct {
+ Detail string `json:"detail"`
+ Error string `json:"error"`
+ }
+ _ = json.Unmarshal(body, &failure)
+ detail := strings.TrimSpace(failure.Detail)
+ if detail == "" {
+ detail = strings.TrimSpace(failure.Error)
+ }
+ if detail == "" {
+ detail = fmt.Sprintf("HTTP %d", resp.StatusCode)
+ }
+ return nil, fmt.Errorf("account device enrollment rejected: %s", detail)
+ }
+ var result EnrollResult
+ if err := json.Unmarshal(body, &result); err != nil {
+ return nil, fmt.Errorf("parse account enrollment response: %w", err)
+ }
+ if err := validateEnrollResult(&result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
diff --git a/cli/beacon/internal/endpoint/asymptote/account_enroll_test.go b/cli/beacon/internal/endpoint/asymptote/account_enroll_test.go
new file mode 100644
index 00000000..31669f92
--- /dev/null
+++ b/cli/beacon/internal/endpoint/asymptote/account_enroll_test.go
@@ -0,0 +1,94 @@
+package asymptote
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "testing"
+)
+
+func TestEnrollAccountMintsDeviceCredentialWithoutBrowser(t *testing.T) {
+ var authorization string
+ var request accountEnrollRequest
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path != AccountEnrollPath {
+ http.NotFound(w, r)
+ return
+ }
+ authorization = r.Header.Get("Authorization")
+ _ = json.NewDecoder(r.Body).Decode(&request)
+ _ = json.NewEncoder(w).Encode(map[string]any{
+ "device_id": "dev-1",
+ "device_key": "bcn_device_abcdefgh_" + strings.Repeat("k", 43),
+ "key_prefix": "bcn_device_abcdefgh",
+ "ingest_url": "https://ingest.beacon.sh",
+ "organization_id": "org-1",
+ "organization_name": "Acme",
+ "email": "[email protected]",
+ "scopes": []string{"ingest:write"},
+ })
+ }))
+ defer server.Close()
+
+ result, err := EnrollAccount(context.Background(), AccountEnrollOptions{
+ BaseURL: server.URL,
+ AccessToken: "bcn_cli_account_token",
+ Device: device(),
+ HTTPClient: server.Client(),
+ })
+ if err != nil {
+ t.Fatalf("EnrollAccount returned error: %v", err)
+ }
+ if result.DeviceID != "dev-1" || authorization != "Bearer bcn_cli_account_token" {
+ t.Fatalf("result=%#v authorization=%q", result, authorization)
+ }
+ if request.Device.InstallID != "install-1" || request.Device.Hostname != "mac.local" {
+ t.Fatalf("device request = %#v", request.Device)
+ }
+}
+
+func TestEnrollAccountRejectsUnsafeInputsAndServerErrors(t *testing.T) {
+ if _, err := EnrollAccount(context.Background(), AccountEnrollOptions{
+ BaseURL: "http://example.com", AccessToken: "bcn_cli_token", Device: device(),
+ }); err == nil {
+ t.Fatal("expected insecure URL rejection")
+ }
+ if _, err := EnrollAccount(context.Background(), AccountEnrollOptions{
+ BaseURL: "https://beacon.sh", AccessToken: "not-a-cli-token", Device: device(),
+ }); err == nil {
+ t.Fatal("expected account token rejection")
+ }
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusForbidden)
+ _, _ = w.Write([]byte(`{"detail":"device:enroll scope required"}`))
+ }))
+ defer server.Close()
+ _, err := EnrollAccount(context.Background(), AccountEnrollOptions{
+ BaseURL: server.URL, AccessToken: "bcn_cli_token", Device: device(), HTTPClient: server.Client(),
+ })
+ if err == nil || !strings.Contains(err.Error(), "device:enroll scope required") {
+ t.Fatalf("error = %v", err)
+ }
+}
+
+func TestEnrollAccountDoesNotForwardCredentialAcrossRedirect(t *testing.T) {
+ var leaked string
+ target := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ leaked = r.Header.Get("Authorization")
+ w.WriteHeader(http.StatusOK)
+ }))
+ defer target.Close()
+ redirect := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.Redirect(w, r, target.URL, http.StatusTemporaryRedirect)
+ }))
+ defer redirect.Close()
+
+ _, err := EnrollAccount(context.Background(), AccountEnrollOptions{
+ BaseURL: redirect.URL, AccessToken: "bcn_cli_token", Device: device(), HTTPClient: redirect.Client(),
+ })
+ if err == nil || leaked != "" {
+ t.Fatalf("error=%v leaked authorization=%q", err, leaked)
+ }
+}
diff --git a/cli/beacon/internal/endpoint/asymptote/asymptote.go b/cli/beacon/internal/endpoint/asymptote/asymptote.go
index 363ee635..8d4209b1 100644
--- a/cli/beacon/internal/endpoint/asymptote/asymptote.go
+++ b/cli/beacon/internal/endpoint/asymptote/asymptote.go
@@ -17,6 +17,7 @@ import (
endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/siempack"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
)
//go:embed pack/*
@@ -51,8 +52,10 @@ const (
var DefaultLogPath = endpointconfig.SystemLogPath()
const (
- vectorAsset = "pack/vector.toml.tmpl"
- smokeTestAsset = "pack/asymptote-ingest-smoke-test.sh.tmpl"
+ vectorAsset = "pack/vector.toml.tmpl"
+ smokeTestAsset = "pack/asymptote-ingest-smoke-test.sh.tmpl"
+ privacyTransformAsset = "pack/metadata-transforms.toml"
+ privacyTransformMarker = "# BEACON_PRIVACY_TRANSFORMS"
)
// File is the installable pack-file type, shared with siempack.
@@ -99,6 +102,7 @@ type RenderOptions struct {
IngestURL string
SecretsFile string
DataDir string
+ PrivacyMode string
}
// RenderVectorConfig returns vector.toml with every environment reference replaced
@@ -112,6 +116,10 @@ func RenderVectorConfig(opts RenderOptions) (string, error) {
if opts.SecretsFile == "" || opts.DataDir == "" {
return "", ErrIncompleteRender
}
+ privacyMode, err := managedprivacy.Normalize(opts.PrivacyMode)
+ if err != nil {
+ return "", err
+ }
content, err := VectorConfig(opts.LogPath)
if err != nil {
return "", err
@@ -127,7 +135,27 @@ func RenderVectorConfig(opts RenderOptions) (string, error) {
for _, r := range replacements {
content = strings.ReplaceAll(content, r.from, r.to)
}
- if strings.Contains(content, "${"+EnvIngestURL) || strings.Contains(content, "${"+EnvSecretsFile) || strings.Contains(content, "${"+EnvDataDir) {
+ if privacyMode == managedprivacy.MetadataOnly {
+ transforms, err := fs.ReadFile(packFS, privacyTransformAsset)
+ if err != nil {
+ return "", err
+ }
+ content = strings.Replace(content, privacyTransformMarker, strings.TrimSpace(string(transforms)), 1)
+ content = strings.Replace(content,
+ "[sinks.asymptote_runtime]\ntype = \"http\"\ninputs = [\"beacon_runtime\"]",
+ "[sinks.asymptote_runtime]\ntype = \"http\"\ninputs = [\"beacon_runtime_metadata\"]", 1)
+ content = strings.Replace(content,
+ "[sinks.asymptote_inventory]\ntype = \"http\"\ninputs = [\"beacon_inventory\"]",
+ "[sinks.asymptote_inventory]\ntype = \"http\"\ninputs = [\"beacon_inventory_metadata\"]", 1)
+ if !strings.Contains(content, `inputs = ["beacon_runtime_metadata"]`) ||
+ !strings.Contains(content, `inputs = ["beacon_inventory_metadata"]`) {
+ return "", ErrIncompleteRender
+ }
+ } else {
+ content = strings.Replace(content, privacyTransformMarker, "# Privacy mode: standard (byte-for-byte forwarding)", 1)
+ }
+ if strings.Contains(content, privacyTransformMarker) ||
+ strings.Contains(content, "${"+EnvIngestURL) || strings.Contains(content, "${"+EnvSecretsFile) || strings.Contains(content, "${"+EnvDataDir) {
return "", ErrIncompleteRender
}
return content, nil
diff --git a/cli/beacon/internal/endpoint/asymptote/asymptote_test.go b/cli/beacon/internal/endpoint/asymptote/asymptote_test.go
index 286a940f..4ba59fe1 100644
--- a/cli/beacon/internal/endpoint/asymptote/asymptote_test.go
+++ b/cli/beacon/internal/endpoint/asymptote/asymptote_test.go
@@ -200,6 +200,63 @@ func TestRenderVectorConfigRefusesInsecureOrIncompleteInput(t *testing.T) {
}
}
+func TestRenderVectorConfigSelectsMetadataOnlyTransforms(t *testing.T) {
+ got, err := RenderVectorConfig(RenderOptions{
+ LogPath: "/tmp/runtime.jsonl",
+ IngestURL: "https://ingest.example.test",
+ SecretsFile: "/tmp/secrets.json",
+ DataDir: "/tmp/vector-data",
+ PrivacyMode: "metadata-only",
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, want := range []string{
+ `inputs = ["beacon_runtime_metadata"]`,
+ `inputs = ["beacon_inventory_metadata"]`,
+ `del(event.prompt)`,
+ `del(event.command.output)`,
+ `del(event.file.diff)`,
+ `del(event.gen_ai.tool.call.arguments)`,
+ `del(item.definition)`,
+ } {
+ if !strings.Contains(got, want) {
+ t.Fatalf("metadata config missing %q:\n%s", want, got)
+ }
+ }
+ if strings.Contains(got, "[sinks.asymptote_runtime]\ntype = \"http\"\ninputs = [\"beacon_runtime\"]") {
+ t.Fatal("runtime sink bypasses metadata transform")
+ }
+}
+
+func TestRenderedPrivacyConfigsValidateWithVector(t *testing.T) {
+ vector := os.Getenv("BEACON_TEST_VECTOR_BIN")
+ if vector == "" {
+ t.Skip("set BEACON_TEST_VECTOR_BIN to validate rendered configs with Vector")
+ }
+ for _, mode := range []string{"standard", "metadata_only"} {
+ t.Run(mode, func(t *testing.T) {
+ rendered, err := RenderVectorConfig(RenderOptions{
+ LogPath: filepath.Join(t.TempDir(), "runtime.jsonl"),
+ IngestURL: "https://ingest.example.test",
+ SecretsFile: filepath.Join(t.TempDir(), "secrets.json"),
+ DataDir: t.TempDir(),
+ PrivacyMode: mode,
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ path := filepath.Join(t.TempDir(), "vector.toml")
+ if err := os.WriteFile(path, []byte(rendered), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := ValidateVectorConfig(vector, path); err != nil {
+ t.Fatal(err)
+ }
+ })
+ }
+}
+
func TestSecretsFileContentIsTheShapeTheTemplateReads(t *testing.T) {
content := SecretsFileContent(`bcn_device_abcdefgh_` + strings.Repeat("x", 43))
var parsed map[string]string
diff --git a/cli/beacon/internal/endpoint/asymptote/connect.go b/cli/beacon/internal/endpoint/asymptote/connect.go
index dff03e38..4a30cf5f 100644
--- a/cli/beacon/internal/endpoint/asymptote/connect.go
+++ b/cli/beacon/internal/endpoint/asymptote/connect.go
@@ -7,11 +7,13 @@ import (
"io"
"os"
"path/filepath"
+ "strings"
"time"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"
endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
)
// Forwarder is the service-manager surface Connect and Disconnect need. service.ForwarderManager
@@ -39,10 +41,15 @@ type ConnectOptions struct {
Forwarder Forwarder
// Enroll is the browser flow; the CLI fills Device, DashboardURL, browser opener.
Enroll EnrollOptions
+ // AccountEnroll replaces the browser approval with the signed-in CLI account.
+ // Connect fills Device after pinning the install id.
+ AccountEnroll *AccountEnrollOptions
// InstallID identifies this machine across re-enrollments. Empty reuses the stored
// enrollment's id or mints a new one.
InstallID string
- Out io.Writer
+ // PrivacyMode controls the Vector-side transform before managed upload.
+ PrivacyMode string
+ Out io.Writer
// Now is injectable for tests.
Now func() time.Time
}
@@ -75,6 +82,10 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
if now == nil {
now = time.Now
}
+ privacyMode, err := managedprivacy.Normalize(opts.PrivacyMode)
+ if err != nil {
+ return nil, err
+ }
manager := opts.Forwarder
if manager == nil {
manager = service.ForwarderManager{UserMode: opts.UserMode}
@@ -119,11 +130,22 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
enrollOpts.Out = out
}
- result, err := Enroll(ctx, enrollOpts)
+ var result *EnrollResult
+ if opts.AccountEnroll != nil {
+ accountEnroll := *opts.AccountEnroll
+ accountEnroll.Device = enrollOpts.Device
+ result, err = EnrollAccount(ctx, accountEnroll)
+ } else {
+ result, err = Enroll(ctx, enrollOpts)
+ }
if err != nil {
return nil, err
}
- fmt.Fprintf(out, "Approved for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)
+ if opts.AccountEnroll != nil {
+ fmt.Fprintf(out, "Account authorized device enrollment for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)
+ } else {
+ fmt.Fprintf(out, "Approved for %s (device %s, key %s)\n", displayOrg(result), result.DeviceID, result.KeyPrefix)
+ }
// Secrets first, then the config that references them, then the unit that runs it.
if err := WriteSecrets(opts.UserMode, result.DeviceKey); err != nil {
@@ -143,6 +165,7 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
IngestURL: result.IngestURL,
SecretsFile: SecretsPath(opts.UserMode),
DataDir: dataDir,
+ PrivacyMode: privacyMode,
})
if err != nil {
return nil, err
@@ -162,10 +185,14 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
return nil, fmt.Errorf("forwarder installed at %s but could not be started: %w", unitPath, err)
}
+ dashboardURL := auth.ResolveDashboardURL(enrollOpts.DashboardURL)
+ if opts.AccountEnroll != nil {
+ dashboardURL = strings.TrimRight(opts.AccountEnroll.BaseURL, "/")
+ }
enrollment := Enrollment{
InstallID: installID,
IngestURL: result.IngestURL,
- DashboardURL: auth.ResolveDashboardURL(enrollOpts.DashboardURL),
+ DashboardURL: dashboardURL,
DeviceID: result.DeviceID,
KeyPrefix: result.KeyPrefix,
OrganizationID: result.OrganizationID,
@@ -174,6 +201,7 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
EnrolledAt: now().UTC(),
VectorBin: vector.Path,
VectorVersion: vector.Version,
+ PrivacyMode: privacyMode,
}
if result.ExpiresAt != nil {
enrollment.ExpiresAt = *result.ExpiresAt
@@ -186,6 +214,7 @@ func Connect(ctx context.Context, opts ConnectOptions) (*ConnectResult, error) {
IngestURL: result.IngestURL,
DeviceID: result.DeviceID,
OrganizationID: result.OrganizationID,
+ PrivacyMode: privacyMode,
}); err != nil {
return nil, err
}
diff --git a/cli/beacon/internal/endpoint/asymptote/connect_test.go b/cli/beacon/internal/endpoint/asymptote/connect_test.go
index e70240d4..245e40f8 100644
--- a/cli/beacon/internal/endpoint/asymptote/connect_test.go
+++ b/cli/beacon/internal/endpoint/asymptote/connect_test.go
@@ -95,8 +95,10 @@ func TestConnectWritesSecretsConfigUnitAndEnrollmentInOrder(t *testing.T) {
fd := newFakeDashboard(t)
fwd := &fakeForwarder{supported: true}
vector := fakeVector(t, "0.56.0", 0)
+ opts := connectOptions(t, fd, fwd, vector)
+ opts.PrivacyMode = "metadata-only"
- result, err := Connect(context.Background(), connectOptions(t, fd, fwd, vector))
+ result, err := Connect(context.Background(), opts)
if err != nil {
t.Fatalf("Connect returned error: %v", err)
}
@@ -130,6 +132,7 @@ func TestConnectWritesSecretsConfigUnitAndEnrollmentInOrder(t *testing.T) {
`uri = "https://ingest.example.test/v1/ingest/runtime"`,
`path = "` + SecretsPath(true) + `"`,
`data_dir = "` + DataDir(true) + `"`,
+ `inputs = ["beacon_runtime_metadata"]`,
} {
if !strings.Contains(string(toml), want) {
t.Fatalf("vector.toml missing %q:\n%s", want, toml)
@@ -143,7 +146,7 @@ func TestConnectWritesSecretsConfigUnitAndEnrollmentInOrder(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if enrollment.DeviceID != "dev-1" || enrollment.OrganizationName != "Asymptote Test" || enrollment.InstallID == "" || enrollment.VectorVersion != "0.56.0" {
+ if enrollment.DeviceID != "dev-1" || enrollment.OrganizationName != "Asymptote Test" || enrollment.InstallID == "" || enrollment.VectorVersion != "0.56.0" || enrollment.PrivacyMode != "metadata_only" {
t.Fatalf("enrollment = %+v", enrollment)
}
if result.ReEnrolled || result.Enrollment.DeviceID != "dev-1" || result.SecretsFile != SecretsPath(true) {
@@ -153,7 +156,7 @@ func TestConnectWritesSecretsConfigUnitAndEnrollmentInOrder(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if cfg.ManagedIngest == nil || !cfg.ManagedIngest.Enabled || cfg.ManagedIngest.DeviceID != "dev-1" || cfg.ManagedIngest.IngestURL != "https://ingest.example.test" {
+ if cfg.ManagedIngest == nil || !cfg.ManagedIngest.Enabled || cfg.ManagedIngest.DeviceID != "dev-1" || cfg.ManagedIngest.IngestURL != "https://ingest.example.test" || cfg.ManagedIngest.PrivacyMode != "metadata_only" {
t.Fatalf("config managed_ingest = %+v", cfg.ManagedIngest)
}
raw, _ := os.ReadFile(endpointconfig.ConfigPath(true))
@@ -194,6 +197,49 @@ func TestConnectReusesInstallIDOnReEnrollment(t *testing.T) {
}
}
+func TestConnectUsesAccountEnrollmentWithoutOpeningBrowser(t *testing.T) {
+ t.Setenv("HOME", t.TempDir())
+ isolateVectorDiscovery(t)
+ var authorization string
+ accountServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ authorization = r.Header.Get("Authorization")
+ _ = json.NewEncoder(w).Encode(map[string]any{
+ "device_id": "dev-account",
+ "device_key": "bcn_device_abcdefgh_" + strings.Repeat("k", 43),
+ "key_prefix": "bcn_device_abcdefgh",
+ "ingest_url": "https://ingest.example.test",
+ "organization_id": "org-1",
+ "organization_name": "Beacon Test",
+ "email": "[email protected]",
+ "scopes": []string{"ingest:write"},
+ })
+ }))
+ defer accountServer.Close()
+
+ fd := newFakeDashboard(t)
+ opened := false
+ opts := connectOptions(t, fd, &fakeForwarder{supported: true}, fakeVector(t, "0.56.0", 0))
+ opts.Enroll.OpenBrowser = func(string) error { opened = true; return nil }
+ opts.AccountEnroll = &AccountEnrollOptions{
+ BaseURL: accountServer.URL,
+ AccessToken: "bcn_cli_account_token",
+ HTTPClient: accountServer.Client(),
+ }
+ result, err := Connect(context.Background(), opts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if opened {
+ t.Fatal("account enrollment opened the browser")
+ }
+ if authorization != "Bearer bcn_cli_account_token" || result.Enrollment.DeviceID != "dev-account" {
+ t.Fatalf("authorization=%q result=%#v", authorization, result.Enrollment)
+ }
+ if result.Enrollment.DashboardURL != accountServer.URL {
+ t.Fatalf("dashboard URL = %q", result.Enrollment.DashboardURL)
+ }
+}
+
func TestConnectStopsBeforeTheBrowserWhenVectorIsMissingOrOld(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
diff --git a/cli/beacon/internal/endpoint/asymptote/enrollment.go b/cli/beacon/internal/endpoint/asymptote/enrollment.go
index 1326eda1..3e2c85c7 100644
--- a/cli/beacon/internal/endpoint/asymptote/enrollment.go
+++ b/cli/beacon/internal/endpoint/asymptote/enrollment.go
@@ -81,6 +81,7 @@ type Enrollment struct {
ExpiresAt string `json:"expires_at,omitempty"`
VectorBin string `json:"vector_bin,omitempty"`
VectorVersion string `json:"vector_version,omitempty"`
+ PrivacyMode string `json:"privacy_mode,omitempty"`
}
// ErrNotEnrolled is returned when no enrollment record exists.
diff --git a/cli/beacon/internal/endpoint/asymptote/pack/README.md b/cli/beacon/internal/endpoint/asymptote/pack/README.md
index 559bc1d1..f8e31522 100644
--- a/cli/beacon/internal/endpoint/asymptote/pack/README.md
+++ b/cli/beacon/internal/endpoint/asymptote/pack/README.md
@@ -1,14 +1,13 @@
-# Beacon Endpoint Agent Asymptote Managed Forwarding Pack
+# Beacon Endpoint Agent Managed Forwarding Pack
-This pack forwards Beacon endpoint JSONL events to Asymptote's managed ingest
-service so they appear on the Asymptote dashboard. Beacon writes runtime
+This pack forwards Beacon endpoint JSONL events to Beacon Managed so they appear
+on the Beacon dashboard. Beacon writes runtime
activity to `runtime.jsonl` and configuration inventory to
`inventory_state.jsonl`; Vector tails both files and POSTs gzip-compressed
NDJSON batches over HTTPS with a per-device key.
-Forwarding is opt-in and revocable. Beacon's default posture is local-only;
-nothing in this pack runs until a device has been approved by a member of your
-Asymptote organization and Vector has been started with the resulting key.
+Forwarding is revocable, and nothing in this pack runs until a device key exists
+and Vector has been started.
## What leaves the machine
@@ -21,6 +20,11 @@ any tenant fields sent by the client. Nothing else is sent: no prompts or files
beyond what the events already contain, no environment variables, no shell
history.
+This hand-run pack uses Standard privacy. `beacon endpoint connect
+--privacy-mode metadata-only` renders an endpoint-specific config that removes
+retained text, raw fields, diffs, inventory content, and MCP definitions before
+buffering or upload.
+
## Prerequisites
- Beacon endpoint installed and writing local JSONL.
diff --git a/cli/beacon/internal/endpoint/asymptote/pack/metadata-transforms.toml b/cli/beacon/internal/endpoint/asymptote/pack/metadata-transforms.toml
new file mode 100644
index 00000000..489444d8
--- /dev/null
+++ b/cli/beacon/internal/endpoint/asymptote/pack/metadata-transforms.toml
@@ -0,0 +1,50 @@
+[transforms.beacon_runtime_metadata]
+type = "remap"
+inputs = ["beacon_runtime"]
+source = '''
+event = parse_json!(string!(.message))
+del(event.prompt)
+del(event.message)
+del(event.raw)
+del(event.command.output)
+del(event.file.diff)
+del(event.gen_ai.input)
+del(event.gen_ai.output)
+del(event.gen_ai.tool.call.arguments)
+del(event.gen_ai.tool.call.result)
+if is_object(event.content) {
+ event.content.retention = "metadata"
+ event.content.included = false
+ event.content.redacted = true
+}
+.message = encode_json(event)
+'''
+
+[transforms.beacon_inventory_metadata]
+type = "remap"
+inputs = ["beacon_inventory"]
+source = '''
+event = parse_json!(string!(.message))
+if is_array(event.raw.inventory.configs) {
+ event.raw.inventory.configs = map_values(array!(event.raw.inventory.configs)) -> |value| {
+ item = object!(value)
+ del(item.content)
+ item
+ }
+}
+if is_array(event.raw.inventory.mcp_servers) {
+ event.raw.inventory.mcp_servers = map_values(array!(event.raw.inventory.mcp_servers)) -> |value| {
+ item = object!(value)
+ del(item.definition)
+ item
+ }
+}
+if is_array(event.raw.inventory.skills) {
+ event.raw.inventory.skills = map_values(array!(event.raw.inventory.skills)) -> |value| {
+ item = object!(value)
+ del(item.content)
+ item
+ }
+}
+.message = encode_json(event)
+'''
diff --git a/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl b/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl
index 56e9dbb1..e8af0389 100644
--- a/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl
+++ b/cli/beacon/internal/endpoint/asymptote/pack/vector.toml.tmpl
@@ -31,9 +31,7 @@ type = "file"
include = ["{{INVENTORY_LOG_PATH}}"]
read_from = "beginning"
-# Each JSONL line is forwarded byte-for-byte as one NDJSON record (codec "text"
-# sends the file source's message field); the ingest service validates and
-# stamps tenant identity server-side, so no remap runs here.
+# BEACON_PRIVACY_TRANSFORMS
[sinks.asymptote_runtime]
type = "http"
diff --git a/cli/beacon/internal/endpoint/asymptote/status.go b/cli/beacon/internal/endpoint/asymptote/status.go
index 3ee49345..19025421 100644
--- a/cli/beacon/internal/endpoint/asymptote/status.go
+++ b/cli/beacon/internal/endpoint/asymptote/status.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service"
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
)
var randRead = rand.Read
@@ -27,6 +28,7 @@ type ManagedIngestStatus struct {
Email string `json:"email,omitempty"`
EnrolledAt string `json:"enrolled_at,omitempty"`
VectorBin string `json:"vector_bin,omitempty"`
+ PrivacyMode string `json:"privacy_mode,omitempty"`
Forwarder service.Status `json:"forwarder"`
// Credential is "valid", "revoked", "unknown" (network unavailable) or "" when not
// enabled. Revoked covers every 401 cause: revoked or expired key, or the approving
@@ -56,6 +58,7 @@ func Status(userMode bool, opts StatusOptions) ManagedIngestStatus {
return status
}
if !Connected(userMode) {
+ privacyMode, _ := managedprivacy.Normalize(enrollment.PrivacyMode)
// disconnect --keep-credentials leaves the record and key for a later connect.
return ManagedIngestStatus{
Enabled: false,
@@ -63,9 +66,11 @@ func Status(userMode bool, opts StatusOptions) ManagedIngestStatus {
KeyPrefix: enrollment.KeyPrefix,
OrganizationID: enrollment.OrganizationID,
OrganizationName: enrollment.OrganizationName,
+ PrivacyMode: privacyMode,
Message: fmt.Sprintf("disconnected; credentials for device %s kept, run `beacon endpoint connect` to reuse them", enrollment.DeviceID),
}
}
+ privacyMode, _ := managedprivacy.Normalize(enrollment.PrivacyMode)
status := ManagedIngestStatus{
Enabled: true,
IngestURL: enrollment.IngestURL,
@@ -76,6 +81,7 @@ func Status(userMode bool, opts StatusOptions) ManagedIngestStatus {
Email: enrollment.Email,
EnrolledAt: enrollment.EnrolledAt.UTC().Format(time.RFC3339),
VectorBin: enrollment.VectorBin,
+ PrivacyMode: privacyMode,
Forwarder: ForwarderStatus(userMode),
BufferBytes: BufferBytes(userMode),
}
diff --git a/cli/beacon/internal/endpoint/config/config.go b/cli/beacon/internal/endpoint/config/config.go
index cab504f5..262e0b16 100644
--- a/cli/beacon/internal/endpoint/config/config.go
+++ b/cli/beacon/internal/endpoint/config/config.go
@@ -114,6 +114,7 @@ type ManagedIngest struct {
IngestURL string `json:"ingest_url,omitempty"`
DeviceID string `json:"device_id,omitempty"`
OrganizationID string `json:"organization_id,omitempty"`
+ PrivacyMode string `json:"privacy_mode,omitempty"`
}
// AutoUpdate controls Beacon's endpoint update checker. Phase 1 supports
diff --git a/cli/beacon/internal/managedprivacy/privacy.go b/cli/beacon/internal/managedprivacy/privacy.go
new file mode 100644
index 00000000..339fbdb7
--- /dev/null
+++ b/cli/beacon/internal/managedprivacy/privacy.go
@@ -0,0 +1,31 @@
+package managedprivacy
+
+import (
+ "fmt"
+ "strings"
+)
+
+const (
+ Standard = "standard"
+ MetadataOnly = "metadata_only"
+)
+
+var Modes = []string{Standard, MetadataOnly}
+
+func Normalize(value string) (string, error) {
+ switch strings.ToLower(strings.TrimSpace(value)) {
+ case "", Standard:
+ return Standard, nil
+ case MetadataOnly, "metadata-only", "metadata":
+ return MetadataOnly, nil
+ default:
+ return "", fmt.Errorf("privacy mode must be %q or %q", Standard, MetadataOnly)
+ }
+}
+
+func Label(value string) string {
+ if value == MetadataOnly {
+ return "Metadata only"
+ }
+ return "Standard"
+}
diff --git a/cli/beacon/internal/managedprivacy/privacy_test.go b/cli/beacon/internal/managedprivacy/privacy_test.go
new file mode 100644
index 00000000..05a0bfc0
--- /dev/null
+++ b/cli/beacon/internal/managedprivacy/privacy_test.go
@@ -0,0 +1,21 @@
+package managedprivacy
+
+import "testing"
+
+func TestNormalize(t *testing.T) {
+ for input, want := range map[string]string{
+ "": Standard,
+ "standard": Standard,
+ "metadata_only": MetadataOnly,
+ "metadata-only": MetadataOnly,
+ "metadata": MetadataOnly,
+ } {
+ got, err := Normalize(input)
+ if err != nil || got != want {
+ t.Fatalf("Normalize(%q) = %q, %v; want %q", input, got, err, want)
+ }
+ }
+ if _, err := Normalize("none"); err == nil {
+ t.Fatal("expected invalid mode error")
+ }
+}
diff --git a/cli/beacon/internal/onboarding/profile.go b/cli/beacon/internal/onboarding/profile.go
index 96160874..88851cb6 100644
--- a/cli/beacon/internal/onboarding/profile.go
+++ b/cli/beacon/internal/onboarding/profile.go
@@ -63,6 +63,8 @@ type Onboarding struct {
// New interactive installs choose local or asymptote; own_infra remains valid for
// profiles written by older versions and unattended/admin-managed deployments.
Destination string `json:"destination,omitempty"`
+ // PrivacyMode applies only to Beacon Managed forwarding.
+ PrivacyMode string `json:"privacy_mode,omitempty"`
}
// Answers to the telemetry destination question.
diff --git a/cli/beacon/internal/onboarding/profile_test.go b/cli/beacon/internal/onboarding/profile_test.go
index 5f69d5a9..be97a5a2 100644
--- a/cli/beacon/internal/onboarding/profile_test.go
+++ b/cli/beacon/internal/onboarding/profile_test.go
@@ -57,6 +57,8 @@ func TestSaveRoundTrip(t *testing.T) {
Usage: UsageWork,
BeaconVersion: "v0.0.31",
+ Destination: DestinationAsymptote,
+ PrivacyMode: "metadata_only",
},
}
if err := Save(in); err != nil {
@@ -73,6 +75,9 @@ func TestSaveRoundTrip(t *testing.T) {
if got.Onboarding.Outcome != OutcomeSubmitted {
t.Fatalf("Outcome = %q, want %q", got.Onboarding.Outcome, OutcomeSubmitted)
}
+ if got.Onboarding.Destination != DestinationAsymptote || got.Onboarding.PrivacyMode != "metadata_only" {
+ t.Fatalf("managed settings = %#v", got.Onboarding)
+ }
if got.SchemaVersion != SchemaVersion {
t.Fatalf("SchemaVersion = %d, want %d", got.SchemaVersion, SchemaVersion)
}
diff --git a/cli/beacon/internal/onboarding/wizard.go b/cli/beacon/internal/onboarding/wizard.go
index e48c924b..01b696e1 100644
--- a/cli/beacon/internal/onboarding/wizard.go
+++ b/cli/beacon/internal/onboarding/wizard.go
@@ -7,6 +7,8 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
+
+ "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/managedprivacy"
)
var ErrWizardCancelled = errors.New("onboarding cancelled")
@@ -17,12 +19,14 @@ type WizardOptions struct {
OfferManaged bool
DestinationOnly bool
PresetDestination string
+ PresetPrivacyMode string
}
type WizardResult struct {
NeedLogin bool
Completed bool
Destination string
+ PrivacyMode string
}
type wizardScreen int
@@ -32,6 +36,7 @@ const (
signInScreen
destinationScreen
managedDisclosureScreen
+ privacyScreen
confirmScreen
)
@@ -53,7 +58,7 @@ var (
func newWizardModel(options WizardOptions) wizardModel {
screen := welcomeScreen
- result := WizardResult{Destination: options.PresetDestination}
+ result := WizardResult{Destination: options.PresetDestination, PrivacyMode: options.PresetPrivacyMode}
if options.DestinationOnly {
switch {
case !options.SignedIn:
@@ -96,12 +101,12 @@ func (m wizardModel) Update(message tea.Msg) (tea.Model, tea.Cmd) {
case "ctrl+c", "q", "esc":
return m, tea.Quit
case "up", "k":
- if m.screen == destinationScreen {
- m.selected = (m.selected - 1 + len(m.destinations())) % len(m.destinations())
+ if m.screen == destinationScreen || m.screen == privacyScreen {
+ m.selected = (m.selected - 1 + m.choiceCount()) % m.choiceCount()
}
case "down", "j":
- if m.screen == destinationScreen {
- m.selected = (m.selected + 1) % len(m.destinations())
+ if m.screen == destinationScreen || m.screen == privacyScreen {
+ m.selected = (m.selected + 1) % m.choiceCount()
}
case "enter":
return m.advance()
@@ -134,6 +139,10 @@ func (m wizardModel) advance() (tea.Model, tea.Cmd) {
m.screen = confirmScreen
}
case managedDisclosureScreen:
+ m.selected = privacyIndex(m.result.PrivacyMode)
+ m.screen = privacyScreen
+ case privacyScreen:
+ m.result.PrivacyMode = managedprivacy.Modes[m.selected]
m.screen = confirmScreen
case confirmScreen:
m.result.Completed = true
@@ -149,6 +158,13 @@ func (m wizardModel) destinations() []string {
return []string{DestinationLocal}
}
+func (m wizardModel) choiceCount() int {
+ if m.screen == privacyScreen {
+ return len(managedprivacy.Modes)
+ }
+ return len(m.destinations())
+}
+
func (m wizardModel) View() string {
width := m.width
if width <= 0 {
@@ -182,12 +198,25 @@ func (m wizardModel) View() string {
title = "Beacon Managed sends new telemetry to beacon.sh"
body = wizardWarn.Render("Nothing is forwarded by signing in or completing this wizard.") +
"\n\nAfter installation, run `beacon endpoint connect`. Once connected, Vector sends new runtime and inventory events to beacon.sh over HTTPS. Existing local history is not uploaded."
+ case privacyScreen:
+ title = "Choose what Beacon Managed receives"
+ var rows []string
+ for index, mode := range managedprivacy.Modes {
+ label, detail := privacyCopy(mode)
+ line := " " + label
+ if index == m.selected {
+ line = wizardChoice.Render(" ❯ " + label)
+ }
+ rows = append(rows, line, wizardDim.Render(" "+detail))
+ }
+ body = strings.Join(rows, "\n")
case confirmScreen:
title = "Ready to install"
label, _ := destinationCopy(m.result.Destination)
body = "Account: " + m.options.Email + "\nDestination: " + label
if m.result.Destination == DestinationAsymptote {
- body += "\n\nNext step after install: beacon endpoint connect"
+ body += "\nPrivacy: " + managedprivacy.Label(m.result.PrivacyMode) +
+ "\n\nNext step after install: beacon endpoint connect"
} else {
body += "\n\nYour telemetry stays on this machine."
}
@@ -210,10 +239,28 @@ func destinationCopy(destination string) (string, string) {
}
}
+func privacyCopy(mode string) (string, string) {
+ if mode == managedprivacy.MetadataOnly {
+ return "Metadata only", "Omit prompts, responses, reasoning, tool arguments/results, command output, raw fields, and diffs."
+ }
+ return "Standard (recommended)", "Send locally sanitized retained content, including prompts and tool activity."
+}
+
+func privacyIndex(mode string) int {
+ for index, candidate := range managedprivacy.Modes {
+ if candidate == mode {
+ return index
+ }
+ }
+ return 0
+}
+
func wizardHint(screen wizardScreen) string {
switch screen {
case destinationScreen:
return "↑/↓ choose · enter continue · esc cancel"
+ case privacyScreen:
+ return "↑/↓ choose · enter continue · esc cancel"
case signInScreen:
return "enter open beacon.sh · esc cancel"
case confirmScreen:
diff --git a/cli/beacon/internal/onboarding/wizard_test.go b/cli/beacon/internal/onboarding/wizard_test.go
index c7206692..a8736232 100644
--- a/cli/beacon/internal/onboarding/wizard_test.go
+++ b/cli/beacon/internal/onboarding/wizard_test.go
@@ -87,15 +87,41 @@ func TestManagedWizardRequiresDisclosureConfirmation(t *testing.T) {
}
}
model, _ = advanceWizard(t, model, "enter")
+ if model.screen != privacyScreen {
+ t.Fatalf("screen = %v, want privacy", model.screen)
+ }
+ if view := model.View(); !strings.Contains(view, "Standard (recommended)") || !strings.Contains(view, "Metadata only") {
+ t.Fatalf("privacy choices missing:\n%s", view)
+ }
+ model, _ = advanceWizard(t, model, "enter")
if model.screen != confirmScreen {
t.Fatalf("screen = %v, want confirmation", model.screen)
}
+ if model.result.PrivacyMode != "standard" {
+ t.Fatalf("privacy mode = %q", model.result.PrivacyMode)
+ }
model, _ = advanceWizard(t, model, "enter")
if !model.result.Completed {
t.Fatalf("result = %#v", model.result)
}
}
+func TestWizardSelectsMetadataOnlyPrivacy(t *testing.T) {
+ model := newWizardModel(WizardOptions{
+ SignedIn: true,
+ Email: "[email protected]",
+ OfferManaged: true,
+ DestinationOnly: true,
+ })
+ model, _ = advanceWizard(t, model, "enter")
+ model, _ = advanceWizard(t, model, "enter")
+ model, _ = advanceWizard(t, model, "j")
+ model, _ = advanceWizard(t, model, "enter")
+ if model.screen != confirmScreen || model.result.PrivacyMode != "metadata_only" {
+ t.Fatalf("metadata selection = screen %v result %#v", model.screen, model.result)
+ }
+}
+
func TestWizardHidesManagedDestination(t *testing.T) {
model := newWizardModel(WizardOptions{
SignedIn: true,
diff --git a/docs/cli/account-auth.mdx b/docs/cli/account-auth.mdx
index efaa97d4..217bbbf8 100644
--- a/docs/cli/account-auth.mdx
+++ b/docs/cli/account-auth.mdx
@@ -62,3 +62,10 @@ The CLI uses the versioned `2026-09-01` grant contract:
- `POST /api/cli/auth/revoke` accepts the access token as a Bearer credential and revokes it.
The intended initial scopes are `profile:read` and `device:enroll`. A later `beacon endpoint connect` can use `device:enroll` to mint a device-specific ingest key without treating the account token as an ingest credential.
+
+For that enrollment, `beacon endpoint connect` sends the machine description to
+`POST /api/cli/enroll/account` with the CLI access token. The response uses the
+existing device-enrollment shape (`device_id`, `device_key`, `key_prefix`,
+`ingest_url`, organization identity, email, and `ingest:write` scope). The account
+token is used only for this request; the returned device key remains Vector's sole
+credential.
diff --git a/docs/cli/asymptote.mdx b/docs/cli/asymptote.mdx
index 5a182fd6..334ef240 100644
--- a/docs/cli/asymptote.mdx
+++ b/docs/cli/asymptote.mdx
@@ -7,6 +7,10 @@ description: "Generate the Vector forwarding pack that sends Beacon endpoint eve
Use `beacon endpoint asymptote` to generate the content pack that forwards Beacon endpoint events to Beacon's managed ingest service. The pack keeps Beacon as a local JSONL producer: Vector tails the runtime and inventory logs and POSTs gzip-compressed NDJSON batches over HTTPS with a per-device key.
+The hand-run pack uses Standard privacy and forwards locally sanitized lines
+unchanged. Use [`beacon endpoint connect --privacy-mode metadata-only`](/cli/endpoint-connect#privacy-modes)
+when Beacon should render the local metadata-only transforms for you.
+
This is the one destination that sends telemetry to a Beacon-run endpoint. It is opt-in and revocable: nothing is forwarded until a member of your Beacon organization has approved the device in the browser and Vector has been started with the resulting key. `beacon endpoint connect` performs that enrollment and runs the forwarder as a service; the commands on this page generate the same files for running or inspecting the forwarder by hand.
Beacon does not store the device key in its own configuration. The key lives in a `0600` JSON secrets file that Vector reads through its secret backend, so it appears in neither `vector.toml` nor the process environment.
diff --git a/docs/cli/endpoint-config.mdx b/docs/cli/endpoint-config.mdx
index 123f0a76..4bfd80f9 100644
--- a/docs/cli/endpoint-config.mdx
+++ b/docs/cli/endpoint-config.mdx
@@ -90,8 +90,9 @@ When the endpoint is connected to Beacon managed ingest, `config.json` carries a
| `ingest_url` | The `https://` ingest URL returned by enrollment |
| `device_id` | This device's id in the Beacon dashboard |
| `organization_id` | The organization that approved the device |
+| `privacy_mode` | `standard` or `metadata_only`, rendered into the local Vector pipeline |
-[`beacon endpoint connect`](/cli/endpoint-connect) writes the block and `beacon endpoint disconnect` clears it. It never holds the device key, which lives only in `asymptote/vector-secrets.json`, and it survives re-running `beacon endpoint install`.
+[`beacon endpoint connect`](/cli/endpoint-connect) writes the block and `beacon endpoint disconnect` clears it. It never holds the account token or device key; the device key lives only in `asymptote/vector-secrets.json`. The block survives re-running `beacon endpoint install`.
## Related
diff --git a/docs/cli/endpoint-connect.mdx b/docs/cli/endpoint-connect.mdx
index 2592796b..b3107d7c 100644
--- a/docs/cli/endpoint-connect.mdx
+++ b/docs/cli/endpoint-connect.mdx
@@ -5,9 +5,9 @@ description: "Connect a Beacon endpoint to Beacon managed ingest, or disconnect
## Command overview
-`beacon endpoint connect` forwards this endpoint's telemetry to Beacon so it appears on the Beacon dashboard. It opens the dashboard in your browser, where a member of your organization approves this specific device; the CLI then receives a key for this device, stores it in a private secrets file, and starts a Vector forwarder that ships the runtime and inventory JSONL over HTTPS.
+`beacon endpoint connect` forwards this endpoint's telemetry to Beacon so it appears on the Beacon dashboard. For a user endpoint, the signed-in CLI account authorizes a device-specific ingest key without another browser approval. The account token is never copied into endpoint state or given to Vector. System mode retains browser approval because unattended/system installs are account-free.
-Forwarding is opt-in and revocable. Beacon's default stays local-only, nothing recorded before the approval is sent, and revoking the device from the dashboard stops ingestion within about a minute. `beacon endpoint disconnect` stops the forwarder and removes the local credentials.
+Forwarding is opt-in and revocable. Nothing recorded before connection is sent, and revoking the device from the dashboard stops ingestion within about a minute. `beacon endpoint disconnect` stops the forwarder and removes the local credentials.
```bash title="Command syntax"
beacon endpoint connect [flags]
@@ -17,21 +17,36 @@ beacon endpoint disconnect [flags]
## Prerequisites
- Beacon endpoint installed (`beacon endpoint install`) and writing local JSONL.
+- A current `beacon login` session with `device:enroll` scope for user mode.
- Vector 0.50 or newer on the machine (Apple Silicon gets 0.58 from Homebrew or the package; Intel Macs get 0.50.0, the last x86_64 build Vector published). The signed macOS package installs it at `/opt/beacon/bin/vector`; on macOS Homebrew installs it with Beacon, as the tap's `beacon-vector` keg (named that rather than `vector` so it coexists with a Vector from `vectordotdev/brew`, and kept in `libexec` so it stays off your PATH); on Linux install the `vector` package from [vector.dev](https://vector.dev). `connect` stops before opening a browser if no usable Vector is found.
-- A browser where you can sign in to the Beacon dashboard as a member of an organization that has managed ingest enabled.
+- System mode only: a browser where an organization member can approve the device.
## What connect does
1. Locates Vector: `--vector-bin`, then `BEACON_VECTOR_BIN`, then `/opt/beacon/bin/vector`, the `beacon-vector` keg in each Homebrew prefix, a linked `vector` in each Homebrew prefix, then `PATH`. The `beacon-vector` keg is tried ahead of any other Homebrew Vector because it is the copy the tap pins at a supported version.
-2. Registers this machine's hostname, operating system, architecture, Beacon version and install mode with the dashboard, and opens `/cli/enroll` in your browser. The approval page shows those details; nothing is minted until someone clicks **Approve this device**.
-3. Receives the device key through a loopback callback and a PKCE exchange. The key is written once to `asymptote/vector-secrets.json` with mode `0600` and is never printed.
-4. Renders `asymptote/vector.toml` from the [Beacon pack](/cli/asymptote) template with the ingest URL returned by enrollment, runs `vector validate`, installs a service unit and starts it.
-5. Records the non-secret enrollment (device id, organization, ingest URL) in `asymptote/enrollment.json` and `config.json`'s `managed_ingest` block.
+2. Uses the signed-in account's `device:enroll` scope to register this machine's hostname, operating system, architecture, Beacon version, install id, and install mode. The server returns a separate `bcn_device_*` ingest key. System mode uses the existing browser PKCE device approval instead.
+3. Writes the device key once to `asymptote/vector-secrets.json` with mode `0600`. The account token is not persisted by the endpoint flow.
+4. Renders `asymptote/vector.toml` with the selected privacy mode, runs `vector validate`, installs a service unit, and starts it.
+5. Records the non-secret enrollment, including privacy mode, in `asymptote/enrollment.json` and `config.json`'s `managed_ingest` block.
-A connect that fails at `vector validate` or at loading the service saves no enrollment record, so the endpoint is not connected: `beacon endpoint status` says so, the next interactive install offers the destination question again, and `beacon endpoint disconnect` cleans up what was written. After `disconnect --keep-credentials`, status reports not connected and names the kept device id.
+A connect that fails at `vector validate` or at loading the service saves no enrollment record, so the endpoint is not connected and `beacon endpoint disconnect` cleans up what was written. After `disconnect --keep-credentials`, status reports not connected and names the kept device id.
Re-running `connect` on a connected machine reuses its install id, so the server rotates the existing device's key in place instead of creating a second device. Under launchd the new forwarder is loaded only after the old one has exited (Vector drains in-flight requests first), and if the new instance has not started within the wait, `connect` fails and points at `launchctl print` for the job (v1.3.2).
+## Privacy modes
+
+The onboarding wizard records one of two modes. `connect` uses that choice unless
+`--privacy-mode` overrides it:
+
+| Mode | Forwarded data |
+|------|----------------|
+| `standard` | The complete locally sanitized event, including retained prompts, responses, reasoning, tool arguments/results, command output, and diffs. Existing local redaction and size limits still apply. |
+| `metadata-only` | Omits prompts, responses, reasoning, tool arguments/results, command output, raw event fields, diffs, inventory file contents, and MCP definitions. Stable ids, hashes, byte counts, actions, timestamps, harness/session/trace identity, token usage, commands, file paths, and other structured metadata remain. |
+
+The transform runs locally in Vector before batching, buffering, or HTTPS upload.
+Changing modes requires rerunning `beacon endpoint connect`; the rendered config and
+status output record the active choice.
+
## Files and services
| Item | User mode | System mode (macOS) | System mode (Linux) |
@@ -49,9 +64,10 @@ The directory is `0700`. The device key appears only in the secrets file, which
| Flag | Description |
|------|-------------|
-| `--dashboard-url <url>` | Beacon dashboard URL. Use `https://beacon.sh` for Beacon Managed. Defaults to `https://asymptotelabs.ai` or `BEACON_DASHBOARD_URL`. Must be `https://` |
-| `--no-browser` | Print the approval URL instead of opening a browser |
+| `--dashboard-url <url>` | Beacon service URL. Defaults to `https://beacon.sh` or `BEACON_DASHBOARD_URL`. In user mode it must match the signed-in account service |
+| `--no-browser` | System mode only: print the approval URL instead of opening a browser |
| `--vector-bin <path>` | Vector binary to run |
+| `--privacy-mode <mode>` | Override the onboarding choice with `standard` or `metadata-only` |
| `--user` | Use per-user endpoint paths. Enabled by default |
| `--system` | Use system endpoint paths and a LaunchDaemon or system unit. Requires root; the browser opens as the active console user |
| `--log-path <path>` | Runtime JSONL log path |
@@ -69,21 +85,25 @@ beacon endpoint connect --dashboard-url https://beacon.sh
sudo /opt/beacon/bin/beacon endpoint connect --system --dashboard-url https://beacon.sh
```
-```bash title="Connect from a machine without a browser"
-beacon endpoint connect --no-browser --dashboard-url https://beacon.sh
+```bash title="Connect a system endpoint from a machine without a browser"
+sudo beacon endpoint connect --system --no-browser --dashboard-url https://beacon.sh
# open the printed URL in a browser where you are signed in
```
+```bash title="Connect with metadata-only forwarding"
+beacon endpoint connect --privacy-mode metadata-only
+```
+
```bash title="Stop forwarding and remove the local credentials"
beacon endpoint disconnect
```
## Checking the connection
-`beacon endpoint status` prints one line for managed ingest: whether this endpoint is connected, to which organization, the device id, whether the forwarder service is loaded and running, whether the credential is still valid (it asks the ingest service, with a 3-second timeout), and the size of the disk buffer. `--json` exposes the same under `managed_ingest`.
+`beacon endpoint status` prints one line for managed ingest: whether this endpoint is connected, organization and device identity, active privacy mode, forwarder state, credential validity, and disk-buffer size. `--json` exposes the same under `managed_ingest`.
```text
-Beacon managed ingest: connected to Beacon Test as device 807c6a11-…; forwarder loaded=true running=true; credential valid
+Beacon Managed: connected to Beacon Test as device 807c6a11-…; forwarder loaded=true running=true; privacy Metadata only; credential valid
```
`credential revoked` means the key was revoked or expired, or the approving user is no longer a member of the organization; Vector is logging 401s and dropping batches. Run `beacon endpoint connect --dashboard-url https://beacon.sh` again to re-enroll.
diff --git a/docs/cli/endpoint-install.mdx b/docs/cli/endpoint-install.mdx
index eaf08ce5..17a51d47 100644
--- a/docs/cli/endpoint-install.mdx
+++ b/docs/cli/endpoint-install.mdx
@@ -54,7 +54,7 @@ signs in through beacon.sh, then asks where this machine's telemetry should go:
| Answer | What happens |
|--------|--------------|
-| Beacon Managed (default) | Shows what will be sent, records the choice, and prints `beacon endpoint connect` as a separate next step. Nothing is forwarded during the wizard. |
+| Beacon Managed (default) | Shows what will be sent, asks for Standard or Metadata-only privacy, records both choices, and prints `beacon endpoint connect` as a separate next step. Nothing is forwarded during the wizard. |
| Local only | Explicitly opts out of managed forwarding. Nothing is sent anywhere. |
`--connect` presets Beacon Managed and runs the connect flow after installation.
diff --git a/docs/cli/endpoint-onboarding.mdx b/docs/cli/endpoint-onboarding.mdx
index 8399275a..a18811b4 100644
--- a/docs/cli/endpoint-onboarding.mdx
+++ b/docs/cli/endpoint-onboarding.mdx
@@ -21,7 +21,8 @@ The first interactive `beacon endpoint install` opens a full-screen terminal wiz
1. Sign in through beacon.sh using the same browser PKCE flow as [`beacon login`](/cli/account-auth).
2. Choose **Local only** or **Beacon Managed**.
-3. Review the destination and confirm installation.
+3. For Managed, choose **Standard** or **Metadata only** forwarding.
+4. Review the destination and privacy mode, then confirm installation.
Signing in establishes account identity only. It does not register a managed endpoint,
start Vector, or send telemetry. Beacon Managed is preselected; choose Local explicitly
@@ -34,6 +35,11 @@ events will be sent to beacon.sh only after you run:
beacon endpoint connect
```
+Standard forwards the complete locally sanitized event. Metadata only strips retained
+prompts, responses, reasoning, tool arguments/results, command output, raw fields,
+diffs, and optional inventory content locally before upload. See
+[`beacon endpoint connect`](/cli/endpoint-connect#privacy-modes) for the exact contract.
+
Completing the wizard records managed intent and prints that next step; it does not
connect automatically. Existing local history is not uploaded. The explicit
`beacon endpoint install --connect` flag remains the exception: it presets Managed
@@ -85,7 +91,7 @@ beacon endpoint onboarding
```
The answer is stored as `onboarding.destination` in `~/.beacon/profile.json`;
-`--json` exposes it as `destination`:
+managed selections also store `onboarding.privacy_mode`. `--json` exposes both:
| Value | Printed as |
|-------|------------|
diff --git a/docs/cli/endpoint-status.mdx b/docs/cli/endpoint-status.mdx
index 644cb627..732b00b5 100644
--- a/docs/cli/endpoint-status.mdx
+++ b/docs/cli/endpoint-status.mdx
@@ -61,7 +61,7 @@ Status includes:
- Endpoint diagnostics
- Destination configuration in JSON output, including Splunk HEC or Falcon LogScale HEC endpoint, index, source, and sourcetype when configured
- Last Beacon event in the runtime log, when present
-- Beacon managed ingest: whether this endpoint is connected, the organization and device id, forwarder service state, whether the device key is still accepted by the ingest service (`valid`, `revoked`, or `unknown` when offline), and the disk buffer size. In `--json` this is the `managed_ingest` object; the device key itself is never included. The line reports the connection for the install mode you asked about (`--user` or `--system`), even when the collector view switches to the system install because it holds the OTLP ports.
+- Beacon Managed: whether this endpoint is connected, organization and device id, active privacy mode, forwarder service state, whether the device key is still accepted (`valid`, `revoked`, or `unknown` when offline), and disk-buffer size. In `--json` this is the `managed_ingest` object; account and device keys are never included. The line reports the connection for the install mode you asked about (`--user` or `--system`), even when the collector view switches to the system install because it holds the OTLP ports.
- Inventory heartbeat: whether the scheduled inventory job is enabled and loaded, its interval, and when it last wrote. In `--json` this is the `inventory_heartbeat` object (`enabled`, `scheduled`, `interval`, `job`, `last_emitted_at`, `log_path`), reported for the requested install mode like managed ingest.
When Splunk HEC is configured, `--json` includes a `destinations.splunk_hec` object with `configured: true` and the non-secret destination settings. When Falcon LogScale HEC is configured, `--json` includes `destinations.falcon_hec` with the same non-secret fields. HEC tokens are not printed. File-based destinations such as Wazuh, Elastic, Datadog, Sumo Logic, Rapid7, Microsoft Sentinel, and AWS S3 validate against the configured runtime log path and their generated shipper configuration.
diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdx
index 626e6f30..b8b26dbb 100644
--- a/docs/get-started/quickstart.mdx
+++ b/docs/get-started/quickstart.mdx
@@ -64,13 +64,15 @@ Send your Beacon telemetry to the hosted service for:
- analytics
- access from anywhere
-[Sign up for Beacon Managed](https://beacon.sh/sign-up), then connect your endpoint:
+Interactive installation signs in and preselects Managed. Connect the endpoint
+after reviewing the privacy choice:
```bash
-beacon endpoint connect --dashboard-url https://beacon.sh
+beacon endpoint connect
```
-Your browser will open so you can sign in and approve the device.
+The existing CLI account authorizes a separate device ingest key; there is no
+second browser approval. Use `--privacy-mode metadata-only` to override Standard.
## 3. Run an agent
@@ -102,7 +104,7 @@ This shows which harnesses are connected, whether the collector is running, and
| --- | --- |
| Check status | `beacon endpoint status` |
| Open local dashboard | `beacon endpoint dashboard --open` |
-| Connect to Beacon Managed | `beacon endpoint connect --dashboard-url https://beacon.sh` |
+| Connect to Beacon Managed | `beacon endpoint connect` |
| Disconnect from Managed | `beacon endpoint disconnect` |
| Upgrade | `brew upgrade beacon` |
| Uninstall | `beacon endpoint uninstall --keep-logs` |
diff --git a/docs/log-forwarding/asymptote.mdx b/docs/log-forwarding/asymptote.mdx
index e9ac2b84..592e0985 100644
--- a/docs/log-forwarding/asymptote.mdx
+++ b/docs/log-forwarding/asymptote.mdx
@@ -7,19 +7,23 @@ description: "Forward Beacon endpoint events to Beacon's managed ingest service
Beacon Managed is the forwarding path that lands Beacon endpoint events on the Beacon dashboard without any customer-run infrastructure. Beacon stays the local JSONL producer. A Vector forwarder on the endpoint tails the [runtime JSONL log](/concepts/core-concepts#runtime-jsonl-log) and the inventory log and POSTs gzip-compressed NDJSON batches over HTTPS to Beacon's ingest service, authenticated with a key issued to that one device.
-This is the only Beacon destination that sends telemetry to a Beacon-run endpoint, and it is opt-in. Beacon's default remains local-only; nothing is forwarded until a member of your Beacon organization approves the device in the browser and the forwarder is started with the resulting key. Revoking the device from the dashboard's Beacon Endpoints page stops ingestion within about a minute.
+This is the only Beacon destination that sends telemetry to a Beacon-run endpoint. It is preselected during interactive onboarding, but nothing is forwarded until the separate connect command mints a device key and starts the forwarder. Choosing Local explicitly opts out. Revoking the device from the dashboard's Beacon Endpoints page stops ingestion within about a minute.
Generate the pack with [`beacon endpoint asymptote`](/cli/asymptote). `beacon endpoint connect` performs enrollment and runs the forwarder as a service; the pack is for running or inspecting the same forwarder by hand.
## What leaves the machine
-Every line written to `runtime.jsonl` after the forwarder starts, and every line of `inventory_state.jsonl`, exactly as Beacon wrote them locally. Beacon's [retention and redaction](/security/retention-redaction) settings apply before a line is written, so they apply to what is forwarded. The ingest service adds a `tenant` block (organization, device, approving user, receive time) to every event server-side and ignores any tenant fields sent by the client.
+Standard mode forwards every line written after the forwarder starts exactly as Beacon wrote it locally. Metadata-only mode applies a local Vector transform first, removing retained prompts, responses, reasoning, tool arguments/results, command output, raw fields, diffs, inventory content, and MCP definitions while preserving stable ids, hashes, counts, actions, paths, token usage, and other structured metadata. Beacon's [retention and redaction](/security/retention-redaction) controls still run before either mode. The ingest service adds tenant identity server-side.
Nothing else is sent. The forwarder does not read prompts, files, environment variables, or shell history beyond what the events already contain.
## How identity works
-Each enrolled machine gets its own key. Enrollment is a browser flow: the CLI registers the machine's hostname, operating system, and Beacon version, opens the dashboard, and a signed-in member of the organization chooses the organization and clicks Approve. The key is minted only after that click and is shown to the CLI once. It is stored in a `0600` secrets file that Vector reads through its secret backend, so the key is in neither `vector.toml` nor the environment of the Vector process.
+Each enrolled machine gets its own key. For user mode, the signed-in CLI account's
+`device:enroll` scope authorizes the key without another browser round trip. System
+mode retains browser approval. The account token is never written into endpoint
+state; the returned device key is stored in a `0600` secrets file that Vector reads
+through its secret backend.
The ingest service checks three things on every request: the key is known and not revoked or expired, the user who approved the device is still a member of the organization, and the organization is enabled for managed ingest. Those checks are cached for one minute, which is the longest a revoked device can keep sending.
diff --git a/docs/security/data-flow-threat-model.mdx b/docs/security/data-flow-threat-model.mdx
index 67c924be..85a86b68 100644
--- a/docs/security/data-flow-threat-model.mdx
+++ b/docs/security/data-flow-threat-model.mdx
@@ -28,17 +28,17 @@ flowchart LR
| Local storage | Beacon writes one JSON object per line to `runtime.jsonl` | Filesystem permissions and log ownership |
| Local inspection | The dashboard reads the runtime log over a loopback-only service | Local browser to local dashboard service |
| Optional forwarding | Wazuh, Elastic/Filebeat, Datadog Agent, Sumo Logic, Rapid7, Microsoft Sentinel, AWS S3, Google Cloud Storage, Splunk HEC, Falcon LogScale HEC, or customer-managed shippers read or receive events | Customer-managed network and SIEM boundary |
-| Beacon Managed forwarding (opt-in) | A Vector forwarder posts runtime and inventory JSONL over HTTPS to Beacon's ingest service with a per-device key issued after browser approval | Endpoint to Beacon-run service; identity derived from the key, revocable from the dashboard |
+| Beacon Managed forwarding | After an explicit connect, Vector posts Standard or locally transformed metadata-only runtime/inventory NDJSON over HTTPS with a per-device key | Endpoint to Beacon-run service; identity derived from the device key, revocable from the dashboard |
## Threat model
| Risk | Design response |
|------|-----------------|
-| Unintended hosted telemetry | Normal endpoint collection writes local JSONL and does not require a Beacon-hosted account, remote policy fetch, or external network dependency. Beacon Managed forwarding starts only after a member of the organization approves the specific device in the browser, forwards only lines written after that approval, and stops within a minute of revocation |
+| Unintended hosted telemetry | Managed is preselected in interactive onboarding, but selection and account sign-in do not forward anything. Forwarding starts only after the separate connect command, sends only new lines, records the active privacy mode, and stops within a minute of revocation |
| Network exposure of collectors | Default OTLP receivers bind to `127.0.0.1` rather than an externally reachable interface |
-| Over-collection of prompt or diff content | Scope supported runtimes and hook deployment deliberately before rollout, and review destination access for retained local telemetry |
+| Over-collection of prompt or diff content | Standard applies local sanitization and size controls. Metadata-only additionally strips retained prompts, responses, reasoning, tool arguments/results, command output, raw fields, diffs, inventory content, and MCP definitions in Vector before buffering or upload |
| Secret leakage in retained content | Beacon applies redaction, sanitization, truncation, and event-size limits before writing supported content fields |
-| Destination credential exposure | Persistent endpoint file-based destinations tail local JSONL, so Beacon endpoint configuration does not store Elastic, Datadog, Sumo Logic, Rapid7, Microsoft Sentinel, AWS, or Google Cloud credentials. Optional Splunk and Falcon tokens live in collector configuration. The Beacon Managed device key is a per-machine credential stored in a `0600` secrets file read through Vector's secret backend, never in `config.json`, `vector.toml`, or the process environment; it grants only the right to post events for one device and is revocable from the dashboard. Self-serve cloud-agent uploads are a separate proof-of-concept path: scoped GCS or AWS credentials are injected into the provider-managed sandbox as runtime secrets and must be rotated and access-reviewed. |
+| Destination credential exposure | Persistent endpoint file-based destinations tail local JSONL, so Beacon endpoint configuration does not store Elastic, Datadog, Sumo Logic, Rapid7, Microsoft Sentinel, AWS, or Google Cloud credentials. Optional Splunk and Falcon tokens live in collector configuration. The CLI account token authorizes user-mode enrollment once and is never copied into endpoint state or Vector. The resulting per-machine device key is stored in a `0600` secrets file read through Vector's secret backend, never in `config.json`, `vector.toml`, or the process environment; it grants only per-device ingest and is revocable. Self-serve cloud-agent uploads are a separate proof-of-concept path: scoped GCS or AWS credentials are injected into the provider-managed sandbox as runtime secrets and must be rotated and access-reviewed. |
| Removal uncertainty | Endpoint uninstall removes managed service and configuration state, with explicit `--keep-logs` and `--keep-config` exceptions |
## Current boundaries
diff --git a/docs/security/retention-redaction.mdx b/docs/security/retention-redaction.mdx
index 18b046b1..883c76fc 100644
--- a/docs/security/retention-redaction.mdx
+++ b/docs/security/retention-redaction.mdx
@@ -75,10 +75,11 @@ and customer-managed shippers read the resulting local JSONL. Supported cloud
agents upload a compressed snapshot of their sandbox-local JSONL directly to
customer-managed GCS or S3. Splunk HEC and Falcon LogScale HEC forwarding
receive the same normalized collector output according to the configured
-endpoint pipeline. Beacon managed ingest, when a device has been connected,
-forwards the runtime and inventory JSONL lines written after approval exactly as
-stored locally, so the same retention and redaction settings govern what
-reaches the Beacon dashboard.
+endpoint pipeline. Beacon Managed Standard mode forwards new runtime and
+inventory lines as stored locally. Metadata-only mode adds a local Vector
+transform that removes retained text, tool arguments/results, command output,
+raw fields, diffs, inventory content, and MCP definitions before buffering or
+upload while preserving stable metadata, hashes, counts, and token usage.
Review runtime scope, artifact access, destination permissions, and downstream retention before rollout so retained content matches your approved telemetry policy.