Skip to content

[Agent Builder] Improve dynamic attachments: optional tool params, skill discovery, and tracer utilities#254357

Closed
patrykkopycinski wants to merge 1 commit into
elastic:mainfrom
patrykkopycinski:feature/dynamic-attachments
Closed

[Agent Builder] Improve dynamic attachments: optional tool params, skill discovery, and tracer utilities#254357
patrykkopycinski wants to merge 1 commit into
elastic:mainfrom
patrykkopycinski:feature/dynamic-attachments

Conversation

@patrykkopycinski
Copy link
Copy Markdown
Contributor

@patrykkopycinski patrykkopycinski commented Feb 23, 2026

Summary

  • Make selectTools parameters optional (skills, filestore, experimentalFeatures) with sensible defaults, enabling callers that don't need skill/filestore integration (e.g., deep agent mode) to use the function without providing all dependencies
  • Add mandatory skill discovery step to the research agent prompt when the skills experimental feature is enabled, ensuring skills are loaded before general-purpose tools
  • Strengthen skill loading instructions in skill prompts to enforce protocol compliance (loading skills via filestore.read before calling other tools)
  • Add createTracer, createTracerFactory, and getAgentBuilderTracer utilities for OpenTelemetry tracing in the agent_builder plugin
  • Add barrel export for kbn-langchain server tracers (APMTracer, TelemetryTracer, LangSmith helpers)
  • Update kbn-langchain tracers README with structured documentation covering all available tracers

Test plan

  • Verify agent builder conversations work correctly with default agent mode
  • Verify skill discovery works when experimentalFeatures.skills is enabled
  • Verify tracing utilities create valid OpenTelemetry tracers
  • Verify the selectTools function works when optional parameters are not provided

Production-Readiness Checklist — Agent Skills Ecosystem

Generated against [Epic] Creation of the Agent Skills Ecosystem for Elastic Security.

Narrative role: Observability pillar. Exposes OTEL tracers so we can measure invocation frequency and accept/reject rates — the vision's "if we cannot measure it, we cannot responsibly scale it" requirement.

Must-do before this can ship

  • Make createTracer / getAgentBuilderTracer the only supported path — add an ESLint rule forbidding direct APMTracer / TelemetryTracer imports in Agent Builder plugins
  • Deterministic eval: fails if the research agent calls any tool before a skill-load in the presence of the skills experimental flag (enforces the "skill discovery first" contract)
  • Propagate trace_id into SSE events so the UI "why did it do that" surface can deep-link into the trace
  • Bundle-size budget check for the new kbn-langchain server barrel — the re-exports land on every AB server bundle

Follow-ups (post-merge)

…ill discovery, and tracer utilities

- Make `selectTools` parameters optional (skills, filestore, experimentalFeatures) with defaults
  to support callers that don't need skill/filestore integration
- Add mandatory skill discovery step to research agent prompt when skills feature is enabled
- Strengthen skill loading instructions in skill prompts to enforce protocol compliance
- Add `createTracer` utility and barrel export for OpenTelemetry tracing in agent_builder
- Add barrel export for kbn-langchain server tracers
- Update kbn-langchain tracers README with structured documentation
@elasticmachine
Copy link
Copy Markdown
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

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.

2 participants