The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
Record an accepted forwarding offer only once the machine is connected
shukieshah1cbeccdf0233
diff --git a/CLAUDE.md b/CLAUDE.mdindex e983b7fa..f9659f40 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -20,7 +20,7 @@ Do not recreate or depend on removed `asymptote` mirror trees. Keep new work foc- Beacon is visibility-first endpoint telemetry for local AI agent runtimes, not a hosted policy service or general endpoint protection product.- Preserve the local-only default. The public Beacon build must not require a hosted account, remote policy fetch, hosted dashboard, or external network dependency during normal hook execution, and hooks themselves never touch the network.- Asymptote Managed forwarding (`cli/beacon/internal/endpoint/asymptote`, `beacon endpoint asymptote`) is the one destination that sends telemetry to an Asymptote-run service, and it is an explicit, opt-in, revocable Vector destination shaped like every other pack: Beacon stays the local JSONL producer, Vector does the network, and the per-device key lives in a `0600` secrets file read through Vector's secret backend, never in `config.json`, `vector.toml`, or the process environment. Nothing is forwarded until a member of the organization approves the specific device in the browser; only lines written after that are shipped (`read_from = "end"`); revocation from the dashboard takes effect at the ingest service within a minute. The wire contract (gzip NDJSON to `/v1/ingest/{runtime,inventory}`, bearer `bcn_device_*` key, `/v1/ingest/health` credential check) is owned by the `beacon-ingest` service in beacon-mdr; change both sides together. Do not add a second network channel, and do not let the ingest URL be anything but `https://`.-- Two bounded network channels exist, both explicit. The first: `beacon endpoint install` asks for an email and work/personal intent once per machine and POSTs that plus install context (OS, arch, version, install method, detected runtime names, a random install ID) to an Asymptote-run signup endpoint. The same first-run prompt, when Vector is present, also offers to connect the machine to Asymptote Managed (default no; `BEACON_MANAGED_INGEST=0` silences it; `install --connect` forces it; asked at most once per machine and recorded in the profile); a yes runs `connect` after the install and is the only way onboarding ever forwards telemetry. The second channel is that forwarder, described below. This is intentional product behavior for open-source attribution, not an oversight — do not remove it. It is strictly bounded: interactive TTY only, once per machine, never during hook execution, never on `--system`/root/CI/piped-stdin/`--dry-run` installs, and always skippable with `--no-onboarding` or `BEACON_ONBOARDING=0`. A failed submission never fails an install. No prompt text, telemetry event, file content, or command ever leaves the machine through it. Implementation lives in `cli/beacon/internal/onboarding` and `cli/beacon/cmd/endpoint_onboarding.go`; the README documents the payload field-by-field, so changing the fields means changing that table too.+- Two bounded network channels exist, both explicit. The first: `beacon endpoint install` asks for an email and work/personal intent once per machine and POSTs that plus install context (OS, arch, version, install method, detected runtime names, a random install ID) to an Asymptote-run signup endpoint. The same first-run prompt, when Vector is present, also offers to connect the machine to Asymptote Managed (default no; `BEACON_MANAGED_INGEST=0` silences it; `install --connect` forces it; a no is recorded in the profile and never asked again; a yes runs `connect` after the install, is recorded only once that connect succeeds so a failed install or connect is asked again rather than remembered as done, and is the only way onboarding ever forwards telemetry). The second channel is that forwarder, described below. This is intentional product behavior for open-source attribution, not an oversight — do not remove it. It is strictly bounded: interactive TTY only, once per machine, never during hook execution, never on `--system`/root/CI/piped-stdin/`--dry-run` installs, and always skippable with `--no-onboarding` or `BEACON_ONBOARDING=0`. A failed submission never fails an install. No prompt text, telemetry event, file content, or command ever leaves the machine through it. Implementation lives in `cli/beacon/internal/onboarding` and `cli/beacon/cmd/endpoint_onboarding.go`; the README documents the payload field-by-field, so changing the fields means changing that table too.- Do not add dependency vulnerability scanning, OSV/GHSA lookups, package remediation, or other vulnerability-enforcement flows to the public hook path.- Do not add broad runtime enforcement unless explicitly requested. Current control behavior is limited to hook-native approvals/denials exposed by supported agent runtimes.- Keep direct destination support scoped to local JSONL/Wazuh unless explicitly requested. Elastic support is a file-tailing pack over local JSONL; Beacon itself must not store Elastic credentials or require a hosted Elastic dependency.diff --git a/README.md b/README.mdindex b167f1af..0f82be83 100644--- a/README.md+++ b/README.md@@ -261,8 +261,9 @@ Asymptote dashboard, a member of your organization approves this specific deviceVector forwarder starts shipping the runtime and inventory JSONL with a per-device key.Nothing recorded before the approval is sent, and the device can be revoked from thedashboard at any time. `beacon endpoint install --connect` forces the same flow,-`BEACON_MANAGED_INGEST=0` silences the question, and the question is asked at most once-per machine. See [`beacon endpoint connect`](https://docs.asymptotelabs.ai/cli/endpoint-connect)+`BEACON_MANAGED_INGEST=0` silences the question. A no is recorded and never asked again;+a yes is recorded once the machine is connected, so a failed install or connection is+asked again on the next interactive install. See [`beacon endpoint connect`](https://docs.asymptotelabs.ai/cli/endpoint-connect)and [Asymptote Managed forwarding](https://docs.asymptotelabs.ai/log-forwarding/asymptote).See the [first-run onboarding docs](https://docs.asymptotelabs.ai/cli/endpoint-onboarding#first-run-onboarding)diff --git a/cli/beacon/cmd/endpoint_install.go b/cli/beacon/cmd/endpoint_install.goindex 0a8c5fb3..61e17800 100644--- a/cli/beacon/cmd/endpoint_install.go+++ b/cli/beacon/cmd/endpoint_install.go@@ -104,11 +104,11 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {}// Asked once, on an interactive install, before anything is written to disk. Every// non-interactive path (package postinstall, MDM, CI) is gated out inside.- connectAfterInstall, err := maybeRunOnboarding(cmd)+ acceptedOffer, err := maybeRunOnboarding(cmd)if err != nil {return err}- connectAfterInstall = connectAfterInstall || endpointOpts.connect+ connectAfterInstall := acceptedOffer || endpointOpts.connectresult, err := lifecycle.Install(lifecycle.InstallOptions{UserMode: endpointUserMode(),LogPath: endpointOpts.logPath,@@ -141,6 +141,8 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {fmt.Fprintln(cmd.OutOrStdout())if err := connectEndpoint(cmd, endpointUserMode(), result.LogPath); err != nil {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: managed ingest was not connected (%v). Run `beacon endpoint connect` to try again.\n", err)+ } else if acceptedOffer {+ recordManagedIngestAccepted(cmd)}}return nildiff --git a/cli/beacon/cmd/endpoint_onboarding.go b/cli/beacon/cmd/endpoint_onboarding.goindex 31a32aea..b671160b 100644--- a/cli/beacon/cmd/endpoint_onboarding.go+++ b/cli/beacon/cmd/endpoint_onboarding.go@@ -94,7 +94,7 @@ func maybeRunOnboarding(cmd *cobra.Command) (connect bool, err error) {// A headless rollout that supplied answers is recorded without a terminal.if email, usage, ok := onboardingAnswersFromEnv(cmd.ErrOrStderr()); ok {- completeOnboarding(cmd, &profile, email, usage, nil, nil)+ completeOnboarding(cmd, &profile, email, usage, nil, "")return false, nil}@@ -111,11 +111,16 @@ func maybeRunOnboarding(cmd *cobra.Command) (connect bool, err error) {if err != nil {return false, err}- var choice *bool- if answers.ManagedIngestOffered {- choice = &answers.ManagedIngest+ // A no is final and recorded now. A yes is recorded by the install once the machine+ // is actually connected (recordManagedIngestAccepted): if the install or the connect+ // fails first, the record stays empty and the next interactive install asks again,+ // instead of a stored "accepted" silencing the question on a machine that never+ // forwarded anything.+ record := ""+ if answers.ManagedIngestOffered && !answers.ManagedIngest {+ record = onboarding.ManagedIngestDeclined}- completeOnboarding(cmd, &profile, answers.Email, answers.Usage, probe, choice)+ completeOnboarding(cmd, &profile, answers.Email, answers.Usage, probe, record)return answers.ManagedIngestOffered && answers.ManagedIngest, nil}@@ -133,11 +138,29 @@ func maybeOfferManagedIngest(cmd *cobra.Command, profile *onboarding.Profile) (bif err != nil {return false, err}- profile.Onboarding.ManagedIngest = managedIngestChoice(connect)+ if connect {+ // Recorded by recordManagedIngestAccepted once the connect has succeeded.+ return true, nil+ }+ profile.Onboarding.ManagedIngest = onboarding.ManagedIngestDeclinedif err := onboardingSave(*profile); err != nil {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: could not record onboarding: %v\n", err)}- return connect, nil+ return false, nil+}++// recordManagedIngestAccepted stores the yes answer after `endpoint install` has connected+// the machine. Until then the offer is unrecorded on purpose, so a failed install or+// connect is retried by asking again rather than remembered as done.+func recordManagedIngestAccepted(cmd *cobra.Command) {+ profile := onboardingLoad()+ if !profile.Prompted() {+ return+ }+ profile.Onboarding.ManagedIngest = onboarding.ManagedIngestAccepted+ if err := onboardingSave(profile); err != nil {+ fmt.Fprintf(cmd.ErrOrStderr(), "beacon: could not record onboarding: %v\n", err)+ }}// managedIngestSkipReason mirrors onboardingSkipReason for the forwarding question, with@@ -185,13 +208,6 @@ func defaultManagedIngestOfferable() bool {return err == nil}-func managedIngestChoice(connect bool) string {- if connect {- return onboarding.ManagedIngestAccepted- }- return onboarding.ManagedIngestDeclined-}-// onboardingSkipReason reports whether the prompt should stay silent, and why.func onboardingSkipReason(profile onboarding.Profile) (string, bool) {switch {@@ -265,7 +281,11 @@ func onboardingAnswersFromEnv(stderr io.Writer) (string, string, bool) {//// It never returns an error. Once the user has answered, the install belongs to them;// a signup endpoint being unreachable is our problem, not theirs.-func completeOnboarding(cmd *cobra.Command, profile *onboarding.Profile, email, usage string, probe *onboarding.RuntimeProbe, managedIngest *bool) {+//+// managedIngest is the forwarding record to store alongside the answers: declined, or ""+// when the question was not asked or was accepted (accepted is stored by the install+// after the connect succeeds).+func completeOnboarding(cmd *cobra.Command, profile *onboarding.Profile, email, usage string, probe *onboarding.RuntimeProbe, managedIngest string) {installID, err := onboarding.EnsureInstallID(profile)if err != nil {// Without an install ID there is no dedupe key, so there is nothing sensible@@ -297,9 +317,7 @@ func completeOnboarding(cmd *cobra.Command, profile *onboarding.Profile, email,Usage: usage,BeaconVersion: version.GetVersion(),}- if managedIngest != nil {- profile.Onboarding.ManagedIngest = managedIngestChoice(*managedIngest)- }+ profile.Onboarding.ManagedIngest = managedIngest// Keep the payload only when resending could still work. A rejected submission is// terminal, and holding the address on disk past that point serves nobody.if outcome == onboarding.OutcomePending {diff --git a/cli/beacon/cmd/endpoint_onboarding_test.go b/cli/beacon/cmd/endpoint_onboarding_test.goindex e76393e1..1009687f 100644--- a/cli/beacon/cmd/endpoint_onboarding_test.go+++ b/cli/beacon/cmd/endpoint_onboarding_test.go@@ -546,8 +546,8 @@ func TestMaybeRunOnboardingOffersManagedIngestOnlyWhenOfferable(t *testing.T) {if !h.offered[0].OfferManagedIngest {t.Fatal("prompt should have been asked to offer managed ingest")}- if got := h.saved[len(h.saved)-1].Onboarding.ManagedIngest; got != onboarding.ManagedIngestAccepted {- t.Fatalf("recorded choice = %q", got)+ if got := h.saved[len(h.saved)-1].Onboarding.ManagedIngest; got != "" {+ t.Fatalf("a yes is recorded only once the install has connected the machine, got %q", got)}h = newOnboardingHarness(t)@@ -589,7 +589,19 @@ func TestManagedIngestOfferedOnceToPreviouslyOnboardedMachine(t *testing.T) {if !h.standaloneAsked {t.Fatal("the forwarding question should be asked once on an already-onboarded machine")}- if got := h.saved[len(h.saved)-1].Onboarding.ManagedIngest; got != onboarding.ManagedIngestAccepted {+ if len(h.saved) != 0 {+ t.Fatalf("a yes must not be recorded before the connect succeeds: %+v", h.saved)+ }++ // A no is recorded at once.+ h = newOnboardingHarness(t)+ h.offerable = true+ h.loaded = onboarding.Profile{InstallID: "abc", Onboarding: onboarding.Onboarding{CompletedAt: "2026-08-01T00:00:00Z"}}+ h.standaloneAnswer = false+ if connect, _ := maybeRunOnboarding(h.cmd); connect || !h.standaloneAsked {+ t.Fatalf("connect=%t asked=%t", connect, h.standaloneAsked)+ }+ if got := h.saved[len(h.saved)-1].Onboarding.ManagedIngest; got != onboarding.ManagedIngestDeclined {t.Fatalf("recorded choice = %q", got)}@@ -618,6 +630,53 @@ func TestManagedIngestOfferedOnceToPreviouslyOnboardedMachine(t *testing.T) {}}+// A yes whose install or connect failed must be asked again, not remembered as done: the+// record is written only by recordManagedIngestAccepted, after the machine is connected.+func TestManagedIngestAcceptedIsRecordedAfterConnect(t *testing.T) {+ h := newOnboardingHarness(t)+ h.offerable = true+ h.answers.ManagedIngestOffered = true+ h.answers.ManagedIngest = true+ if connect, err := maybeRunOnboarding(h.cmd); err != nil || !connect {+ t.Fatalf("connect=%t err=%v", connect, err)+ }+ afterPrompt := h.saved[len(h.saved)-1]+ if afterPrompt.Onboarding.ManagedIngest != "" {+ t.Fatalf("recorded before connect: %q", afterPrompt.Onboarding.ManagedIngest)+ }++ // The install failed before connecting: the next interactive install asks again.+ h2 := newOnboardingHarness(t)+ h2.offerable = true+ h2.loaded = afterPrompt+ h2.standaloneAnswer = true+ if connect, err := maybeRunOnboarding(h2.cmd); err != nil || !connect || !h2.standaloneAsked || h2.asked {+ t.Fatalf("connect=%t err=%v standaloneAsked=%t signupAsked=%t", connect, err, h2.standaloneAsked, h2.asked)+ }++ // The install connected: the yes is recorded and the question retires.+ h3 := newOnboardingHarness(t)+ h3.offerable = true+ h3.loaded = afterPrompt+ recordManagedIngestAccepted(h3.cmd)+ if got := h3.saved[len(h3.saved)-1].Onboarding.ManagedIngest; got != onboarding.ManagedIngestAccepted {+ t.Fatalf("recorded choice = %q", got)+ }+ h4 := newOnboardingHarness(t)+ h4.offerable = true+ h4.loaded = h3.saved[len(h3.saved)-1]+ if connect, _ := maybeRunOnboarding(h4.cmd); connect || h4.standaloneAsked {+ t.Fatalf("a recorded yes must not be asked again: connect=%t asked=%t", connect, h4.standaloneAsked)+ }++ // Never written for a machine that was not onboarded (root, CI, --connect without a prompt).+ h5 := newOnboardingHarness(t)+ recordManagedIngestAccepted(h5.cmd)+ if len(h5.saved) != 0 {+ t.Fatalf("no profile should be written without a completed onboarding: %+v", h5.saved)+ }+}+func TestInstallHasConnectFlag(t *testing.T) {if endpointInstallCmd.Flags().Lookup("connect") == nil {t.Fatal("endpoint install should expose --connect")diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdxindex 1b70957a..4dd827b5 100644--- a/docs/changelog/cli.mdx+++ b/docs/changelog/cli.mdx@@ -17,7 +17,7 @@ Stay up to date with the latest changes to the Agent Beacon CLI.first-run prompt asks one more question, whether to forward this machine'stelemetry to Asymptote Managed (default no); yes runs `beacon endpoint connect`after the install. `beacon endpoint install --connect` forces it,- `BEACON_MANAGED_INGEST=0` silences it, the answer is recorded once per machine+ `BEACON_MANAGED_INGEST=0` silences it, a no is recorded once per machine and a yes once the machine is connectedand shown by `beacon endpoint onboarding`. The Homebrew formula now depends on`vector` so a Homebrew install can connect without a second step.- **`beacon endpoint connect` and `disconnect`** · Connect an endpoint todiff --git a/docs/cli/endpoint-install.mdx b/docs/cli/endpoint-install.mdxindex 6895efcb..698a910d 100644--- a/docs/cli/endpoint-install.mdx+++ b/docs/cli/endpoint-install.mdx@@ -47,7 +47,7 @@ By default, Beacon configures Claude Code and Codex CLI telemetry for local or c## Managed ingest offer-On a first interactive install where Vector is available, the [onboarding prompt](/cli/endpoint-onboarding) ends with one more question: whether to forward this machine's agent telemetry to Asymptote Managed now. The default is no. Answering yes runs the connect flow after the install completes; a failed connect is reported with the retry command and never fails the install. `BEACON_MANAGED_INGEST=0` suppresses the question, the question is never shown non-interactively, and it is asked at most once per machine.+On a first interactive install where Vector is available, the [onboarding prompt](/cli/endpoint-onboarding) ends with one more question: whether to forward this machine's agent telemetry to Asymptote Managed now. The default is no. Answering yes runs the connect flow after the install completes; a failed connect is reported with the retry command and never fails the install. `BEACON_MANAGED_INGEST=0` suppresses the question and it is never shown non-interactively. A no is recorded at once and the question is not asked again. A yes is recorded only once the machine is connected, so if the install or the connection fails, the next interactive install asks again.## Examplesdiff --git a/docs/cli/endpoint-onboarding.mdx b/docs/cli/endpoint-onboarding.mdxindex 9f18ed18..f9a276dd 100644--- a/docs/cli/endpoint-onboarding.mdx+++ b/docs/cli/endpoint-onboarding.mdx@@ -74,7 +74,8 @@ is reported on stderr and ignored rather than failing the install.## ExamplesShow what was recorded, including the answer to the managed-forwarding question-(`Managed ingest offer: accepted` or `declined`; absent when it has not been asked):+(`Managed ingest offer: accepted` or `declined`; absent when it has not been asked, or when+a yes has not yet been carried through to a connected machine):```bash title="Show the onboarding record"beacon endpoint onboarding