aws / aws/bedrock-agentcore-starter-toolkit

Natural Language Policy Authoring notebook missing policy generation APIs

Open
#395 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
508
Forks
155
Avg merge
8h 50m
Merged PRs (30d)
4

Description

### Description
The Natural Language Policy Authoring notebook in `01-tutorials/08-AgentCore-policy/Natural-Language-Policy-Authoring/` is intended to demonstrate natural language policy generation but currently does not include the generation APIs. The notebook manually creates Cedar policies instead of using the AI-powered generation capabilities.

### Current Problem
The notebook's purpose is to showcase how users can generate Cedar policies from natural language descriptions (e.g., "Allow refunds for amounts less than $500"), but it currently:
- Manually writes Cedar policy statements
- Does not use `policy_client.generate_policy()` API
- Misses the core value proposition of natural language policy authoring
- Does not demonstrate the AI-powered policy generation workflow

### Expected Behavior
The notebook should:
1. Accept natural language policy descriptions as input
2. Use `policy_client.generate_policy()` to convert natural language to Cedar policies
3. Display the generated Cedar policy
4. Deploy and test the generated policy
5. Demonstrate iterating with different natural language inputs

### Proposed Solution
Add policy generation workflow using the starter toolkit's PolicyClient:
- Use `generate_policy()` with natural language input
- Show the AI-generated Cedar policy output
- Create and deploy the generated policy
- Test enforcement with the generated policy
- Include examples of different natural language policy descriptions

### Impact
Without generation APIs, users cannot learn how to use the natural language policy authoring feature, which is the primary purpose of this tutorial.

### Files Affected
- `01-tutorials/08-AgentCore-policy/Natural-Language-Policy-Authoring/AgentCore-Policy-Demo.ipynb`

### Labels
bug, enhancement, documentation

Contributor guide

Open the contributing guide

Research direction

Open 01-tutorials/08-AgentCore-policy/Natural-Language-Policy-Authoring/AgentCore-Policy-Demo.ipynb and compare its manual Cedar policy flow with the starter toolkit's PolicyClient API. Verify how generate_policy() handles natural-language descriptions and how generated policies are displayed, deployed, and tested; done means the notebook demonstrates multiple inputs through that workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.