Skip to content

Natural Language Policy Authoring notebook missing policy generation APIs #395

@sainathreddyb

Description

@sainathreddyb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions