Frontend Applications
The project includes two web applications:| File | Purpose | Features |
|---|---|---|
index.html | Main AVP demo lab | Interactive access control testing with AVP |
avp-agent.html | AI agent interface | Natural language queries to AVP using Claude |
Both applications are static HTML files with embedded JavaScript. No build process or npm dependencies required.
Configure API URL
You need to update the API Gateway URL in the HTML files to point to your deployed backend.Locate your API URL
From the SAM deployment output (previous step), copy the
ApiUrl:The URL should end with
/prod — this is the API Gateway stage name.Update index.html
Open Replace the URL with your API Gateway URL:
frontend/index.html in your text editor and find line ~841:Run Local Server
The frontend files must be served over HTTP (not opened withfile://) to avoid CORS issues.
Access the Applications
With the server running, open your web browser and navigate to:Main AVP Lab
- Interactive UI to test AVP authorization decisions
- Select users, resources, and actions to check access
- View real-time ALLOW/DENY decisions from AVP
- See the Cedar policy evaluation results
- Policy Store ID (you’ll enter this in the UI)
- Backend API deployed
- No Anthropic API key needed
AI Agent Interface
- Natural language interface to query AVP
- Ask questions like “Can Alice read the Q4 report?”
- AI agent reasons about access control and calls AVP
- Shows detailed logs of AVP API calls
- Policy Store ID
- Backend API deployed
- Valid Anthropic API key configured during SAM deployment
Using the Main Lab
Here’s how to use the main AVP demo interface:Enter Policy Store ID
In the configuration section at the top, paste your Policy Store ID:This tells the application which AVP policy store to query.
Select a user
Choose a user from the dropdown:
- Alice Garcia (Analyst, Finance)
- Bob Smith (Manager, Finance)
- Carol Mendez (Auditor, HR)
- David Lee (Engineer, IT)
Select a resource
Choose a document to access:
- Q4-Report-2024 (Finance, Confidential)
- Employee-Handbook (HR, Public)
- Salary-Data-2024 (HR, Secret)
- Infrastructure-Diagram (IT, Confidential)
Check access
Click the “Check Access” button.The application will:
- Send a POST request to
/check-access - Lambda calls AVP’s
IsAuthorizedAPI - AVP evaluates Cedar policies
- Returns ALLOW or DENY decision
- Decision (ALLOW/DENY)
- Determining policies (which policies led to this decision)
- Errors (if any evaluation errors occurred)
Using the AI Agent
Enter your query in natural language
Type a question in the chat input, such as:
- “Can Alice read the Q4 Report?”
- “Check access for all users to the Q4-Report-2024”
- “What documents can Carol access?”
- “Verify if Bob can delete any Finance documents”
View the AI response
The agent will:
- Parse your natural language query
- Determine which AVP checks to perform
- Call the
/agentendpoint which queries Anthropic’s Claude - Claude uses the
check_avp_accesstool to call AVP - Return a natural language explanation of the results
- AI’s reasoning process
- Which AVP calls were made
- ALLOW/DENY results
- Natural language summary
Architecture: How Frontend Connects to Backend
Security Notes
CORS Configuration
The API Gateway has CORS enabled with these settings (fromtemplate.yaml):
AllowOrigin: '*'allows requests from any origin (includinglocalhost:8000)- In production, restrict this to your actual domain
Troubleshooting
”Failed to fetch” errors in browser console
Cause: API URL is incorrect or the API is not deployed Solutions:- Verify the API URL is correct in the HTML file
- Test the API directly:
curl https://YOUR_API_URL/users - Check CloudFormation stack status:
aws cloudformation describe-stacks --stack-name avp-demo
CORS errors
Error:Access to fetch at 'https://...' from origin 'file://' has been blocked by CORS
Cause: Opening HTML file with file:// instead of http://
Solution: Always use python3 -m http.server 8000 and access via http://localhost:8000
”DENY” for all requests
Cause: No policies created in the policy store yet Expected: This is Zero Trust in action! AVP denies by default until you create policies. Solution: Follow the demo flow to create Cedar policies in the AVP consoleAI agent not responding
Cause: Invalid or missing Anthropic API key Solutions:- Verify you provided a valid API key during SAM deployment
- Check Lambda environment variables in AWS Console
- Redeploy with correct API key:
sam build && sam deploy
Policy Store ID not accepted
Error: “Invalid Policy Store ID” in the UI Solutions:- Verify the Policy Store ID starts with
PS - Ensure the policy store exists in the same region as your API
- Check for extra spaces or characters when pasting
Testing the Complete Flow
Verify everything is working:Next Steps
Your deployment is complete! You’re now ready to run the live demo:Return to Main Guide
Learn how to present the demo and create Cedar policies
- Act 1: Test Zero Trust (default DENY)
- Act 2: Create your first Cedar policy and see ALLOW
- Act 3: Add ABAC policies with user/document attributes
- Act 4: Use
forbidto overridepermit - Act 5: Try the AI agent with natural language queries