Skip to content

Commit fadbd2b

Browse files
committed
Prepare AI Guard tag probability coverage
Add a system test for tag probabilities in AI Guard responses and meta-structs. APPSEC-61900
1 parent fe4c8b8 commit fadbd2b

17 files changed

Lines changed: 94 additions & 10 deletions

File tree

docs/understand/scenarios/ai_guard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Each language implements a `POST /ai_guard/evaluate` endpoint that:
9696
1. Reads messages from the request JSON body
9797
2. Reads the `X-AI-Guard-Block` header to determine blocking behavior
9898
3. Calls the AI Guard SDK `evaluate` method
99-
4. Returns the evaluation result (action, reason, tags)
99+
4. Returns the evaluation result (action, reason, tags, tag probabilities)
100100

101101
See [weblogs](../weblogs/README.md) for details on weblog implementations.
102102

docs/understand/weblogs/end-to-end_weblog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,10 @@ Successful evaluation:
12361236
{
12371237
"action": "ALLOW",
12381238
"reason": "All looks good",
1239-
"tags": []
1239+
"tags": [],
1240+
"tag_probs": {
1241+
"jailbreak": 0.0
1242+
}
12401243
}
12411244
```
12421245

manifests/cpp_httpd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ manifest:
1818
tests/ai_guard/test_ai_guard_sdk.py::Test_SDK_Disabled: missing_feature
1919
tests/ai_guard/test_ai_guard_sdk.py::Test_SDS_Findings_In_SDK_Response: missing_feature
2020
tests/ai_guard/test_ai_guard_sdk.py::Test_SensitiveDataScanning: missing_feature
21+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature
2122
tests/apm_tracing_e2e/: missing_feature (missing /e2e_otel_span endpoint on weblog)
2223
tests/appsec/: irrelevant (ASM is not implemented in C++)
2324
tests/appsec/api_security/test_endpoints.py: irrelevant (language not implementing this feature)

manifests/cpp_nginx.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ manifest:
1616
tests/ai_guard/test_ai_guard_sdk.py::Test_SDK_Disabled: missing_feature
1717
tests/ai_guard/test_ai_guard_sdk.py::Test_SDS_Findings_In_SDK_Response: missing_feature
1818
tests/ai_guard/test_ai_guard_sdk.py::Test_SensitiveDataScanning: missing_feature
19+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature
1920
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span: missing_feature (missing /e2e_otel_span endpoint on weblog)
2021
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span::test_distributed_otel_trace: irrelevant (Golang specific test with OTel Go contrib package)
2122
tests/apm_tracing_e2e/test_process_tags.py::Test_Process_Tags: missing_feature

manifests/dotnet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ manifest:
88
tests/ai_guard/test_ai_guard_sdk.py::Test_SDK_Disabled: missing_feature
99
tests/ai_guard/test_ai_guard_sdk.py::Test_SDS_Findings_In_SDK_Response: missing_feature
1010
tests/ai_guard/test_ai_guard_sdk.py::Test_SensitiveDataScanning: missing_feature
11+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature
1112
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span: missing_feature (missing /e2e_otel_span endpoint on weblog)
1213
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span::test_distributed_otel_trace: irrelevant (Golang specific test with OTel Go contrib package)
1314
tests/apm_tracing_e2e/test_process_tags.py::Test_Process_Tags: v3.34.0

manifests/golang.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ manifest:
88
tests/ai_guard/test_ai_guard_sdk.py::Test_SDK_Disabled: missing_feature
99
tests/ai_guard/test_ai_guard_sdk.py::Test_SDS_Findings_In_SDK_Response: missing_feature
1010
tests/ai_guard/test_ai_guard_sdk.py::Test_SensitiveDataScanning: missing_feature
11+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature
1112
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span:
1213
- weblog_declaration:
1314
"*": missing_feature (missing /e2e_otel_span endpoint on weblog)

manifests/java.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ manifest:
2929
- weblog_declaration:
3030
"*": irrelevant (just one weblog is enough to test the SDK)
3131
"spring-boot": v1.61.0-SNAPSHOT
32+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature (APPSEC-61896)
3233
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span:
3334
- weblog_declaration:
3435
"*": v0.2.0 # real version not known

manifests/nodejs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ manifest:
114114
- weblog_declaration:
115115
"*": irrelevant (just one weblog is enough to test the SDK)
116116
express4: *ref_5_89_0
117+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature (APPSEC-61899)
117118
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span: missing_feature (missing /e2e_otel_span endpoint on weblog)
118119
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span::test_distributed_otel_trace: irrelevant (Golang specific test with OTel Go contrib package)
119120
tests/apm_tracing_e2e/test_process_tags.py::Test_Process_Tags: missing_feature

manifests/php.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ manifest:
88
tests/ai_guard/test_ai_guard_sdk.py::Test_SDK_Disabled: missing_feature
99
tests/ai_guard/test_ai_guard_sdk.py::Test_SDS_Findings_In_SDK_Response: missing_feature
1010
tests/ai_guard/test_ai_guard_sdk.py::Test_SensitiveDataScanning: missing_feature
11+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature
1112
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span: missing_feature (missing /e2e_otel_span endpoint on weblog)
1213
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span::test_distributed_otel_trace: irrelevant (Golang specific test with OTel Go contrib package)
1314
tests/apm_tracing_e2e/test_process_tags.py::Test_Process_Tags: missing_feature

manifests/python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ manifest:
3535
- weblog_declaration:
3636
"*": irrelevant (just one weblog is enough to test the SDK)
3737
"flask-poc": v4.6.0-rc1
38+
tests/ai_guard/test_ai_guard_sdk.py::Test_Tag_Probabilities: missing_feature (APPSEC-61898)
3839
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span: missing_feature (missing /e2e_otel_span endpoint on weblog)
3940
tests/apm_tracing_e2e/test_otel.py::Test_Otel_Span::test_distributed_otel_trace: irrelevant (Golang specific test with OTel Go contrib package)
4041
tests/apm_tracing_e2e/test_process_tags.py::Test_Process_Tags: v4.1.0

0 commit comments

Comments
 (0)