feat(guard,runs): a guard is shown the agent's diagnosis and the evidence it read before proposing an action (#2006)
This commit is contained in:
7 files changed
+231
-43
No files matched your search
@@ -576,7 +576,12 @@ type JudgeRequest struct {
|
||||
// deadline is how long the host waits for the verdict.
|
||||
Deadline *durationpb.Duration `protobuf:"bytes,8,opt,name=deadline,proto3" json:"deadline,omitempty"`
|
||||
// at is the host's clock when the action was put to the guard.
|
||||
At *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=at,proto3" json:"at,omitempty"`
|
||||
At *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=at,proto3" json:"at,omitempty"`
|
||||
// diagnosis is what the agent concluded so far, in its own words. Empty
|
||||
// when no agent proposed the action.
|
||||
Diagnosis string `protobuf:"bytes,10,opt,name=diagnosis,proto3" json:"diagnosis,omitempty"`
|
||||
// evidence is what the agent read during the run, oldest first.
|
||||
Evidence []*Evidence `protobuf:"bytes,11,rep,name=evidence,proto3" json:"evidence,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -674,6 +679,74 @@ func (x *JudgeRequest) GetAt() *timestamppb.Timestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JudgeRequest) GetDiagnosis() string {
|
||||
if x != nil {
|
||||
return x.Diagnosis
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *JudgeRequest) GetEvidence() []*Evidence {
|
||||
if x != nil {
|
||||
return x.Evidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Evidence is one result the agent read, as the tool returned it.
|
||||
type Evidence struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// source names the tool that returned it.
|
||||
Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Evidence) Reset() {
|
||||
*x = Evidence{}
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Evidence) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Evidence) ProtoMessage() {}
|
||||
|
||||
func (x *Evidence) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Evidence.ProtoReflect.Descriptor instead.
|
||||
func (*Evidence) Descriptor() ([]byte, []int) {
|
||||
return file_guard_v1_guard_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *Evidence) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Evidence) GetText() string {
|
||||
if x != nil {
|
||||
return x.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Finding struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
||||
@@ -686,7 +759,7 @@ type Finding struct {
|
||||
|
||||
func (x *Finding) Reset() {
|
||||
*x = Finding{}
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[8]
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -698,7 +771,7 @@ func (x *Finding) String() string {
|
||||
func (*Finding) ProtoMessage() {}
|
||||
|
||||
func (x *Finding) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[8]
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -711,7 +784,7 @@ func (x *Finding) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Finding.ProtoReflect.Descriptor instead.
|
||||
func (*Finding) Descriptor() ([]byte, []int) {
|
||||
return file_guard_v1_guard_proto_rawDescGZIP(), []int{8}
|
||||
return file_guard_v1_guard_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *Finding) GetText() string {
|
||||
@@ -748,7 +821,7 @@ type JudgeResponse struct {
|
||||
|
||||
func (x *JudgeResponse) Reset() {
|
||||
*x = JudgeResponse{}
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[9]
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -760,7 +833,7 @@ func (x *JudgeResponse) String() string {
|
||||
func (*JudgeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *JudgeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[9]
|
||||
mi := &file_guard_v1_guard_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -773,7 +846,7 @@ func (x *JudgeResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use JudgeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*JudgeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_guard_v1_guard_proto_rawDescGZIP(), []int{9}
|
||||
return file_guard_v1_guard_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *JudgeResponse) GetCeiling() Ceiling {
|
||||
@@ -832,7 +905,7 @@ const file_guard_v1_guard_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"RunContext\x12\x15\n" +
|
||||
"\x06run_id\x18\x01 \x01(\tR\x05runId\x12!\n" +
|
||||
"\fdecision_key\x18\x02 \x01(\tR\vdecisionKey\"\xcd\x02\n" +
|
||||
"\fdecision_key\x18\x02 \x01(\tR\vdecisionKey\"\x9b\x03\n" +
|
||||
"\fJudgeRequest\x12\x1c\n" +
|
||||
"\tconnector\x18\x01 \x01(\tR\tconnector\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" +
|
||||
@@ -842,7 +915,13 @@ const file_guard_v1_guard_proto_rawDesc = "" +
|
||||
"\x06effect\x18\x06 \x01(\v2\x10.guard.v1.EffectR\x06effect\x12&\n" +
|
||||
"\x03run\x18\a \x01(\v2\x14.guard.v1.RunContextR\x03run\x125\n" +
|
||||
"\bdeadline\x18\b \x01(\v2\x19.google.protobuf.DurationR\bdeadline\x12*\n" +
|
||||
"\x02at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\x02at\"i\n" +
|
||||
"\x02at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\x02at\x12\x1c\n" +
|
||||
"\tdiagnosis\x18\n" +
|
||||
" \x01(\tR\tdiagnosis\x12.\n" +
|
||||
"\bevidence\x18\v \x03(\v2\x12.guard.v1.EvidenceR\bevidence\"6\n" +
|
||||
"\bEvidence\x12\x16\n" +
|
||||
"\x06source\x18\x01 \x01(\tR\x06source\x12\x12\n" +
|
||||
"\x04text\x18\x02 \x01(\tR\x04text\"i\n" +
|
||||
"\aFinding\x12\x12\n" +
|
||||
"\x04text\x18\x01 \x01(\tR\x04text\x12\x1a\n" +
|
||||
"\bevidence\x18\x02 \x01(\tR\bevidence\x12.\n" +
|
||||
@@ -889,7 +968,7 @@ func file_guard_v1_guard_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_guard_v1_guard_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
||||
var file_guard_v1_guard_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_guard_v1_guard_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||
var file_guard_v1_guard_proto_goTypes = []any{
|
||||
(Reversibility)(0), // 0: guard.v1.Reversibility
|
||||
(Ceiling)(0), // 1: guard.v1.Ceiling
|
||||
@@ -902,36 +981,38 @@ var file_guard_v1_guard_proto_goTypes = []any{
|
||||
(*Target)(nil), // 8: guard.v1.Target
|
||||
(*RunContext)(nil), // 9: guard.v1.RunContext
|
||||
(*JudgeRequest)(nil), // 10: guard.v1.JudgeRequest
|
||||
(*Finding)(nil), // 11: guard.v1.Finding
|
||||
(*JudgeResponse)(nil), // 12: guard.v1.JudgeResponse
|
||||
nil, // 13: guard.v1.ConfigureRequest.SettingsEntry
|
||||
nil, // 14: guard.v1.ConfigureRequest.SecretsEntry
|
||||
(*durationpb.Duration)(nil), // 15: google.protobuf.Duration
|
||||
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
|
||||
(*Evidence)(nil), // 11: guard.v1.Evidence
|
||||
(*Finding)(nil), // 12: guard.v1.Finding
|
||||
(*JudgeResponse)(nil), // 13: guard.v1.JudgeResponse
|
||||
nil, // 14: guard.v1.ConfigureRequest.SettingsEntry
|
||||
nil, // 15: guard.v1.ConfigureRequest.SecretsEntry
|
||||
(*durationpb.Duration)(nil), // 16: google.protobuf.Duration
|
||||
(*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
|
||||
}
|
||||
var file_guard_v1_guard_proto_depIdxs = []int32{
|
||||
13, // 0: guard.v1.ConfigureRequest.settings:type_name -> guard.v1.ConfigureRequest.SettingsEntry
|
||||
14, // 1: guard.v1.ConfigureRequest.secrets:type_name -> guard.v1.ConfigureRequest.SecretsEntry
|
||||
14, // 0: guard.v1.ConfigureRequest.settings:type_name -> guard.v1.ConfigureRequest.SettingsEntry
|
||||
15, // 1: guard.v1.ConfigureRequest.secrets:type_name -> guard.v1.ConfigureRequest.SecretsEntry
|
||||
0, // 2: guard.v1.Effect.reversibility:type_name -> guard.v1.Reversibility
|
||||
8, // 3: guard.v1.JudgeRequest.target:type_name -> guard.v1.Target
|
||||
7, // 4: guard.v1.JudgeRequest.effect:type_name -> guard.v1.Effect
|
||||
9, // 5: guard.v1.JudgeRequest.run:type_name -> guard.v1.RunContext
|
||||
15, // 6: guard.v1.JudgeRequest.deadline:type_name -> google.protobuf.Duration
|
||||
16, // 7: guard.v1.JudgeRequest.at:type_name -> google.protobuf.Timestamp
|
||||
2, // 8: guard.v1.Finding.strength:type_name -> guard.v1.Strength
|
||||
1, // 9: guard.v1.JudgeResponse.ceiling:type_name -> guard.v1.Ceiling
|
||||
11, // 10: guard.v1.JudgeResponse.findings:type_name -> guard.v1.Finding
|
||||
3, // 11: guard.v1.GuardService.Configure:input_type -> guard.v1.ConfigureRequest
|
||||
5, // 12: guard.v1.GuardService.Describe:input_type -> guard.v1.DescribeRequest
|
||||
10, // 13: guard.v1.GuardService.Judge:input_type -> guard.v1.JudgeRequest
|
||||
4, // 14: guard.v1.GuardService.Configure:output_type -> guard.v1.ConfigureResponse
|
||||
6, // 15: guard.v1.GuardService.Describe:output_type -> guard.v1.DescribeResponse
|
||||
12, // 16: guard.v1.GuardService.Judge:output_type -> guard.v1.JudgeResponse
|
||||
14, // [14:17] is the sub-list for method output_type
|
||||
11, // [11:14] is the sub-list for method input_type
|
||||
11, // [11:11] is the sub-list for extension type_name
|
||||
11, // [11:11] is the sub-list for extension extendee
|
||||
0, // [0:11] is the sub-list for field type_name
|
||||
16, // 6: guard.v1.JudgeRequest.deadline:type_name -> google.protobuf.Duration
|
||||
17, // 7: guard.v1.JudgeRequest.at:type_name -> google.protobuf.Timestamp
|
||||
11, // 8: guard.v1.JudgeRequest.evidence:type_name -> guard.v1.Evidence
|
||||
2, // 9: guard.v1.Finding.strength:type_name -> guard.v1.Strength
|
||||
1, // 10: guard.v1.JudgeResponse.ceiling:type_name -> guard.v1.Ceiling
|
||||
12, // 11: guard.v1.JudgeResponse.findings:type_name -> guard.v1.Finding
|
||||
3, // 12: guard.v1.GuardService.Configure:input_type -> guard.v1.ConfigureRequest
|
||||
5, // 13: guard.v1.GuardService.Describe:input_type -> guard.v1.DescribeRequest
|
||||
10, // 14: guard.v1.GuardService.Judge:input_type -> guard.v1.JudgeRequest
|
||||
4, // 15: guard.v1.GuardService.Configure:output_type -> guard.v1.ConfigureResponse
|
||||
6, // 16: guard.v1.GuardService.Describe:output_type -> guard.v1.DescribeResponse
|
||||
13, // 17: guard.v1.GuardService.Judge:output_type -> guard.v1.JudgeResponse
|
||||
15, // [15:18] is the sub-list for method output_type
|
||||
12, // [12:15] is the sub-list for method input_type
|
||||
12, // [12:12] is the sub-list for extension type_name
|
||||
12, // [12:12] is the sub-list for extension extendee
|
||||
0, // [0:12] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_guard_v1_guard_proto_init() }
|
||||
@@ -945,7 +1026,7 @@ func file_guard_v1_guard_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_guard_v1_guard_proto_rawDesc), len(file_guard_v1_guard_proto_rawDesc)),
|
||||
NumEnums: 3,
|
||||
NumMessages: 12,
|
||||
NumMessages: 13,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user