How AI Agents Work: Connectors, MCP & Agent Safety | Stanford CS193T Lecture 5 with Cynthia Bailey
Explore AI courses and programs from Stanford Online: https://stanford.io/4BYTekhWhat happens when AI stops just writing and starts acting on your behalf? In this Stanford CS193T: Thinking with AI lecture recording, Senior Lecturer Cynthia Bailey explains how AI agents work and why prompt injection gets much worse once AI can take actions. She opens with connectors, the links that let AI read your email, calendar, or files and act on your behalf, and shows that nothing new is happening inside the model: it's the same next-token prediction behind every chatbot, occasionally generating specially structured text that triggers actions. From there she builds the vocabulary for autonomous work: the analyze, act, observe loop every agent runs on, the seven-part "anatomy" of a well-specified agent, and professional-grade agentic workflow techniques like "the elephant and the goldfish." The lecture closes by putting on a pessimistic security hat: for any agent you design, what's the worst that could happen, and whose permissions made it possible?
Key questions answered in this lecture recording:
Q: What is the difference between generative AI and agentic AI?
A: Bailey says agentic AI focuses on taking actions rather than only generating content, but it runs on the same next-token prediction: the LLM emits structured JSON text that a connector turns into an action.
Q: What is an AI connector?
A: Connectors are access permissions that plug your AI tool into apps like Gmail or Outlook so it can pull in data or act on your behalf. Enabling one adds tool instructions to the context window, using the Model Context Protocol (MCP).
Q: What should you include when you define an AI agent?
A: Bailey treats an agent spec as a detailed scope of work with seven parts: goal, context, tools, permissions, memory, actions, and stopping conditions. Stopping conditions matter because agents keep going until told to stop.
Q: What is the elephant and the goldfish method for AI agents?
A: The elephant is a long interview-me chat that produces a 4 to 6 page scope of work. A fresh, memoryless goldfish reads only that document and reports whether agents could execute it without clarifying questions; repeat until no goldfish has questions.
Q: What does human in the loop mean in AI agents?
A: It describes where in the agent loop a human is informed and can approve or block progress. Bailey argues the degree of human in the loop is the main difference between plain chat, connectors, and fully autonomous agents.
Q: How do you make AI agents safer?
A: Bailey urges a "what's the worst that could happen" mindset and least privilege access: give agents only the permissions the task needs. She also flags prompt injection and adding human approval before irreversible actions like permanent deletes.
Chapters:
0:00 Intro: connectors, agents, and agent safety
2:20 What are AI connectors?
3:21 Email example: generative vs agentic AI
7:33 How AI tool calls work: next-token JSON
10:45 Connector instructions in the context window
16:41 Model Context Protocol (MCP) and MCP servers
18:05 Seven-part anatomy of an AI agent
23:34 Analyze, act, observe: the agent loop
27:38 Human in the loop and stopping conditions
29:34 The elephant and the goldfish method
38:22 Running the goldfish test loop
41:53 Agent safety: what's the worst that could happen?
53:14 Least privilege access for AI agents
55:21 Prompt injection via LinkedIn and web search
About the speaker:
Cynthia Bailey is a Senior Lecturer in the Computer Science Department at Stanford University. In 2023-2024, she served as an AI Policy Fellow in the United States Senate through the American Association for the Advancement of Science (AAAS). Her scholarship focuses on computer science education, AI/machine learning, and the social impacts of technology, including creating courses such as Equity and Governance for Artificial Intelligence and Race and Gender in Silicon Valley. Her teaching and research awards include the Lloyd W. Dinkelspiel Award for exceptional contributions to undergraduate education at Stanford, the Lasting Impact Award from the International Computing Education Research conference, a "Top 10 Papers of All Time" award at the 50th anniversary of the ACM SIGCSE Technical Symposium, and the Stanford Society of Women Engineers' Professor of the Year. She has consulted for Apple, NASA, law firms, and machine learning startups. She holds a Ph.D. in Computer Science from UC San Diego.
Course website: https://web.stanford.edu/class/archive/cs/cs193t/cs193t.1272/
Watch the full CS193T playlist: https://www.youtube.com/playlist?list=PLDrJO3v_iAZY
Recorded October 20, 2026 in CS193T: Thinking with AI, a Stanford University course taught by Senior Lecturer Cynthia Bailey.
#AIAgents #AgenticAI #StanfordOnline Receive SMS online on sms24.me
TubeReader video aggregator is a website that collects and organizes online videos from the YouTube source. Video aggregation is done for different purposes, and TubeReader take different approaches to achieve their purpose.
Our try to collect videos of high quality or interest for visitors to view; the collection may be made by editors or may be based on community votes.
Another method is to base the collection on those videos most viewed, either at the aggregator site or at various popular video hosting sites.
TubeReader site exists to allow users to collect their own sets of videos, for personal use as well as for browsing and viewing by others; TubeReader can develop online communities around video sharing.
Our site allow users to create a personalized video playlist, for personal use as well as for browsing and viewing by others.
@YouTubeReaderBot allows you to subscribe to Youtube channels.
By using @YouTubeReaderBot Bot you agree with YouTube Terms of Service.
Use the @YouTubeReaderBot telegram bot to be the first to be notified when new videos are released on your favorite channels.
Look for new videos or channels and share them with your friends.
You can start using our bot from this video, subscribe now to How AI Agents Work: Connectors, MCP & Agent Safety | Stanford CS193T Lecture 5 with Cynthia Bailey
What is YouTube?
YouTube is a free video sharing website that makes it easy to watch online videos. You can even create and upload your own videos to share with others. Originally created in 2005, YouTube is now one of the most popular sites on the Web, with visitors watching around 6 billion hours of video every month.