# AI and Agent System

Relevant source files

- [.agents/skills/add-telemetry/SKILL.md](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1)
- [.mcp.json](https://github.com/warpdotdev/Warp/blob/81910e24/.mcp.json)

Warp is an AI-native terminal that integrates large language models directly into the command-line experience. The AI system is built around a sophisticated agent architecture that allows for both interactive conversations and autonomous task execution. This system leverages the **Model Context Protocol (MCP)** to interact with the local file system and external tools, supported by a robust **Skills System** and a cloud-based execution platform known as **Oz**.

### System Architecture Overview

The AI capabilities in Warp are distributed across several layers, from the UI conversation model to the low-level protocol integrations.

Title: AI System Component Interaction

```

```

Sources: `app/src/ai/agent/mod.rs`, `app/src/ai/skills/mod.rs`, `app/src/ai/mcp/mod.rs`

* * *

## [Agent Conversations and Task Execution](/content/warpdotdev/Warp/4.1-agent-conversations-and-task-execution/index.html)

The core of Warp's AI is the Agent system located in `app/src/ai/agent/`. This subsystem manages the lifecycle of an AI interaction, from the initial user prompt to the final execution of terminal commands or file edits.

- **Conversation Model**: Managed via `AIConversationId`, the system maintains a linearized history of agent steps, including thought processes, tool calls, and outputs.
- **Task Store**: Tracks the state of long-running autonomous tasks and their execution progress.
- **Ambient Agents**: Located in `app/src/ai/ambient_agents/`, these agents provide "always-on" assistance, such as proactive command suggestions or error explanations, without requiring a dedicated chat session.
- **Execution Profiles**: Define the constraints and capabilities of an agent session (e.g., local vs. cloud execution).
- **Computer Use & Voice**: Integrates screenshot-based automation via the `computer_use` crate and voice transcription in `app/src/ai/voice/`.

For details, see [Agent Conversations and Task Execution](/content/warpdotdev/Warp/4.1-agent-conversations-and-task-execution/index.html).

Sources: `app/src/ai/agent/mod.rs`, `app/src/ai/ambient_agents/mod.rs`

* * *

## [MCP (Model Context Protocol) Integration](/content/warpdotdev/Warp/4.2-mcp-(model-context-protocol/index.html)-integration)

Warp implements the **Model Context Protocol (MCP)** to provide a standardized way for AI agents to access tools and data. The integration in `app/src/ai/mcp/` allows Warp to act as an MCP host.

- **MCP Server Manager**: Handles the lifecycle of MCP servers, including file-based watchers that detect new server configurations.
- **Tool Exposure**: Automatically discovers tools provided by MCP servers and exposes them as executable "skills" to the AI agent.
- **Reconnecting Peer Logic**: Ensures robust connections to external MCP servers.
- **Bundled Skills**: Warp includes several pre-configured MCP skills in `resources/bundled/mcp_skills/` for common terminal operations.
- **External Config**: External MCP servers can be configured via `.mcp.json` at the project root [.mcp.json1-12](https://github.com/warpdotdev/Warp/blob/81910e24/.mcp.json#L1-L12)

For details, see [MCP (Model Context Protocol) Integration](/content/warpdotdev/Warp/4.2-mcp-(model-context-protocol/index.html)-integration).

Sources: `app/src/ai/mcp/mod.rs`, `crates/warp_cli/src/mcp.rs`, [.mcp.json1-12](https://github.com/warpdotdev/Warp/blob/81910e24/.mcp.json#L1-L12)

* * *

## [Skills System and Bundled Resources](/content/warpdotdev/Warp/4.3-skills-system-and-bundled-resources/index.html)

The Skills System in `app/src/ai/skills/` is the extensibility layer for Warp's AI. A "Skill" is a discrete capability that an agent can invoke to perform an action.

- **Skill Resolution**: The `SkillManager` resolves natural language intents to specific executable logic or MCP tools.
- **Bundled Skills**: Located in `resources/bundled/skills/`, these include built-in capabilities like `add-mcp-server`, `modify-settings`, `oz-platform`, and `create-skill`.
- **Agentic Development**: Warp uses internal skills like `add-telemetry` to assist developers in instrumenting the codebase [.agents/skills/add-telemetry/SKILL.md2-4](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L2-L4)
- **Channel Gating**: Skills can be restricted to specific release channels (e.g., Dev or Preview) to allow for safe testing of new AI features.

For details, see [Skills System and Bundled Resources](/content/warpdotdev/Warp/4.3-skills-system-and-bundled-resources/index.html).

Sources: `app/src/ai/skills/mod.rs`, [.agents/skills/add-telemetry/SKILL.md1-50](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L1-L50)

* * *

## [Telemetry System](/content/warpdotdev/Warp/4.4-telemetry-system/index.html)

Warp uses a trait-based telemetry framework to monitor the performance and usage of AI features while respecting user privacy. This system ensures that instrumentation is domain-specific and follows strict data-handling rules.

- **TelemetryEvent Trait**: Defined in `warp_core`, this trait ensures all events have a name, payload, and description [.agents/skills/add-telemetry/SKILL.md32-34](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L32-L34)
- **UGC Filtering**: The system explicitly checks for User Generated Content (UGC) via the `contains_ugc()` method to ensure sensitive data is not accidentally logged [.agents/skills/add-telemetry/SKILL.md81-87](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L81-L87)
- **Enablement States**: Events can be gated by `FeatureFlag` or `Channel` using the `EnablementState` enum [.agents/skills/add-telemetry/SKILL.md49-54](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L49-L54)
- **Registration**: Events are registered via the `register_telemetry_event!` macro and dispatched using `send_telemetry_from_ctx!` [.agents/skills/add-telemetry/SKILL.md127-147](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L127-L147)

Title: Telemetry Data Flow and Code Entities

```

```

Sources: [.agents/skills/add-telemetry/SKILL.md10-120](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L10-L120) [.agents/skills/add-telemetry/SKILL.md127-147](https://github.com/warpdotdev/Warp/blob/81910e24/.agents/skills/add-telemetry/SKILL.md?plain=1#L127-L147)

For details, see [Telemetry System](/content/warpdotdev/Warp/4.4-telemetry-system/index.html).
