You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document PII sanitizer and MCP tool decorator, add ModelContextProtocol dep
Grow the README with an example of constructing BedrockGuardrailsSanitizer
directly and note the structured-content limitation. Bring in
ModelContextProtocol 2.1.0 (for the tool-decorator types) and record the new
user-facing feature in the autover changelog.
Copy file name to clipboardExpand all lines: .autover/changes/AWS.Bedrock.MAG-initial-preview.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@
6
6
"ChangelogMessages": [
7
7
"Initial preview scaffold (0.1.0-preview): package infrastructure and a shared internal guardrail client wrapping ApplyGuardrail. User-facing features (policy backend, audit sink, PII sanitizer, high-level entry points) ship in follow-up preview releases.",
8
8
"Bedrock Guardrails policy backend: an IExternalPolicyBackend that evaluates tool-call context via ApplyGuardrail and denies calls that trip the guardrail. Fails closed on Bedrock/AWS errors by default. Wire it up imperatively with PolicyEngine.AddExternalBackend.",
9
-
"CloudWatch audit sink: subscribes to the toolkit's AuditEmitter and writes governance events to CloudWatch Logs via AWS.Logger.Core, aggregating per-agent/per-policy counters and publishing them as CloudWatch metrics on a configurable flush interval. Delivery is background and non-blocking; sink hiccups can't break the governance loop."
9
+
"CloudWatch audit sink: subscribes to the toolkit's AuditEmitter and writes governance events to CloudWatch Logs via AWS.Logger.Core, aggregating per-agent/per-policy counters and publishing them as CloudWatch metrics on a configurable flush interval. Delivery is background and non-blocking; sink hiccups can't break the governance loop.",
10
+
"Bedrock Guardrails PII sanitization for MCP tool output: BedrockGuardrailsSanitizer runs the ANONYMIZE action on tool-result text blocks (30+ PII entity types). GovernedBedrockMcpServerTool decorates an MCP tool so sanitization runs after the toolkit's own scrubbing. Structured (non-text) tool content is passed through unchanged (post-v1 follow-up)."
-**Bedrock Guardrails policy backend**: ML policy evaluation added alongside the toolkit's rule, OPA, and Cedar backends. Fails closed on error.
6
6
-**CloudWatch audit sink**: writes governance events to CloudWatch Logs with aggregated metrics.
7
+
-**Bedrock Guardrails PII sanitization**: redacts or blocks 30+ PII entity types in MCP tool output.
7
8
8
-
> Preview (0.1.0). The API may change while the toolkit's extension surface stabilizes. Remaining features (PII sanitization, high-level MCP/DI entry points, inline guardrail checks) ship in follow-up preview releases.
9
+
> Preview (0.1.0). The API may change while the toolkit's extension surface stabilizes. Remaining features (high-level MCP/DI entry points, inline guardrail checks) ship in follow-up preview releases.
9
10
10
11
## Install
11
12
@@ -38,21 +39,36 @@ using var audit = new CloudWatchAuditSink(new CloudWatchAuditOptions
38
39
audit.Subscribe(kernel.AuditEmitter);
39
40
```
40
41
41
-
The high-level MCP and DI entry points that wire these up for you (`WithBedrockGovernance`, `AddBedrockGovernance`, `AddBedrockGuardrailsPolicy`, `AddCloudWatchAudit`) land in a follow-up preview release.
42
+
### PII sanitization on MCP tool output
43
+
44
+
`BedrockGuardrailsSanitizer` runs the ANONYMIZE action on the text blocks of an MCP tool result. The MCP server wiring that plugs it in for you (via `WithBedrockGovernance`) lands in the next preview; in the meantime you can construct the sanitizer directly to feed it tool-result text:
-`bedrock:ApplyGuardrail` on the guardrail evaluated by the policy backend.
59
+
-`bedrock:ApplyGuardrail` on the guardrail (policy backend and PII sanitization).
48
60
-`logs:CreateLogGroup`, `logs:CreateLogStream`, `logs:PutLogEvents` on the audit log group (audit sink).
49
61
-`cloudwatch:PutMetricData` (audit metrics, when `EmitMetrics` is on).
50
62
51
63
The audit sink uses [AWS.Logger.Core](https://github.com/aws/aws-logging-dotnet), which creates the log group and stream on first use, so the `logs:Create*` permissions are required.
52
64
65
+
## Limitations
66
+
67
+
PII sanitization covers the **text** blocks of an MCP tool result, matching the toolkit's own sanitizer. A tool result's `StructuredContent` (structured JSON) is passed through unchanged. If a tool returns PII in `StructuredContent`, mirror it into a text block so the guardrail sees it. Sanitizing arbitrary structured output is a post-v1 follow-up.
68
+
53
69
## Cost
54
70
55
-
This package calls billed AWS services: Bedrock Guardrails (priced per text unit evaluated) on every governed tool call, plus CloudWatch Logs ingestion/storage and CloudWatch custom metrics from the audit sink. Tune `FlushInterval` to trade audit latency against request volume.
71
+
This package calls billed AWS services: Bedrock Guardrails (priced per text unit evaluated, once for policy on the input and once for PII on the output), CloudWatch Logs ingestion and storage, and CloudWatch custom metrics. Tune `FlushInterval` to trade audit latency against request volume.
0 commit comments