Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/datadog/appsec/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def self.add_settings!(base)
o.default false
end

# Set by the agentic onboarding solution; no behavior, reported verbatim in
# configuration telemetry only (RFC-1113).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like AI slop. The comment (or the rest of PR) does not provide a description of what the value actually contains.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people wants no comments, you seem to want all the explanation in here ? The Appsec RFC ID is put here in reference, so anyone can take a look at it for more explanations.

@TonyCTHsu TonyCTHsu Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC ID is put here in reference

Please remove the RFC reference and JIRA numbers from code comment and pull request description and title.

Replace with an example how agentic onboarding solution is going to modify this specific settings. Provided with possible values.

option :agentic_onboarding do |o|
o.type :string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests set the value to a boolean, which means the type should probably be bool and not string.

@christophe-papazian christophe-papazian Jul 22, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is defined as a string, both in the RFC and the registry

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also note that the CI shouldn't pass if the configuration was not defined as the registry is.

o.env "DD_APPSEC_AGENTIC_ONBOARDING"
o.default ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reasoning for using an empty string instead of nil? Or false if the type is indeed supposed to be bool?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is not always reported, empty string is.
This is based on an RFC that was discussed for some time, if you want the full context, we can plan a meeting.

end

define_method(:instrument) do |integration_name|
if enabled
registered_integration = Datadog::AppSec::Contrib::Integration.registry[integration_name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module Configuration
"DD_API_SECURITY_REQUEST_SAMPLE_RATE",
"DD_API_SECURITY_SAMPLE_DELAY",
"DD_APM_TRACING_ENABLED",
"DD_APPSEC_AGENTIC_ONBOARDING",
"DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING",
"DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE",
"DD_APPSEC_BODY_PARSING_SIZE_LIMIT",
Expand Down
32 changes: 32 additions & 0 deletions spec/datadog/appsec/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,38 @@ def patcher
end
end

describe "#agentic_onboarding" do
subject(:agentic_onboarding) { settings.appsec.agentic_onboarding }

context "when DD_APPSEC_AGENTIC_ONBOARDING" do
around do |example|
ClimateControl.modify("DD_APPSEC_AGENTIC_ONBOARDING" => agentic_onboarding_env) do
example.run
end
end

context "is not defined" do
let(:agentic_onboarding_env) { nil }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on the RFC. This test case converts the "not present" case (env var is nil) to "present" case (env var is set to empty string). The RFC specifies that the value of the env var is ignored, therefore the test missing from the PR is env var is set to empty string -> reported value is true.


it { is_expected.to eq("") }
end

context "is defined" do
let(:agentic_onboarding_env) { "true" }

it { is_expected.to eq("true") }
end
end
end

describe "#agentic_onboarding=" do
subject(:set_agentic_onboarding) { settings.appsec.agentic_onboarding = "true" }

before { set_agentic_onboarding }

it { expect(settings.appsec.agentic_onboarding).to eq("true") }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFC specifies that telemetry signal is a boolean. Therefore the string -> bool conversion should probably be done at configuration parsing time and this test should be written to expect a boolean value.

end

describe "#obfuscator_key_regex" do
subject(:obfuscator_key_regex) { settings.appsec.obfuscator_key_regex }

Expand Down
1 change: 1 addition & 0 deletions spec/datadog/core/telemetry/event/app_started_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# ['tracing.writer_options.flush_interval', 456], # not reported by default
# ['logger.instance', 'MyLogger'], # not reported by default
["DD_APPSEC_ENABLED", false],
["DD_APPSEC_AGENTIC_ONBOARDING", ""],
# ['DD_APPSEC_SCA_ENABLED', false], # not reported by default
["DD_APM_TRACING_ENABLED", true]
].freeze
Expand Down
7 changes: 7 additions & 0 deletions supported-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@
"sensitive": true
}
],
"DD_APPSEC_AGENTIC_ONBOARDING": [
{
"version": "A",
"type": "string",
"default": ""
}
],
"DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING": [
{
"version": "A",
Expand Down
Loading