Add role-based HR data agent with scope-based field redaction via AgentCore Gateway#1262
Open
zubeens wants to merge 2 commits intoawslabs:mainfrom
Open
Add role-based HR data agent with scope-based field redaction via AgentCore Gateway#1262zubeens wants to merge 2 commits intoawslabs:mainfrom
zubeens wants to merge 2 commits intoawslabs:mainfrom
Conversation
Demonstrates scope-based HR data access using AgentCore Gateway interceptors and Cedar policy engine. An HR Manager sees full employee records; an HR Specialist sees profiles but not compensation; an Employee sees names only. DLP redaction is applied transparently by the Response Interceptor — no application code changes needed when switching personas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key capabilities demonstrated
tools/call)tools/list) and scope-based field redactionclient_id→ tenant mapping in SSM (no custom JWT claims required)client_credentialsflow with custom scopes per personaTest plan
bash scripts/prereq.sh --region us-east-1 --env dev— deploys Lambda, IAM, Cognitopython scripts/agentcore_gateway.py create— creates Gateway with interceptors and Lambda targetpython scripts/create_cedar_policies.py— attaches Cedar engine and creates 3 HR authorization policiesbash scripts/package_runtime.sh && python scripts/agentcore_agent_runtime.py create— deploys Runtimepython test/test_dlp_redaction.py— verifies all 4 personas pass field redaction assertionspython test/test_agent.py --persona hr-manager --prompt "Show me John Smith's compensation"— full agent teststreamlit run app.py— UI smoke test across all personas