-
Notifications
You must be signed in to change notification settings - Fork 4
/
bedrock.tf
82 lines (77 loc) · 2.12 KB
/
bedrock.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
resource "aws_bedrock_guardrail" "runtask_fulfillment" {
name = "${local.solution_prefix}-guardrails"
blocked_input_messaging = "Unfortunately we are unable to provide response for this input"
blocked_outputs_messaging = "Unfortunately we are unable to provide response for this input"
description = "Basic Bedrock Guardrail for sensitive info exfiltration"
# detect and filter harmful user inputs and FM-generated outputs
content_policy_config {
filters_config {
input_strength = "HIGH"
output_strength = "HIGH"
type = "HATE"
}
filters_config {
input_strength = "HIGH"
output_strength = "HIGH"
type = "INSULTS"
}
filters_config {
input_strength = "HIGH"
output_strength = "HIGH"
type = "MISCONDUCT"
}
filters_config {
input_strength = "NONE"
output_strength = "NONE"
type = "PROMPT_ATTACK"
}
filters_config {
input_strength = "HIGH"
output_strength = "HIGH"
type = "SEXUAL"
}
filters_config {
input_strength = "HIGH"
output_strength = "HIGH"
type = "VIOLENCE"
}
}
# block / mask potential PII information
sensitive_information_policy_config {
pii_entities_config {
action = "BLOCK"
type = "DRIVER_ID"
}
pii_entities_config {
action = "BLOCK"
type = "PASSWORD"
}
pii_entities_config {
action = "ANONYMIZE"
type = "EMAIL"
}
pii_entities_config {
action = "ANONYMIZE"
type = "USERNAME"
}
pii_entities_config {
action = "BLOCK"
type = "AWS_ACCESS_KEY"
}
pii_entities_config {
action = "BLOCK"
type = "AWS_SECRET_KEY"
}
}
# block select word / profanity
word_policy_config {
managed_word_lists_config {
type = "PROFANITY"
}
}
tags = local.combined_tags
}
resource "aws_bedrock_guardrail_version" "runtask_fulfillment" {
guardrail_arn = aws_bedrock_guardrail.runtask_fulfillment.guardrail_arn
description = "Initial version"
}