@takeshape/schema 11.43.0 → 11.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/schemas/index.js +3 -7
- package/dist/cjs/src/schemas/project-schema/experimental.json +305 -0
- package/dist/cjs/src/schemas/project-schema/latest.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.50.0.json +1 -1
- package/dist/cjs/src/validate.js +34 -4
- package/dist/esm/src/schemas/index.js +0 -2
- package/dist/esm/src/schemas/project-schema/experimental.json +305 -0
- package/dist/esm/src/schemas/project-schema/latest.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.50.0.json +1 -1
- package/dist/esm/src/validate.js +34 -4
- package/dist/types/src/project-schema/latest.d.ts +143 -4
- package/dist/types/src/project-schema/v3.48.0.d.ts +143 -4
- package/dist/types/src/project-schema/v3.49.0.d.ts +143 -4
- package/dist/types/src/project-schema/v3.50.0.d.ts +143 -4
- package/dist/types/src/schemas/index.d.ts +0 -2
- package/dist/types/src/validate.d.ts +8 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -21,6 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"states": {
|
|
23
23
|
"$ref": "#/definitions/agentStateMap"
|
|
24
|
+
},
|
|
25
|
+
"guards": {
|
|
26
|
+
"title": "AgentGuardList",
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"$ref": "#/definitions/agentGuard"
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
},
|
|
26
33
|
"required": ["start", "states", "api"],
|
|
@@ -488,6 +495,17 @@
|
|
|
488
495
|
}
|
|
489
496
|
]
|
|
490
497
|
},
|
|
498
|
+
"agentGuard": {
|
|
499
|
+
"title": "AgentGuard",
|
|
500
|
+
"type": "object",
|
|
501
|
+
"properties": {
|
|
502
|
+
"guardId": {
|
|
503
|
+
"type": "string"
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
"required": ["guardId"],
|
|
507
|
+
"additionalProperties": false
|
|
508
|
+
},
|
|
491
509
|
"agentToolConfig": {
|
|
492
510
|
"title": "AgentToolConfig",
|
|
493
511
|
"type": "object",
|
|
@@ -726,6 +744,10 @@
|
|
|
726
744
|
"agents": {
|
|
727
745
|
"$ref": "#/definitions/agentMap",
|
|
728
746
|
"description": "An Agent is a configuration for an AI service such as a chat bot or a search engine."
|
|
747
|
+
},
|
|
748
|
+
"guards": {
|
|
749
|
+
"$ref": "#/definitions/guardMap",
|
|
750
|
+
"description": "A Guard is a configuration for an AI guardrail that can check inputs and outputs and provide safety and compliance."
|
|
729
751
|
}
|
|
730
752
|
},
|
|
731
753
|
"additionalProperties": false
|
|
@@ -757,6 +779,289 @@
|
|
|
757
779
|
],
|
|
758
780
|
"additionalProperties": false
|
|
759
781
|
},
|
|
782
|
+
"guard": {
|
|
783
|
+
"title": "GuardJSON",
|
|
784
|
+
"description": "A Guard is a configuration for an AI guardrail that can check inputs and outputs and provide safety and compliance.",
|
|
785
|
+
"type": "object",
|
|
786
|
+
"properties": {
|
|
787
|
+
"name": {
|
|
788
|
+
"type": "string",
|
|
789
|
+
"title": "Name",
|
|
790
|
+
"description": "The human-readable name of the Guard."
|
|
791
|
+
},
|
|
792
|
+
"description": {
|
|
793
|
+
"type": "string",
|
|
794
|
+
"title": "Description",
|
|
795
|
+
"description": "A description of the Guard."
|
|
796
|
+
},
|
|
797
|
+
"blockedInputMessaging": {
|
|
798
|
+
"type": "string",
|
|
799
|
+
"title": "Blocked Input Messaging",
|
|
800
|
+
"description": "A message to return when the input message is blocked by the Guard."
|
|
801
|
+
},
|
|
802
|
+
"blockedOutputsMessaging": {
|
|
803
|
+
"type": "string",
|
|
804
|
+
"title": "Blocked Outputs Messaging",
|
|
805
|
+
"description": "A message to return when the output message is blocked by the Guard."
|
|
806
|
+
},
|
|
807
|
+
"topicPolicyConfig": {
|
|
808
|
+
"type": "object",
|
|
809
|
+
"title": "Topic Policy",
|
|
810
|
+
"description": "Topics to identify and block.",
|
|
811
|
+
"properties": {
|
|
812
|
+
"topicsConfig": {
|
|
813
|
+
"type": "array",
|
|
814
|
+
"items": {
|
|
815
|
+
"title": "Topic",
|
|
816
|
+
"description": "A topic to block.",
|
|
817
|
+
"type": "object",
|
|
818
|
+
"properties": {
|
|
819
|
+
"name": {
|
|
820
|
+
"type": "string"
|
|
821
|
+
},
|
|
822
|
+
"definition": {
|
|
823
|
+
"type": "string"
|
|
824
|
+
},
|
|
825
|
+
"examples": {
|
|
826
|
+
"type": "array",
|
|
827
|
+
"items": {
|
|
828
|
+
"type": "string"
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
"type": {
|
|
832
|
+
"type": "string",
|
|
833
|
+
"enum": ["DENY"]
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
"additionalProperties": false
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
"additionalProperties": false
|
|
841
|
+
},
|
|
842
|
+
"contentPolicyConfig": {
|
|
843
|
+
"type": "object",
|
|
844
|
+
"title": "Content Policy",
|
|
845
|
+
"description": "Types of content to filter and strength configuration.",
|
|
846
|
+
"properties": {
|
|
847
|
+
"filtersConfig": {
|
|
848
|
+
"type": "array",
|
|
849
|
+
"items": {
|
|
850
|
+
"title": "Filter",
|
|
851
|
+
"description": "Types of content to filter.",
|
|
852
|
+
"type": "object",
|
|
853
|
+
"properties": {
|
|
854
|
+
"type": {
|
|
855
|
+
"type": "string",
|
|
856
|
+
"enum": ["HATE", "INSULTS", "MICONDUCT", "PROMPT_ATTACK", "SEXUAL", "VIOLENCE"]
|
|
857
|
+
},
|
|
858
|
+
"inputStrength": {
|
|
859
|
+
"$ref": "#/definitions/guardrailFilterStrength"
|
|
860
|
+
},
|
|
861
|
+
"outputStrength": {
|
|
862
|
+
"$ref": "#/definitions/guardrailFilterStrength"
|
|
863
|
+
},
|
|
864
|
+
"inputModalities": {
|
|
865
|
+
"type": "array",
|
|
866
|
+
"items": {
|
|
867
|
+
"$ref": "#/definitions/guardrailModality"
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
"outputModalities": {
|
|
871
|
+
"type": "array",
|
|
872
|
+
"items": {
|
|
873
|
+
"$ref": "#/definitions/guardrailModality"
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
"additionalProperties": false
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
"additionalProperties": false
|
|
882
|
+
},
|
|
883
|
+
"wordPolicyConfig": {
|
|
884
|
+
"type": "object",
|
|
885
|
+
"title": "Word Policy",
|
|
886
|
+
"description":
|
|
887
|
+
"Specific words to identify and block. The managedWordListsConfig is solely used for blocking profanity.",
|
|
888
|
+
"properties": {
|
|
889
|
+
"wordsConfig": {
|
|
890
|
+
"type": "array",
|
|
891
|
+
"items": {
|
|
892
|
+
"title": "Word List",
|
|
893
|
+
"description": "Specific words to block.",
|
|
894
|
+
"type": "object",
|
|
895
|
+
"properties": {
|
|
896
|
+
"text": {
|
|
897
|
+
"type": "string"
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
"additionalProperties": false
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
"managedWordListsConfig": {
|
|
904
|
+
"type": "array",
|
|
905
|
+
"items": {
|
|
906
|
+
"title": "Managed Words",
|
|
907
|
+
"description": "Managed word list to block. This is solely used for blocking profanity.",
|
|
908
|
+
"type": "object",
|
|
909
|
+
"properties": {
|
|
910
|
+
"type": {
|
|
911
|
+
"type": "string",
|
|
912
|
+
"enum": ["PROFANITY"]
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
"additionalProperties": false
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
"additionalProperties": false
|
|
920
|
+
},
|
|
921
|
+
"sensitiveInformationPolicyConfig": {
|
|
922
|
+
"title": "Sensitive Information Policy",
|
|
923
|
+
"description":
|
|
924
|
+
"Filter out and block or obscure sensitive information. Matching text will be handled per the policy.",
|
|
925
|
+
"type": "object",
|
|
926
|
+
"properties": {
|
|
927
|
+
"piiEntitiesConfig": {
|
|
928
|
+
"type": "array",
|
|
929
|
+
"items": {
|
|
930
|
+
"title": "PII Entity",
|
|
931
|
+
"description": "PII entity to infer from the text.",
|
|
932
|
+
"type": "object",
|
|
933
|
+
"properties": {
|
|
934
|
+
"type": {
|
|
935
|
+
"type": "string",
|
|
936
|
+
"enum": [
|
|
937
|
+
"ADDRESS",
|
|
938
|
+
"AGE",
|
|
939
|
+
"AWS_ACCESS_KEY",
|
|
940
|
+
"AWS_SECRET_KEY",
|
|
941
|
+
"CA_HEALTH_NUMBER",
|
|
942
|
+
"CA_SOCIAL_INSURANCE_NUMBER",
|
|
943
|
+
"CREDIT_DEBIT_CARD_CVV",
|
|
944
|
+
"CREDIT_DEBIT_CARD_EXPIRY",
|
|
945
|
+
"CREDIT_DEBIT_CARD_NUMBER",
|
|
946
|
+
"DRIVER_ID",
|
|
947
|
+
"EMAIL",
|
|
948
|
+
"INTERNATIONAL_BANK_ACCOUNT_NUMBER",
|
|
949
|
+
"IP_ADDRESS",
|
|
950
|
+
"LICENSE_PLATE",
|
|
951
|
+
"MAC_ADDRESS",
|
|
952
|
+
"NAME",
|
|
953
|
+
"PASSWORD",
|
|
954
|
+
"PHONE",
|
|
955
|
+
"PIN",
|
|
956
|
+
"SWIFT_CODE",
|
|
957
|
+
"UK_NATIONAL_HEALTH_SERVICE_NUMBER",
|
|
958
|
+
"UK_NATIONAL_INSURANCE_NUMBER",
|
|
959
|
+
"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
|
|
960
|
+
"URL",
|
|
961
|
+
"USERNAME",
|
|
962
|
+
"US_BANK_ACCOUNT_NUMBER",
|
|
963
|
+
"US_BANK_ROUTING_NUMBER",
|
|
964
|
+
"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
|
|
965
|
+
"US_PASSPORT_NUMBER",
|
|
966
|
+
"US_SOCIAL_SECURITY_NUMBER",
|
|
967
|
+
"VEHICLE_IDENTIFICATION_NUMBER"
|
|
968
|
+
]
|
|
969
|
+
},
|
|
970
|
+
"action": {
|
|
971
|
+
"$ref": "#/definitions/guardrailSensitiveInformationAction"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
"additionalProperties": false
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
"regexesConfig": {
|
|
978
|
+
"type": "array",
|
|
979
|
+
"items": {
|
|
980
|
+
"title": "Regular Expression",
|
|
981
|
+
"description": "A regular expression to match sensitive information.",
|
|
982
|
+
"type": "object",
|
|
983
|
+
"properties": {
|
|
984
|
+
"name": {
|
|
985
|
+
"type": "string"
|
|
986
|
+
},
|
|
987
|
+
"description": {
|
|
988
|
+
"type": "string"
|
|
989
|
+
},
|
|
990
|
+
"pattern": {
|
|
991
|
+
"type": "string"
|
|
992
|
+
},
|
|
993
|
+
"action": {
|
|
994
|
+
"$ref": "#/definitions/guardrailSensitiveInformationAction"
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
"additionalProperties": false
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
"additionalProperties": false
|
|
1002
|
+
},
|
|
1003
|
+
"contextualGroundingPolicyConfig": {
|
|
1004
|
+
"title": "Contextual Grounding Policy",
|
|
1005
|
+
"description":
|
|
1006
|
+
"Provides evaluations based on grounding text supplied by your in-context agent variables. Off-topic conversations can then be blocked.",
|
|
1007
|
+
"type": "object",
|
|
1008
|
+
"properties": {
|
|
1009
|
+
"filtersConfig": {
|
|
1010
|
+
"type": "array",
|
|
1011
|
+
"items": {
|
|
1012
|
+
"title": "Filter",
|
|
1013
|
+
"description": "Filter to evaluate grounding text.",
|
|
1014
|
+
"type": "object",
|
|
1015
|
+
"properties": {
|
|
1016
|
+
"type": {
|
|
1017
|
+
"title": "Type",
|
|
1018
|
+
"description": "The type of filter.",
|
|
1019
|
+
"type": "string",
|
|
1020
|
+
"enum": ["GROUNDING", "RELEVANCE"]
|
|
1021
|
+
},
|
|
1022
|
+
"threshold": {
|
|
1023
|
+
"title": "Threshold",
|
|
1024
|
+
"description": "The threshold for the filter as a floating point value between 0.0 - 1.0.",
|
|
1025
|
+
"type": "number",
|
|
1026
|
+
"minimum": 0,
|
|
1027
|
+
"maximum": 1
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
"additionalProperties": false
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
"additionalProperties": false
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
"required": ["name"],
|
|
1038
|
+
"additionalProperties": false
|
|
1039
|
+
},
|
|
1040
|
+
"guardMap": {
|
|
1041
|
+
"title": "GuardMap",
|
|
1042
|
+
"type": "object",
|
|
1043
|
+
"patternProperties": {
|
|
1044
|
+
"^[0-9A-Za-z_]+$": {
|
|
1045
|
+
"$ref": "#/definitions/guard"
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
"additionalProperties": false
|
|
1049
|
+
},
|
|
1050
|
+
"guardrailFilterStrength": {
|
|
1051
|
+
"title": "Guardrail Filter Strength",
|
|
1052
|
+
"type": "string",
|
|
1053
|
+
"enum": ["NONE", "HIGH", "LOW", "MEDIUM"]
|
|
1054
|
+
},
|
|
1055
|
+
"guardrailModality": {
|
|
1056
|
+
"title": "Guardrail Modality",
|
|
1057
|
+
"type": "string",
|
|
1058
|
+
"enum": ["TEXT", "IMAGE"]
|
|
1059
|
+
},
|
|
1060
|
+
"guardrailSensitiveInformationAction": {
|
|
1061
|
+
"title": "Guardrail Sensitive Information Action",
|
|
1062
|
+
"type": "string",
|
|
1063
|
+
"enum": ["ANONYMIZE", "BLOCK"]
|
|
1064
|
+
},
|
|
760
1065
|
"aiInspectAgentResolver": {
|
|
761
1066
|
"title": "AIInspectAgentResolver",
|
|
762
1067
|
"type": "object",
|
package/dist/esm/src/validate.js
CHANGED
|
@@ -487,8 +487,8 @@ function validateShapeLoaders(context, projectSchema, shape) {
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
if (shape.cache?.triggers) {
|
|
491
|
-
const min = context.entitlements
|
|
490
|
+
if (shape.cache?.triggers && !context.ignoreEntitlements) {
|
|
491
|
+
const min = context.entitlements.minScheduleTriggerInterval ?? DEFAULT_MIN_SCHEDULE_TRIGGER_INTERVAL;
|
|
492
492
|
for (let i = 0; i < shape.cache.triggers.length; i++) {
|
|
493
493
|
const trigger = shape.cache.triggers[i];
|
|
494
494
|
if (trigger.type === "schedule" && trigger.interval < min) {
|
|
@@ -786,14 +786,16 @@ function validateInterfaceImplementations(projectSchema) {
|
|
|
786
786
|
function validateAgents(projectSchema) {
|
|
787
787
|
const getNamespace = createGetNamespace(projectSchema);
|
|
788
788
|
const errors = [];
|
|
789
|
+
const guards = projectSchema["ai-experimental"]?.guards;
|
|
789
790
|
const agents = projectSchema["ai-experimental"]?.agents;
|
|
790
791
|
if (!agents) {
|
|
791
792
|
return errors;
|
|
792
793
|
}
|
|
793
794
|
for (const [agentName, agent] of Object.entries(agents)) {
|
|
794
795
|
const stateNames = new Set();
|
|
796
|
+
const agentPath = ["ai-experimental", "agents", agentName];
|
|
795
797
|
for (const [stateId, state] of Object.entries(agent.states)) {
|
|
796
|
-
const statePath = [
|
|
798
|
+
const statePath = [...agentPath, "states", stateId];
|
|
797
799
|
if (stateNames.has(state.name)) {
|
|
798
800
|
errors.push({
|
|
799
801
|
path: [...statePath, "name"],
|
|
@@ -819,6 +821,17 @@ function validateAgents(projectSchema) {
|
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
823
|
}
|
|
824
|
+
if (agent.guards) {
|
|
825
|
+
const invalidGuards = agent.guards.filter(({ guardId }) => !guards?.[guardId]);
|
|
826
|
+
if (invalidGuards.length) {
|
|
827
|
+
const guardPath = [...agentPath, "guards"];
|
|
828
|
+
errors.push(...invalidGuards.map(({ guardId }, index) => ({
|
|
829
|
+
path: [...guardPath, index, "guardId"],
|
|
830
|
+
type: "notFound",
|
|
831
|
+
message: `Invalid guardId "${guardId}"`
|
|
832
|
+
})));
|
|
833
|
+
}
|
|
834
|
+
}
|
|
822
835
|
}
|
|
823
836
|
return errors;
|
|
824
837
|
}
|
|
@@ -905,6 +918,22 @@ function validateStructure(schemaVersion, context, schema, ref) {
|
|
|
905
918
|
}
|
|
906
919
|
return { valid: true, schema: schema, errors: undefined };
|
|
907
920
|
}
|
|
921
|
+
function validateGuards(context, schema) {
|
|
922
|
+
const errors = [];
|
|
923
|
+
if (context.ignoreEntitlements) {
|
|
924
|
+
return errors;
|
|
925
|
+
}
|
|
926
|
+
const numOfGuards = schema["ai-experimental"]?.guards ? Object.keys(schema["ai-experimental"]?.guards).length : 0;
|
|
927
|
+
const entitledToGuards = context.entitlements.guards ?? 0;
|
|
928
|
+
if (numOfGuards > entitledToGuards) {
|
|
929
|
+
errors.push({
|
|
930
|
+
type: "entitlement",
|
|
931
|
+
message: `Number of guards exceeds your entitled limit of ${entitledToGuards}`,
|
|
932
|
+
path: ["ai-experimental", "guards"]
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
return errors;
|
|
936
|
+
}
|
|
908
937
|
function formatValidationResult(context, errors, schema) {
|
|
909
938
|
const { suppressErrorPaths } = context;
|
|
910
939
|
if (suppressErrorPaths) {
|
|
@@ -931,7 +960,8 @@ function validateSyntax(context, schema) {
|
|
|
931
960
|
.concat(validateIndexedShapes(context, schema))
|
|
932
961
|
.concat(validateInterfaces(schema))
|
|
933
962
|
.concat(validateInterfaceImplementations(schema))
|
|
934
|
-
.concat(validateAgents(schema))
|
|
963
|
+
.concat(validateAgents(schema))
|
|
964
|
+
.concat(validateGuards(context, schema));
|
|
935
965
|
return formatValidationResult(context, errors, schema);
|
|
936
966
|
}
|
|
937
967
|
async function validateReferences(context, schema) {
|
|
@@ -314,6 +314,34 @@ export type StopSequences1 = string[];
|
|
|
314
314
|
* The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results.
|
|
315
315
|
*/
|
|
316
316
|
export type Seed1 = number;
|
|
317
|
+
export type AgentGuardList = AgentGuard[];
|
|
318
|
+
/**
|
|
319
|
+
* The human-readable name of the Guard.
|
|
320
|
+
*/
|
|
321
|
+
export type Name = string;
|
|
322
|
+
/**
|
|
323
|
+
* A description of the Guard.
|
|
324
|
+
*/
|
|
325
|
+
export type Description = string;
|
|
326
|
+
/**
|
|
327
|
+
* A message to return when the input message is blocked by the Guard.
|
|
328
|
+
*/
|
|
329
|
+
export type BlockedInputMessaging = string;
|
|
330
|
+
/**
|
|
331
|
+
* A message to return when the output message is blocked by the Guard.
|
|
332
|
+
*/
|
|
333
|
+
export type BlockedOutputsMessaging = string;
|
|
334
|
+
export type GuardrailFilterStrength = 'NONE' | 'HIGH' | 'LOW' | 'MEDIUM';
|
|
335
|
+
export type GuardrailModality = 'TEXT' | 'IMAGE';
|
|
336
|
+
export type GuardrailSensitiveInformationAction = 'ANONYMIZE' | 'BLOCK';
|
|
337
|
+
/**
|
|
338
|
+
* The type of filter.
|
|
339
|
+
*/
|
|
340
|
+
export type Type = 'GROUNDING' | 'RELEVANCE';
|
|
341
|
+
/**
|
|
342
|
+
* The threshold for the filter as a floating point value between 0.0 - 1.0.
|
|
343
|
+
*/
|
|
344
|
+
export type Threshold = number;
|
|
317
345
|
/**
|
|
318
346
|
* Human-readable id for use in the UI
|
|
319
347
|
*/
|
|
@@ -321,12 +349,12 @@ export type WorkflowName = string;
|
|
|
321
349
|
/**
|
|
322
350
|
* machine-readable slug
|
|
323
351
|
*/
|
|
324
|
-
export type
|
|
352
|
+
export type Name1 = string;
|
|
325
353
|
/**
|
|
326
354
|
* Human-readable id for use in the UI
|
|
327
355
|
*/
|
|
328
356
|
export type Title = string;
|
|
329
|
-
export type
|
|
357
|
+
export type Description1 = string;
|
|
330
358
|
/**
|
|
331
359
|
* Hex color code
|
|
332
360
|
*/
|
|
@@ -1489,6 +1517,7 @@ export interface ShapeSchemaAny {
|
|
|
1489
1517
|
}
|
|
1490
1518
|
export interface AIExperimental {
|
|
1491
1519
|
agents?: AgentMap;
|
|
1520
|
+
guards?: GuardMap;
|
|
1492
1521
|
}
|
|
1493
1522
|
export interface AgentMap {
|
|
1494
1523
|
[k: string]: AgentJSON;
|
|
@@ -1505,6 +1534,7 @@ export interface AgentJSON {
|
|
|
1505
1534
|
api: AgentAPI;
|
|
1506
1535
|
start: AgentStart;
|
|
1507
1536
|
states: AgentStates;
|
|
1537
|
+
guards?: AgentGuardList;
|
|
1508
1538
|
}
|
|
1509
1539
|
export interface AgentAPIChat {
|
|
1510
1540
|
type: 'chat';
|
|
@@ -1686,6 +1716,115 @@ export interface AgentExecutionChat {
|
|
|
1686
1716
|
guardrails?: AgentGuardrail[];
|
|
1687
1717
|
options?: AgentGenerateOptions;
|
|
1688
1718
|
}
|
|
1719
|
+
export interface AgentGuard {
|
|
1720
|
+
guardId: string;
|
|
1721
|
+
}
|
|
1722
|
+
export interface GuardMap {
|
|
1723
|
+
[k: string]: GuardJSON;
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* A Guard is a configuration for an AI guardrail that can check inputs and outputs and provide safety and compliance.
|
|
1727
|
+
*
|
|
1728
|
+
* This interface was referenced by `GuardMap`'s JSON-Schema definition
|
|
1729
|
+
* via the `patternProperty` "^[0-9A-Za-z_]+$".
|
|
1730
|
+
*/
|
|
1731
|
+
export interface GuardJSON {
|
|
1732
|
+
name: Name;
|
|
1733
|
+
description?: Description;
|
|
1734
|
+
blockedInputMessaging?: BlockedInputMessaging;
|
|
1735
|
+
blockedOutputsMessaging?: BlockedOutputsMessaging;
|
|
1736
|
+
topicPolicyConfig?: TopicPolicy;
|
|
1737
|
+
contentPolicyConfig?: ContentPolicy;
|
|
1738
|
+
wordPolicyConfig?: WordPolicy;
|
|
1739
|
+
sensitiveInformationPolicyConfig?: SensitiveInformationPolicy;
|
|
1740
|
+
contextualGroundingPolicyConfig?: ContextualGroundingPolicy;
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Topics to identify and block.
|
|
1744
|
+
*/
|
|
1745
|
+
export interface TopicPolicy {
|
|
1746
|
+
topicsConfig?: Topic[];
|
|
1747
|
+
}
|
|
1748
|
+
/**
|
|
1749
|
+
* A topic to block.
|
|
1750
|
+
*/
|
|
1751
|
+
export interface Topic {
|
|
1752
|
+
name?: string;
|
|
1753
|
+
definition?: string;
|
|
1754
|
+
examples?: string[];
|
|
1755
|
+
type?: 'DENY';
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Types of content to filter and strength configuration.
|
|
1759
|
+
*/
|
|
1760
|
+
export interface ContentPolicy {
|
|
1761
|
+
filtersConfig?: Filter[];
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Types of content to filter.
|
|
1765
|
+
*/
|
|
1766
|
+
export interface Filter {
|
|
1767
|
+
type?: 'HATE' | 'INSULTS' | 'MICONDUCT' | 'PROMPT_ATTACK' | 'SEXUAL' | 'VIOLENCE';
|
|
1768
|
+
inputStrength?: GuardrailFilterStrength;
|
|
1769
|
+
outputStrength?: GuardrailFilterStrength;
|
|
1770
|
+
inputModalities?: GuardrailModality[];
|
|
1771
|
+
outputModalities?: GuardrailModality[];
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Specific words to identify and block. The managedWordListsConfig is solely used for blocking profanity.
|
|
1775
|
+
*/
|
|
1776
|
+
export interface WordPolicy {
|
|
1777
|
+
wordsConfig?: WordList[];
|
|
1778
|
+
managedWordListsConfig?: ManagedWords[];
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Specific words to block.
|
|
1782
|
+
*/
|
|
1783
|
+
export interface WordList {
|
|
1784
|
+
text?: string;
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* Managed word list to block. This is solely used for blocking profanity.
|
|
1788
|
+
*/
|
|
1789
|
+
export interface ManagedWords {
|
|
1790
|
+
type?: 'PROFANITY';
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Filter out and block or obscure sensitive information. Matching text will be handled per the policy.
|
|
1794
|
+
*/
|
|
1795
|
+
export interface SensitiveInformationPolicy {
|
|
1796
|
+
piiEntitiesConfig?: PIIEntity[];
|
|
1797
|
+
regexesConfig?: RegularExpression[];
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* PII entity to infer from the text.
|
|
1801
|
+
*/
|
|
1802
|
+
export interface PIIEntity {
|
|
1803
|
+
type?: 'ADDRESS' | 'AGE' | 'AWS_ACCESS_KEY' | 'AWS_SECRET_KEY' | 'CA_HEALTH_NUMBER' | 'CA_SOCIAL_INSURANCE_NUMBER' | 'CREDIT_DEBIT_CARD_CVV' | 'CREDIT_DEBIT_CARD_EXPIRY' | 'CREDIT_DEBIT_CARD_NUMBER' | 'DRIVER_ID' | 'EMAIL' | 'INTERNATIONAL_BANK_ACCOUNT_NUMBER' | 'IP_ADDRESS' | 'LICENSE_PLATE' | 'MAC_ADDRESS' | 'NAME' | 'PASSWORD' | 'PHONE' | 'PIN' | 'SWIFT_CODE' | 'UK_NATIONAL_HEALTH_SERVICE_NUMBER' | 'UK_NATIONAL_INSURANCE_NUMBER' | 'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER' | 'URL' | 'USERNAME' | 'US_BANK_ACCOUNT_NUMBER' | 'US_BANK_ROUTING_NUMBER' | 'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER' | 'US_PASSPORT_NUMBER' | 'US_SOCIAL_SECURITY_NUMBER' | 'VEHICLE_IDENTIFICATION_NUMBER';
|
|
1804
|
+
action?: GuardrailSensitiveInformationAction;
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* A regular expression to match sensitive information.
|
|
1808
|
+
*/
|
|
1809
|
+
export interface RegularExpression {
|
|
1810
|
+
name?: string;
|
|
1811
|
+
description?: string;
|
|
1812
|
+
pattern?: string;
|
|
1813
|
+
action?: GuardrailSensitiveInformationAction;
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Provides evaluations based on grounding text supplied by your in-context agent variables. Off-topic conversations can then be blocked.
|
|
1817
|
+
*/
|
|
1818
|
+
export interface ContextualGroundingPolicy {
|
|
1819
|
+
filtersConfig?: Filter1[];
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Filter to evaluate grounding text.
|
|
1823
|
+
*/
|
|
1824
|
+
export interface Filter1 {
|
|
1825
|
+
type?: Type;
|
|
1826
|
+
threshold?: Threshold;
|
|
1827
|
+
}
|
|
1689
1828
|
/**
|
|
1690
1829
|
* This interface was referenced by `ProjectSchemaJSON`'s JSON-Schema
|
|
1691
1830
|
* via the `definition` "formMap".
|
|
@@ -1745,9 +1884,9 @@ export interface Workflow {
|
|
|
1745
1884
|
* via the `definition` "workflowStep".
|
|
1746
1885
|
*/
|
|
1747
1886
|
export interface WorkflowStep {
|
|
1748
|
-
name:
|
|
1887
|
+
name: Name1;
|
|
1749
1888
|
title: Title;
|
|
1750
|
-
description?:
|
|
1889
|
+
description?: Description1;
|
|
1751
1890
|
color: Color;
|
|
1752
1891
|
live: Live;
|
|
1753
1892
|
key: Key;
|