Skip to content

Commit 2fd5f92

Browse files
christophe-papazianclaude
authored andcommitted
feat(appsec): report DD_APPSEC_AGENTIC_ONBOARDING in config telemetry (#9486)
* feat(appsec): report DD_APPSEC_AGENTIC_ONBOARDING in config telemetry Register DD_APPSEC_AGENTIC_ONBOARDING as a string configuration reported verbatim in configuration telemetry (RFC-1113). Always emitted: empty value with origin=default when unset. No derived boolean, no AppSec-state logic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(appsec): keep agentic-onboarding config out of public options Use the `appsec` namespace instead of `configurationNames` so DD_APPSEC_AGENTIC_ONBOARDING stays a telemetry-only config (like DD_APPSEC_SCA_ENABLED) and is not required in index.d.ts, fixing the eslint-config-names-sync lint failure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 748d91b commit 2fd5f92

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

packages/dd-trace/src/config/generated-config-types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface GeneratedConfig {
1616
DD_API_SECURITY_MAX_DOWNSTREAM_BODY_BYTES: number;
1717
DD_API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS: number;
1818
DD_API_SECURITY_SAMPLE_DELAY: number;
19+
DD_APPSEC_AGENTIC_ONBOARDING: string;
1920
DD_APPSEC_SCA_ENABLED: boolean | undefined;
2021
enabled: boolean | undefined;
2122
eventTracking: {
@@ -620,6 +621,7 @@ export interface GeneratedEnvVarConfig {
620621
DD_APM_FLUSH_DEADLINE_MILLISECONDS: number;
621622
DD_APM_TRACING_ENABLED: boolean;
622623
DD_APP_KEY: string | undefined;
624+
DD_APPSEC_AGENTIC_ONBOARDING: string;
623625
DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE: string;
624626
DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING: string;
625627
DD_APPSEC_COLLECT_ALL_HEADERS: boolean;

packages/dd-trace/src/config/supported-configurations.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@
206206
]
207207
}
208208
],
209+
"DD_APPSEC_AGENTIC_ONBOARDING": [
210+
{
211+
"implementation": "A",
212+
"type": "string",
213+
"default": "",
214+
"namespace": "appsec",
215+
"description": "Set automatically by Datadog's agentic onboarding solution when it configures App & API Protection for a service. Reported verbatim in configuration telemetry only; it has no effect on tracer behavior."
216+
}
217+
],
209218
"DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE": [
210219
{
211220
"implementation": "E",

packages/dd-trace/test/config/index.spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,41 @@ describe('Config', () => {
615615
})
616616
})
617617

618+
describe('DD_APPSEC_AGENTIC_ONBOARDING', () => {
619+
// RFC-1113: reported verbatim in configuration telemetry, always emitted
620+
// (empty value with origin=default when unset). No effect on tracer behavior.
621+
it('should default to an empty string and report it with origin=default when unset', () => {
622+
const config = getConfig()
623+
624+
assert.strictEqual(config.appsec.DD_APPSEC_AGENTIC_ONBOARDING, '')
625+
assertConfigUpdateContains(updateConfig.getCall(0).args[0], [
626+
{ name: 'DD_APPSEC_AGENTIC_ONBOARDING', value: '', origin: 'default' },
627+
])
628+
})
629+
630+
it('should report the value verbatim with origin=env_var when set to true', () => {
631+
process.env.DD_APPSEC_AGENTIC_ONBOARDING = 'true'
632+
633+
const config = getConfig()
634+
635+
assert.strictEqual(config.appsec.DD_APPSEC_AGENTIC_ONBOARDING, 'true')
636+
assertConfigUpdateContains(updateConfig.getCall(0).args[0], [
637+
{ name: 'DD_APPSEC_AGENTIC_ONBOARDING', value: 'true', origin: 'env_var' },
638+
])
639+
})
640+
641+
it('should report an arbitrary value verbatim rather than collapsing to a boolean', () => {
642+
process.env.DD_APPSEC_AGENTIC_ONBOARDING = 'false'
643+
644+
const config = getConfig()
645+
646+
assert.strictEqual(config.appsec.DD_APPSEC_AGENTIC_ONBOARDING, 'false')
647+
assertConfigUpdateContains(updateConfig.getCall(0).args[0], [
648+
{ name: 'DD_APPSEC_AGENTIC_ONBOARDING', value: 'false', origin: 'env_var' },
649+
])
650+
})
651+
})
652+
618653
it('should correctly map OTEL_RESOURCE_ATTRIBUTES', () => {
619654
process.env.OTEL_RESOURCE_ATTRIBUTES =
620655
'deployment.environment=test1,service.name=test2,service.version=5,foo=bar1,baz=qux1'

0 commit comments

Comments
 (0)