Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public BadConfigurationException(final String message) {
static final String ACTION_TAG = "ai_guard.action";
static final String REASON_TAG = "ai_guard.reason";
static final String BLOCKED_TAG = "ai_guard.blocked";
static final String EVENT_TAG = "ai_guard.event";
static final String META_STRUCT_TAG = "ai_guard";
static final String META_STRUCT_MESSAGES = "messages";
static final String META_STRUCT_CATEGORIES = "attack_categories";
Expand Down Expand Up @@ -227,6 +228,7 @@ public Evaluation evaluate(final List<Message> messages, final Options options)
final AgentSpan localRootSpan = span.getLocalRootSpan();
if (localRootSpan != null) {
localRootSpan.setTag(Tags.AI_GUARD_KEEP, true);
localRootSpan.setTag(EVENT_TAG, true);
}
try (final AgentScope scope = tracer.activateSpan(span)) {
final Message last = messages.get(messages.size() - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class AIGuardInternalTests extends DDSpecification {
then:
1 * span.setTag(AIGuardInternal.TARGET_TAG, suite.target)
1 * localRootSpan.setTag(Tags.AI_GUARD_KEEP, true)
1 * localRootSpan.setTag(AIGuardInternal.EVENT_TAG, true)
if (suite.target == 'tool') {
1 * span.setTag(AIGuardInternal.TOOL_TAG, 'calc')
}
Expand Down
Loading