Skip to content

fix(fi-core): stop exporting the process command line and OS user (1.2.1) - #614

Merged
nik13 merged 1 commit into
devfrom
fix/fi-core-process-resource
Nov 8, 2026
Merged

nik13 merged 1 commit into
devfrom
fix/fi-core-process-resource

Conversation

@nik13

@nik13 nik13 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #607.

What was wrong

@traceai/fi-core 1.2.0 merged OpenTelemetry's full processDetector into every FITracerProvider resource. As a result, every span sent to Future AGI (and to any other OTLP destination) carried:

  • process.command_args and process.command. Flags such as --api-key=... or connection strings go out in plain text.
  • process.owner, the OS user name.
  • process.executable.path and process.pid.

Before 1.2.0, fi-core detected nothing.

What changes

typescript/packages/fi-core/src/otel.ts:

  • Default: the provider keeps only process.runtime.name, process.runtime.version and process.runtime.description. It sends no command line, OS user, executable path, pid, host or OS attributes.
  • Opt in: set OTEL_NODE_RESOURCE_DETECTORS, the OpenTelemetry Node variable, to a comma-separated list of host, os and process, or to all. none turns detection off. The values mean the same as in @opentelemetry/sdk-node.
  • Unchanged: OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES (the env detector) are always applied, as the README already documents.

Other changes:

  • @traceai/fi-core goes to 1.2.1, in package.json and .release-please-manifest.json, with a CHANGELOG entry and a README paragraph.
  • New test file src/__tests__/resourceDetection.test.ts. It puts a fake --api-key=sk-test-… flag on process.argv and checks the resource every exported span carries:
    • default: no process.command*, process.owner, process.executable.*, process.pid, host.* or os.*; the secret flag and the user name appear nowhere;
    • default: the runtime name and version are kept;
    • OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES are kept;
    • process adds full process detection;
    • all adds host, os and process;
    • none removes all detection but keeps the service name.

service.name still falls back to OpenTelemetry's own default, unknown_service:<argv0>, when OTEL_SERVICE_NAME is not set. That is standard SDK behaviour and has not changed.

How it was tested

All runs were in E2B (Node 22.18, pnpm install --frozen-lockfile --ignore-scripts, as CI installs):

Run Result
tsc --noEmit -p . (fi-core) OK
npx jest (fi-core, all suites) 60/60 suites, 1733 passed, 13 skipped, 0 failed
npm run build + node --test test/provider-lifecycle.test.cjs build OK, 19 pass / 0 fail
New test on the base otel.ts (origin/dev) 2 failed: the default resource had process.command_args: [..., "--api-key=sk-test-0000000000000000"] and process.owner: "root"; all had no host.name
New test with this fix 5/5 pass
@traceai/auto suite (jest --runInBand), this branch vs origin/dev identical: 1274 passed, 12 skipped, 4 failed in both. The 4 failing suites (safety, config, privacy-catalog, round6-boundary) fail the same way on origin/dev and are not touched here. @traceai/auto has no CI workflow; tracked separately

Rollout

  • Publishing: merge to dev, then dev→main. The release workflow publishes fi-core 1.2.1.
  • Consumers on ^1.2.0 (@traceai/auto and the instrumentations) pick up 1.2.1 when they install. No dependent needs a republish.
  • @traceai/agent-core already strips host.* / process.* before export (feat(agents): one-command coding-agent tracing (fi-agent CLI, 14 adapters, VS Code extension) #609), so coding-agent traces are unaffected either way.
  • Not in scope: applying FI_HIDE_* / redaction policies to resource attributes, which the issue lists as an option. With nothing sensitive detected by default, the remaining resource attributes are the ones the user sets.

🤖 Generated with Claude Code

fi-core 1.2.0 merged OpenTelemetry's full process detector into every
FITracerProvider resource, so process.command_args, process.command,
process.owner, process.executable.path and process.pid went out with
every span. Command-line flags can carry secrets (--api-key=...), and the
OS user name identifies a person.

By default the provider now detects only process.runtime.* (name,
version, description). OTEL_NODE_RESOURCE_DETECTORS, the OpenTelemetry
Node variable, opts in to host, os and process detection (or all/none).
OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES are always applied.

Bumps @traceai/fi-core to 1.2.1.

Fixes #607

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nik13
nik13 merged commit 2c3a6e8 into dev Nov 8, 2026
118 of 133 checks passed
@nik13
nik13 deleted the fix/fi-core-process-resource branch November 8, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant