Skip to content

Commit ee2880d

Browse files
committed
Move policies to resources/policy
1 parent f7812d9 commit ee2880d

15 files changed

+27
-3
lines changed

tools/ai/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ java_library(
1313
alias(
1414
name = "test_policies",
1515
testonly = True,
16-
actual = "//tools/src/test/resources:test_policies",
16+
actual = "//tools/src/test/resources/policy:test_policies",
1717
)

tools/src/main/java/dev/cel/tools/ai/BUILD.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,16 @@ java_proto_library(
4747
name = "agent_context_java_proto",
4848
deps = [":agent_context_proto"],
4949
)
50+
51+
proto_library(
52+
name = "agent_context_extensions_proto",
53+
srcs = ["agent_context_extensions.proto"],
54+
deps = [
55+
":agent_context_proto",
56+
],
57+
)
58+
59+
java_proto_library(
60+
name = "agent_context_extensions_java_proto",
61+
deps = [":agent_context_extensions_proto"],
62+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
edition = "2024";
2+
3+
package cel.expr.ai;
4+
5+
import "tools/src/main/java/dev/cel/tools/ai/agent_context.proto";
6+
7+
// Extensions for the Agent-related policy protos.
8+
extend AgentContext {
9+
repeated ClassificationLabel agent_context_classification_labels = 1000;
10+
repeated AgentMessage agent_context_message_history = 1001;
11+
}

tools/src/test/java/dev/cel/tools/ai/AgenticPolicyCompilerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ public class AgenticPolicyCompilerTest {
223223

224224
@Test
225225
public void runAgenticPolicyTestCases(@TestParameter AgenticPolicyTestCase testCase) throws Exception {
226-
CelAbstractSyntaxTree compiledPolicy = compilePolicy(testCase.policyFilePath);
227-
PolicyTestSuite testSuite = PolicyTestSuiteHelper.readTestSuite(testCase.policyTestCaseFilePath);
226+
CelAbstractSyntaxTree compiledPolicy = compilePolicy("policy/" + testCase.policyFilePath);
227+
PolicyTestSuite testSuite = PolicyTestSuiteHelper.readTestSuite("policy/" + testCase.policyTestCaseFilePath);
228228
runTests(CEL, compiledPolicy, testSuite);
229229
}
230230

File renamed without changes.

tools/src/test/resources/open_world_tool_replay.celpolicy renamed to tools/src/test/resources/policy/open_world_tool_replay.celpolicy

File renamed without changes.

tools/src/test/resources/open_world_tool_replay_tests.yaml renamed to tools/src/test/resources/policy/open_world_tool_replay_tests.yaml

File renamed without changes.

tools/src/test/resources/prompt_injection.celpolicy renamed to tools/src/test/resources/policy/prompt_injection.celpolicy

File renamed without changes.

tools/src/test/resources/prompt_injection_tests.yaml renamed to tools/src/test/resources/policy/prompt_injection_tests.yaml

File renamed without changes.

tools/src/test/resources/require_user_confirmation_for_tool.celpolicy renamed to tools/src/test/resources/policy/require_user_confirmation_for_tool.celpolicy

File renamed without changes.

0 commit comments

Comments
 (0)