This endpoint provides an AI-powered agent that answers permission-related questions using natural language. The agent uses Claude (Anthropic) with tool calling capabilities to query AWS Verified Permissions and provide intelligent responses about access control decisions.The agent:
Accepts conversational queries about permissions
Automatically calls the check_avp_access tool to verify permissions
Explains authorization decisions based on RBAC/ABAC/Cedar policies
Supports multi-turn conversations
Responds in Spanish
This endpoint requires an Anthropic API key configured in the ANTHROPIC_API_KEY environment variable.
{ "response": "Sí, Alice Garcia puede leer el Q4-Report-2024. La verificación con AWS Verified Permissions retornó ALLOW. Esto probablemente se debe a que Alice pertenece al departamento de Finance con nivel de clearance 2, y el documento Q4-Report-2024 es un documento confidencial del departamento Finance.", "messages": [ { "role": "user", "content": "¿Puede Alice leer el Q4-Report-2024?" }, { "role": "assistant", "content": [ { "type": "tool_use", "id": "toolu_01...", "name": "check_avp_access", "input": { "user": "alice", "action": "Read", "resource": "Q4-Report-2024" } } ] }, { "role": "user", "content": [ { "type": "tool_result", "tool_use_id": "toolu_01...", "content": "{\"decision\":\"ALLOW\",\"allowed\":true,...}" } ] }, { "role": "assistant", "content": [ { "type": "text", "text": "Sí, Alice Garcia puede leer el Q4-Report-2024..." } ] } ]}
The agent operates with the following system instructions:
Eres un agente de seguridad experto en AWS Verified Permissions.Responde preguntas sobre permisos usando la herramienta check_avp_access.NUNCA asumas el resultado — siempre verifica con la herramienta.Si preguntan por múltiples usuarios o recursos, verifica cada combinación.Explica brevemente por qué AVP tomó esa decisión (RBAC/ABAC/Cedar).Sé conciso. Responde siempre en español.
Implemented in /lambda/agent.py:183-204 (handler) and /lambda/agent.py:94-179 (agent loop)
The agent maintains conversation history across turns, allowing for contextual follow-up questions. Pass the complete messages array from the previous response to continue the conversation.
The agent will automatically check multiple permission combinations if you ask comparative questions. For example, asking “Who can read the Q4-Report-2024?” will trigger checks for all three users.