# How AI Agents Work: Connectors, MCP & Agent Safety | Stanford CS193T Lecture 5 with Cynthia Bailey

**URL:** <https://www.artofsm.art/t/how-ai-agents-work-connectors-mcp-agent-safety-stanford-cs193t-lecture-5-with-cynthia-bailey/28574>\
**Category:** Content Creators\
**Tags:** stanford-online, agents, ethics, automation, security, safety, tools\
**Created:** [17 November 2026 00:00 UTC](https://www.artofsm.art/t/how-ai-agents-work-connectors-mcp-agent-safety-stanford-cs193t-lecture-5-with-cynthia-bailey/28574 "2026-11-17T00:00:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![artesia](https://www.artofsm.art/user_avatar/www.artofsm.art/artesia/32/36_2.png) [@artesia](https://www.artofsm.art/u/artesia)\
**Post date:** [17 November 2026 00:00 UTC](https://www.artofsm.art/t/how-ai-agents-work-connectors-mcp-agent-safety-stanford-cs193t-lecture-5-with-cynthia-bailey/28574/1 "2026-11-17T00:00:36Z")

</div>

[![](https://www.artofsm.art/uploads/default/original/3X/0/5/0533551b75b318bf4e5d78745c80c5c04da2e84c.jpeg "How AI Agents Work: Connectors, MCP & Agent Safety | Stanford CS193T Lecture 5 with Cynthia Bailey") ](https://www.youtube.com/watch?v=ho00IesajkY)

In this lecture, Cynthia Bailey explains how AI agents use connectors to interact with external applications through structured commands, enabling autonomous workflows that continuously analyze, act, and observe until goals are met, while emphasizing the importance of clear agent design and iterative validation methods like the “elephant and goldfish” pattern. She also highlights critical safety considerations, advocating for strict permission controls and human oversight to prevent risks such as privacy breaches, harmful actions, and data loss in AI agent deployment.

---

<div class="post-metadata">

**Author:** ![artesia](https://www.artofsm.art/user_avatar/www.artofsm.art/artesia/32/36_2.png) [@artesia](https://www.artofsm.art/u/artesia)\
**Post date:** [17 November 2026 00:24 UTC](https://www.artofsm.art/t/how-ai-agents-work-connectors-mcp-agent-safety-stanford-cs193t-lecture-5-with-cynthia-bailey/28574/3 "2026-11-17T00:24:38Z")

</div>

In this Stanford CS193T lecture, Cynthia Bailey introduces the concept of AI agents, focusing on connectors, agentic workflows, and safety considerations. Connectors are tools that grant AI systems access to external applications like Gmail, Google Calendar, or Microsoft Outlook, enabling the AI to pull data or perform actions on behalf of the user. This integration streamlines workflows by eliminating manual copy-pasting, allowing AI agents to autonomously read emails, draft responses, or even send messages directly, marking a shift from purely generative AI to agentic AI that takes actions.

Bailey explains that under the hood, AI agents still operate using large language models (LLMs) that generate text token by token. However, when interacting with connectors, the AI produces highly structured outputs, often in JSON format, which serve as commands for these external tools. This process is managed by a connector manager that interprets the AI’s structured output, executes the corresponding actions, and feeds the results back into the AI’s context window, enabling a continuous analyze-act-observe loop. This loop allows agents to iteratively assess context, take actions, and observe outcomes until a stopping condition is met.

The lecture also covers how to design well-specified agents by defining clear goals, context, tools, permissions, memories, actions, and stopping conditions. For example, an agent tasked with scheduling a team dinner would need access to calendars and communication tools, permissions to view others’ availability, and a memory of past scheduling preferences. The agent’s workflow would involve checking availability, drafting invitations, sending messages, and handling responses, repeating as necessary until the event is confirmed or a retry limit is reached.

Bailey introduces a professional-grade agent workflow pattern called the “elephant and the goldfish,” developed by Google engineer Dave Resnick. The “elephant” agent conducts a thorough, long-memory interview to create a detailed scope of work document, while the “goldfish” agent, with no prior context, reviews this document to identify gaps or unclear instructions. This iterative process continues until the goldfish confirms the document is complete, ensuring that autonomous agents can execute complex tasks reliably without needing further human clarification.

Finally, the lecture addresses critical safety concerns when deploying AI agents with broad access permissions. Bailey presents three scenarios—maintenance reporting with photo access, a job hunt assistant managing LinkedIn messages, and a disk cleanup agent with file deletion rights—to highlight potential risks such as privacy breaches, erroneous or harmful actions, and data loss. Emphasizing the principle of least privilege, she advocates for careful permission management and human-in-the-loop oversight to mitigate risks like prompt injection attacks, unintended deletions, or inappropriate communications, underscoring the importance of cautious and responsible AI agent design.

## Useful Links

- [Stanford CS193T: Thinking with AI Course Website](https://web.stanford.edu/class/archive/cs/cs193t/cs193t.1272/) — Directly related to the lecture content and provides official course materials for deeper understanding and practical exercises.
- [Dave Resnick’s Medium Post on Elephant and Goldfish AI Agent Workflow](https://drensin.medium.com/elephants-goldfish-and-the-new-golden-age-of-software-engineering-c33641a48874) — This article explains the key agent workflow pattern central to the lecture’s discussion on agent design and iterative specification refinement.
