Commit cff4a1e
docs(policy): fix guardrails docstring drift and temporal test-table row (#1986)
* docs(policy): fix guardrails docstring drift and temporal test-table row
- 02-guardrails-in-policy/deploy.py: the ApplicationTool free-text field is
'message' in the actual tool schema and all four guardrail policies scan
context.input.message, but the module docstring, tool description, and a
comment referred to a nonexistent 'customer_notes' field. Also the SSN
policy is named 'block_ssn' in code but the docstring listed 'block_pii'.
Aligned the docs with the code (no runtime change).
- 03-temporal-policies/bankingassistant/README.md: Policy 1 test-table row 3
was self-contradictory (prompt said 'to ACC-2003', the to_account column
said 'ACC-9999', and the looked-up account was ACC-2002). Made the prompt
and column agree on ACC-9999 and named the looked-up account in the DENY
reason so the walkthrough is coherent.
* style(policy): fix pre-existing ruff findings in guardrails deploy.py
The python-lint CI gate runs ruff on the full changed file, so editing
deploy.py surfaced 4 pre-existing findings unrelated to the docstring fix:
- RUF013 implicit Optional on get_aws_context(region, profile) -> str | None
- S110/BLE001 blind except Exception: pass in add_lambda_gateway_permission
-> narrowed to except ClientError with an explanatory comment (idempotent
permission removal; the statement legitimately may not exist on first run).
No behavior change.
---------
Co-authored-by: rbelson@amazon.com <rbelson@amazon.com>1 parent 4c4e2da commit cff4a1e
2 files changed
Lines changed: 11 additions & 10 deletions
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
472 | | - | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
0 commit comments