gen-ai: add security guardian (apply_guardrail) span + finding event #3233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
GenAI semantic conventions cover model, agent, and tool operations, but they don’t provide a vendor-neutral way to observe security guardian/
guardrail evaluations (allow/deny/modify decisions) and the specific security findings produced during those evaluations. This limits
auditability, incident investigation, and cross-provider correlation for systems using guardrails across different vendors and frameworks.
What this PR adds
apply_guardrailto thegen_ai.operation.nameenum for guardrail/guardian evaluations.gen_ai.guardian.*andgen_ai.security.*to describe:gen_ai.guardian.*)gen_ai.security.decision.*)gen_ai.security.target.*)gen_ai.security.risk.*,gen_ai.security.policy.*)gen_ai.security.content.*)gen_ai.security.risk.categoryis a free-formstringwith suggested values aligned with OWASP LLM Top 10 2025.span.gen_ai.apply_guardrail.internal(guardian evaluation).gen_ai.security.finding(individual findings under a guardian evaluation).docs/gen-ai/gen-ai-security.md(linked fromdocs/gen-ai/README.md).References
Prototypes / instrumentation links
Tests
make table-generation registry-generationmake markdown-tocmake SED=sed check-policies(macOS note: the repo defaults togsed)Changelog
This is user-facing (new conventions). Add a
.chloggen/*.yamlentry withcomponent: gen-ai, or apply the “Skip Changelog” label ifmaintainers agree it’s not required for this proposal stage.