Skip to content

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

add factory support

Justin D'Souza6a7cef5d98f9
diff --git a/README.md b/README.md
index 1a155400..573c9ebd 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ often have little unified visibility into prompts, tools, approvals, commands,
and file changes across local agent harnesses.
Beacon runs locally on the endpoint, captures supported activity from Claude
-Code, Codex CLI, Claude Cowork, and Cursor, and normalizes it into
+Code, Codex CLI, Factory Droid, Claude Cowork, and Cursor, and normalizes it into
Wazuh-compatible JSONL for existing localfile/Wazuh or customer-managed
pipelines. Splunk HEC forwarding is available as an optional collector
destination for teams that want direct SIEM ingestion.
@@ -38,8 +38,9 @@ destination for teams that want direct SIEM ingestion.
- **Local-only by default:** no hosted account, remote policy fetch, or external
network dependency during normal endpoint collection.
-- **Built for AI runtimes:** captures supported Claude Code, Codex CLI, Cursor,
- and Claude Cowork activity where those runtimes expose telemetry.
+- **Built for AI runtimes:** captures supported Claude Code, Codex CLI, Factory
+ Droid, Cursor, and Claude Cowork activity where those runtimes expose
+ telemetry.
- **Security-team friendly:** ships macOS package assets for Jamf Pro and Fleet
deployment, validation, repair, and inventory.
- **SIEM-ready output:** writes Wazuh-compatible JSONL for local or
@@ -116,9 +117,9 @@ Read more in
Beacon can currently:
- **Runtime discovery:** discover supported local agent runtimes: Claude Code,
- Codex CLI, Cursor, and Claude Cowork.
-- **Local OTLP setup:** configure Claude Code and Codex CLI to export
- OpenTelemetry to a localhost collector.
+ Codex CLI, Factory Droid, Cursor, and Claude Cowork.
+- **Local OTLP setup:** configure Claude Code, Codex CLI, and Factory Droid to
+ export OpenTelemetry to a localhost collector.
- **Cursor hooks:** install Cursor hooks that emit local endpoint events for
sessions, prompt submission, tool use, command execution, MCP-like tool
activity, approval decisions, and file edits where Cursor exposes those hook
@@ -215,9 +216,21 @@ beacon endpoint status
```
The normal CLI flow uses per-user endpoint paths by default. Cursor hooks,
-Claude Code OTLP, and Codex OTLP all write to the same user runtime log:
-`~/.beacon/endpoint/logs/runtime.jsonl`. Use `--system` only for root-managed
-package or MDM deployments.
+Claude Code OTLP, Codex OTLP, and Factory Droid OTLP metrics can all write to
+the same user runtime log: `~/.beacon/endpoint/logs/runtime.jsonl`. Use
+`--system` only for root-managed package or MDM deployments.
+
+Factory Droid exports OTLP metrics over HTTP from its launch environment.
+For local testing, set the Factory OTEL endpoint before launching `droid`:
+
+```bash
+export OTEL_TELEMETRY_ENDPOINT="http://127.0.0.1:4318"
+droid exec "review this repository"
+```
+
+For enterprise rollout, manage that environment through MDM or another
+customer-owned launch policy. Beacon discovers Droid and validates the effective
+OTEL endpoint, but it does not mutate Droid shell profiles.
Command details: [`beacon endpoint install`](https://docs.asymptotelabs.ai/cli/endpoint-install)
and [`beacon endpoint status`](https://docs.asymptotelabs.ai/cli/endpoint-status).
@@ -364,7 +377,7 @@ beacon endpoint integrations claude-cowork validate --since 10m
beacon endpoint uninstall --keep-logs
```
-- `beacon endpoint install`: configure the endpoint agent, Collector service, and Claude/Codex telemetry.
+- `beacon endpoint install`: configure the endpoint agent, Collector service, and Claude/Codex/Factory telemetry.
- `beacon endpoint repair`: reapply service/config files and repair telemetry drift.
- `beacon endpoint status`: show Collector, service, harness, and diagnostic status.
- `beacon endpoint discover`: list supported local AI runtimes.
@@ -410,7 +423,7 @@ installs the CLI, collector, Wazuh content pack, and deployment scripts. The
package should apply explicit system endpoint settings, for example:
```bash
-beacon endpoint install --system --harness claude,codex --content-retention full
+beacon endpoint install --system --harness claude,codex,factory --content-retention full
```
See [MDM Deployment](https://docs.asymptotelabs.ai/cli/mdm-deployment) for the
diff --git a/cli/beacon/internal/endpoint/harness/harness.go b/cli/beacon/internal/endpoint/harness/harness.go
index 12239c1f..efd6f2a4 100644
--- a/cli/beacon/internal/endpoint/harness/harness.go
+++ b/cli/beacon/internal/endpoint/harness/harness.go
@@ -47,6 +47,7 @@ func DiscoverAll() []Harness {
return []Harness{
DiscoverClaude(),
DiscoverCodex(),
+ DiscoverFactory(),
DiscoverCursor(),
DiscoverClaudeCowork(),
}
@@ -105,6 +106,27 @@ func DiscoverCodex() Harness {
return h
}
+func DiscoverFactory() Harness {
+ h := Harness{Name: "factory", DisplayName: "Factory Droid", Capability: "otel_env"}
+ path, err := exec.LookPath("droid")
+ if err == nil {
+ h.Detected = true
+ h.ExecutablePath = path
+ h.Version = commandVersion(path)
+ }
+ home, _ := os.UserHomeDir()
+ h.ConfigPath = factoryProfilePath(home)
+ if fileExists(h.ConfigPath) {
+ status, msg := factoryStatus(h.ConfigPath)
+ h.TelemetryStatus = status
+ h.Message = msg
+ } else {
+ h.TelemetryStatus = TelemetryMissing
+ h.Message = "Factory Droid telemetry is configured by the launch environment; set OTEL_TELEMETRY_ENDPOINT to the local OTLP HTTP receiver"
+ }
+ return h
+}
+
func DiscoverCursor() Harness {
h := Harness{Name: "cursor", DisplayName: "Cursor", Capability: "hooks"}
path, err := exec.LookPath("cursor")
@@ -201,6 +223,7 @@ func ConfigureCodex(opts ConfigureOptions) (string, error) {
func ValidateConfigured(endpoint string) []ValidationResult {
claude := DiscoverClaude()
codex := DiscoverCodex()
+ factory := DiscoverFactory()
return []ValidationResult{
{
Harness: claude.Name,
@@ -212,6 +235,11 @@ func ValidateConfigured(endpoint string) []ValidationResult {
Status: codex.TelemetryStatus,
Message: validateEndpointMessage(codex.TelemetryStatus, codex.Message, endpoint),
},
+ {
+ Harness: factory.Name,
+ Status: factory.TelemetryStatus,
+ Message: validateEndpointMessage(factory.TelemetryStatus, factory.Message, endpoint),
+ },
}
}
@@ -318,6 +346,46 @@ func codexStatus(path string) (TelemetryStatus, string) {
return TelemetryEnabled, "Codex telemetry is configured for local OTLP"
}
+func factoryStatus(path string) (TelemetryStatus, string) {
+ data, err := os.ReadFile(path)
+ if err != nil {
+ return TelemetryMissing, err.Error()
+ }
+ text := string(data)
+ endpoint := shellExportValue(text, "OTEL_TELEMETRY_ENDPOINT")
+ if endpoint == "" {
+ return TelemetryDisabled, "Factory Droid OTEL_TELEMETRY_ENDPOINT is not configured"
+ }
+ if !strings.Contains(endpoint, "127.0.0.1") && !strings.Contains(endpoint, "localhost") {
+ return TelemetryMisconfigured, "Factory Droid OTEL endpoint does not point to localhost"
+ }
+ return TelemetryEnabled, "Factory Droid telemetry is configured for local OTLP HTTP"
+}
+
+func shellExportValue(text, key string) string {
+ for _, line := range strings.Split(text, "\n") {
+ line = strings.TrimSpace(line)
+ line = strings.TrimPrefix(line, "export ")
+ if !strings.HasPrefix(line, key+"=") {
+ continue
+ }
+ value := strings.TrimSpace(strings.TrimPrefix(line, key+"="))
+ return strings.Trim(value, `"'`)
+ }
+ return ""
+}
+
+func factoryProfilePath(home string) string {
+ switch filepath.Base(os.Getenv("SHELL")) {
+ case "zsh":
+ return filepath.Join(home, ".zshrc")
+ case "bash":
+ return filepath.Join(home, ".bash_profile")
+ default:
+ return filepath.Join(home, ".profile")
+ }
+}
+
func commandVersion(path string) string {
cmd := exec.Command(path, "--version")
timer := time.AfterFunc(2*time.Second, func() { _ = cmd.Process.Kill() })
diff --git a/cli/beacon/internal/endpoint/harness/harness_test.go b/cli/beacon/internal/endpoint/harness/harness_test.go
index f0126f13..13422fcf 100644
--- a/cli/beacon/internal/endpoint/harness/harness_test.go
+++ b/cli/beacon/internal/endpoint/harness/harness_test.go
@@ -249,3 +249,56 @@ func TestCodexStatusVariants(t *testing.T) {
})
}
}
+
+func TestDiscoverFactoryDetectsExecutableOnPath(t *testing.T) {
+ home := t.TempDir()
+ t.Setenv("HOME", home)
+ t.Setenv("SHELL", "/bin/bash")
+ binDir := t.TempDir()
+ t.Setenv("PATH", binDir)
+ droidPath := filepath.Join(binDir, "droid")
+ if err := os.WriteFile(droidPath, []byte("#!/bin/sh\necho 0.127.0\n"), 0755); err != nil {
+ t.Fatalf("write fake droid executable: %v", err)
+ }
+
+ h := DiscoverFactory()
+ if !h.Detected {
+ t.Fatalf("DiscoverFactory did not detect executable on PATH: %#v", h)
+ }
+ if h.ExecutablePath != droidPath {
+ t.Fatalf("ExecutablePath = %q, want %q", h.ExecutablePath, droidPath)
+ }
+ if h.Version != "0.127.0" {
+ t.Fatalf("Version = %q, want fake executable version", h.Version)
+ }
+ if h.ConfigPath != filepath.Join(home, ".bash_profile") {
+ t.Fatalf("ConfigPath = %q, want bash profile", h.ConfigPath)
+ }
+}
+
+func TestFactoryStatusVariants(t *testing.T) {
+ dir := t.TempDir()
+ tests := []struct {
+ name string
+ body string
+ status TelemetryStatus
+ }{
+ {name: "missing export", body: `export OTHER=1`, status: TelemetryDisabled},
+ {name: "remote endpoint", body: `export OTEL_TELEMETRY_ENDPOINT="https://example.com:4318"`, status: TelemetryMisconfigured},
+ {name: "localhost enabled", body: `export OTEL_TELEMETRY_ENDPOINT="http://localhost:4318"`, status: TelemetryEnabled},
+ {name: "loopback enabled", body: `export OTEL_TELEMETRY_ENDPOINT=http://127.0.0.1:4318`, status: TelemetryEnabled},
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ path := filepath.Join(dir, strings.ReplaceAll(tt.name, " ", "_")+".profile")
+ if err := os.WriteFile(path, []byte(tt.body), 0600); err != nil {
+ t.Fatalf("write fixture: %v", err)
+ }
+ status, _ := factoryStatus(path)
+ if status != tt.status {
+ t.Fatalf("factoryStatus = %q, want %q", status, tt.status)
+ }
+ })
+ }
+}
diff --git a/cli/beacon/internal/endpoint/lifecycle/lifecycle.go b/cli/beacon/internal/endpoint/lifecycle/lifecycle.go
index 73f7765f..2a78a530 100644
--- a/cli/beacon/internal/endpoint/lifecycle/lifecycle.go
+++ b/cli/beacon/internal/endpoint/lifecycle/lifecycle.go
@@ -353,22 +353,24 @@ func preflight(cfg endpointconfig.Config, startService bool) error {
}
func configureHarnesses(cfg endpointconfig.Config) ([]string, error) {
- endpoint := fmt.Sprintf("http://127.0.0.1:%d", cfg.Collector.GRPCPort)
+ grpcEndpoint := fmt.Sprintf("http://127.0.0.1:%d", cfg.Collector.GRPCPort)
var paths []string
for _, name := range cfg.Harnesses {
switch name {
case "claude", "claude_code":
- path, err := harness.ConfigureClaude(harness.ConfigureOptions{Endpoint: endpoint, UserMode: cfg.UserMode})
+ path, err := harness.ConfigureClaude(harness.ConfigureOptions{Endpoint: grpcEndpoint, UserMode: cfg.UserMode})
if err != nil {
return paths, err
}
paths = append(paths, path)
case "codex", "codex_cli":
- path, err := harness.ConfigureCodex(harness.ConfigureOptions{Endpoint: endpoint, UserMode: cfg.UserMode, ContentRetention: string(cfg.ContentRetention)})
+ path, err := harness.ConfigureCodex(harness.ConfigureOptions{Endpoint: grpcEndpoint, UserMode: cfg.UserMode, ContentRetention: string(cfg.ContentRetention)})
if err != nil {
return paths, err
}
paths = append(paths, path)
+ case "factory", "droid":
+ return paths, fmt.Errorf("Factory Droid telemetry is MDM-managed; set OTEL_TELEMETRY_ENDPOINT=http://127.0.0.1:%d in the Droid launch environment instead of using --harness %s", cfg.Collector.HTTPPort, name)
case "":
default:
return paths, fmt.Errorf("unsupported harness %q", name)
diff --git a/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go b/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go
index 9076e733..429d0b79 100644
--- a/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go
+++ b/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go
@@ -133,6 +133,21 @@ func TestConfigureHarnessesRejectsUnsupportedHarness(t *testing.T) {
}
}
+func TestConfigureHarnessesRejectsFactoryAsMDMManaged(t *testing.T) {
+ cfg := endpointconfig.Config{
+ Harnesses: []string{"factory"},
+ Collector: endpointconfig.Collector{
+ GRPCPort: 54317,
+ HTTPPort: 54318,
+ },
+ }
+
+ _, err := configureHarnesses(cfg)
+ if err == nil || !strings.Contains(err.Error(), "Factory Droid telemetry is MDM-managed") || !strings.Contains(err.Error(), "54318") {
+ t.Fatalf("configureHarnesses error = %v, want MDM-managed Factory error with HTTP port", err)
+ }
+}
+
func TestWriteReadManifestRoundTrip(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
diff --git a/packaging/macos/README.md b/packaging/macos/README.md
index 593fcc7c..0e3ba67d 100644
--- a/packaging/macos/README.md
+++ b/packaging/macos/README.md
@@ -116,6 +116,19 @@ Cursor hook installation is separate from the base system package because Cursor
configuration is per user. Run the Cursor hook helper only when an interactive
console user is present.
+Factory Droid telemetry is also managed outside the base system package. Droid
+reads OTLP settings from its launch environment, so deploy the environment from
+a user-context MDM policy or another customer-owned launch policy:
+
+```sh
+export OTEL_TELEMETRY_ENDPOINT="http://127.0.0.1:4318"
+```
+
+Beacon's endpoint status and discovery commands can validate whether the
+effective Droid environment points at the local OTLP HTTP receiver. If
+`OTEL_TELEMETRY_HEADERS` is needed, treat it as customer-managed secret material
+and avoid storing it in Beacon defaults or package parameters.
+
## Jamf Pro
Upload the generated `.pkg` to Jamf Pro and create a Policy scoped to a pilot