Title: Lab 13 — Interrupt, Approve, Delegate
Course: AIINFRA 300: Agentic AI & the Model Context Protocol (MCP) > Section: Week 13 — Human-in-the-Loop Workflows and Emerging Standards (A2A, [AGENTS.md](http://AGENTS.md))

🛠️ Lab 13 — Interrupt, Approve, Delegate (50 pts)

Goal: Build a LangGraph agent that pauses for human approval before a sensitive action, then complete Google's free A2A codelab to see agent-to-agent discovery and delegation firsthand, and finish by hand-authoring your own Agent Card JSON. Steps:

1. Set up a local Python environment with langgraph installed, plus a free/local LLM backend — either Ollama running a local model (e.g., llama3.1 or qwen2.5) or a free-tier hosted model you already configured in earlier weeks. No paid API keys required.
2. Design a small graph with a tool/node that represents a sensitive action — for example, deploy_to_production(build_id) or approve_purchase(amount, item). Anything with realistic "blast radius" works.
3. Inside that tool/node, call interrupt() and pass a payload describing the proposed action (e.g., {"action": "deploy", "build_id": "v2.3.1", "target": "production"}). Confirm that calling the graph halts execution at that point and returns the payload to your calling code.
4. Add a LangGraph checkpointer (the built-in in-memory or SQLite checkpointer is fine for this lab) so the pause is durable — verify you can shut down your script, restart it, and still resume the paused task using the same thread/session id.
5. Write a small driver loop that displays the paused action to you in the terminal, accepts approve, reject, or edit <new params> as input, and resumes the graph with the corresponding Command(resume=...) value. Test all three paths and capture terminal output/screenshots for each.
6. Complete Google's free A2A codelab, "Getting Started with Agent2Agent (A2A) Protocol" (purchasing-concierge codelab, link in Resources). Follow it locally — no paid cloud resources required — and observe: how the concierge agent fetches a remote seller agent's Agent Card, how it delegates a purchase task via JSON-RPC 2.0 over HTTP, and how streaming updates arrive over SSE as the task progresses through its states.
7. Hand-author your own Agent Card JSON (you do not need to stand up a live server) for a toy agent of your choosing — e.g., a "recipe-finder" or "book-recommender" agent. Reference the A2A Protocol Specification (Resources) and include at minimum: name, endpoint url, one or more skills, and an authentication/security scheme field. Save it as agent-card.json.
8. Write a short reflection (200–300 words) comparing the interrupt/resume pause you built in Steps 3–5 to the interrupted task states (INPUT_REQUIRED, AUTH_REQUIRED) you observed in the A2A codelab — what's structurally similar, what's different, and where you'd want each pattern in a real system.

Deliverables: Submit (a) your LangGraph script with the interrupt()/Command pause-resume flow, (b) terminal output or screenshots showing approve, reject, and edit paths working, (c) your hand-authored agent-card.json, and (d) your written reflection — as a zipped folder upload or pasted into the text entry box.