Skip to content

docs(policy): fix guardrails docstring drift and temporal test-table row - #1986

Open
rhbelson wants to merge 1 commit into
awslabs:mainfrom
rhbelson:fix/policy-docs-temporal-guardrails
Open

docs(policy): fix guardrails docstring drift and temporal test-table row#1986
rhbelson wants to merge 1 commit into
awslabs:mainfrom
rhbelson:fix/policy-docs-temporal-guardrails

Conversation

@rhbelson

Copy link
Copy Markdown

Summary

Two documentation-correctness fixes in 01-features/07-centralize-and-govern-your-ai-infrastructure/02-policy, found while preparing the Diving Deep with AgentCore Workshop (v2). Both are docs/comment-only — no runtime behavior changes.

1. Guardrails in Policy — docstring/comment drift (02-guardrails-in-policy/deploy.py)

The ApplicationTool free-text field is named message in the actual tool schema, and all four guardrail policies scan context.input.message. But the module docstring, the create_application tool description, and an inline comment referred to a nonexistent customer_notes field. The docstring also listed the SSN policy as block_pii, while the code creates it as block_ssn. This aligns the docs with the code so a reader following the file isn't misled.

2. Temporal Policies — self-contradictory test-table row (03-temporal-policies/bankingassistant/README.md)

Policy 1's test table row 3 used three different account IDs for one case: the prompt said transfer to ACC-2003, the to_account column said ACC-9999, and the running example only ever looked up ACC-2002. The row still lands on DENY, but the mismatch makes the walkthrough incoherent. Fixed the prompt and column to agree on ACC-9999 and named the looked-up account (ACC-2002) in the DENY reason.

Note: I also reviewed the transfer_integrity_freshness policy's input.account_id: context.input.to_account binding — that is correct as written (the get_account_balance tool echoes its account_id argument in the response), so no change was made there.

Testing

Docs/comment-only changes; verified against the actual tool schema and guardrail policy code in deploy.py. No code paths altered.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant