Code Agents in Practice: API, Vibe Code CLI, and Vibe Code Web
On this page
Lesson rewritten November 2, 2026. Since Devstral was removed from the API on July 31, 2026, the API examples here use Mistral Small 4. The Vibe section reflects the current Vibe Code documentation: installation, the built-in model (Mistral Medium 3.5), and the three surfaces—CLI, VS Code extension, and Vibe Code Web. Sources: Install and setup · Choose CLI, VS Code, or web sessions · Configuration.
Three ways to put an agent to work
An agentic model is only as good as how you connect it to real work. Mistral offers three paths: the API, where you build your own agent; Vibe Code locally, in your terminal or VS Code; and Vibe Code Web, which runs the agent in a remote sandbox against a GitHub repository. Each fits a different part of a developer’s day.
Via the Mistral API
The API is the most flexible interface: it lets you build your own agentic workflows with your own tools and control logic. Start with the simplest case, a chat call without tools. Here we submit a vulnerable authentication function to Mistral Small 4 and ask for a diagnosis. Setting temperature=0 isn’t decorative: for security analysis, you want reproducible results, not variation from one run to the next.
from mistralai.client import Mistral
import os
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
response = client.chat.complete(
model="mistral-small-2603",
messages=[
{
"role": "system",
"content": "You are an expert development agent. Analyze the provided code and propose improvements."
},
{
"role": "user",
"content": """Here is a Python file that handles authentication.
Identify security issues and propose fixes:
def login(username, password):
query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"
user = db.execute(query).fetchone()
if user:
session['user_id'] = user['id']
return True
return False
"""
}
],
temperature=0,
max_tokens=2000,
)
print(response.choices[0].message.content)
Agentic mode changes the nature of the exchange. Instead of receiving text, you declare tools the model can request to call, and the model returns tool_calls—a tool name and its arguments. The three tools below form the minimal foundation for a code agent: read a file, write a file, run a command. With them, the instruction “add type hints to all files in src/utils/” becomes executable, whereas in chat mode it would remain a suggestion.
tools = [
{
"type": "function",
"function": {
"name": "read_file",
"description": "Read the contents of a source file",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Relative path to the file"
}
},
"required": ["path"]
}
}
},
{
"type": "function",
"function": {
"name": "write_file",
"description": "Write content to a file",
"parameters": {
"type": "object",
"properties": {
"path": {"type": "string"},
"content": {"type": "string"}
},
"required": ["path", "content"]
}
}
},
{
"type": "function",
"function": {
"name": "run_command",
"description": "Execute a shell command",
"parameters": {
"type": "object",
"properties": {
"command": {"type": "string"}
},
"required": ["command"]
}
}
}
]
response = client.chat.complete(
model="mistral-small-2603",
messages=[
{
"role": "user",
"content": "Explore the project and add Python type hints to all files in the src/utils/ directory"
}
],
tools=tools,
tool_choice="auto",
)
# Process the tool calls returned by the model
for tool_call in response.choices[0].message.tool_calls:
print(f"Tool: {tool_call.function.name}")
print(f"Arguments: {tool_call.function.arguments}")
Note that nothing executes on its own: the loop—call the tool, return the output to the model, ask for the next step—remains entirely your responsibility. That’s the price of flexibility, and it’s exactly what the Vibe CLI handles for you.
Via Vibe Code locally: the CLI and VS Code extension
Vibe Code is the “code” mode of Vibe, Mistral’s agent. Locally, it comes in two forms that share the same engine, configuration, and session history: the CLI, in your terminal, and the VS Code extension, which adds editor context (active file, selection, diffs). Installing the CLI takes one line on macOS and Linux:
# Official installer (installs uv if needed, then the mistral-vibe package)
curl -LsSf https://mistral.ai/vibe/install.sh | bash
# Or manual installation
uv tool install mistral-vibe
Then navigate to your project and run vibe. On first launch, a wizard prompts you to sign in with your Mistral account (Vibe Code is included in plans, with usage limits depending on the plan) or to enter an API key. You then talk to the agent like a colleague with their hands on the keyboard:
Explain this project's architecture.
Add an API route /health that returns the server status, along with its test.
Run the test suite and fix what fails.
Vibe provides the tools itself (file read/write, shell commands) and the agentic loop you had to write by hand with the API. It ships with a built-in model, Mistral Medium 3.5, and the /model command lets you choose another from those configured (Small 4, Codestral, a local model…). Changes and commands go through an approval system you configure per agent: review it before trusting it with an important repository. For automation, vibe --prompt runs a non-interactive execution, useful in continuous integration.
Via Vibe Code Web
Vibe Code Web is the third surface: a cockpit for remote agents. You create a project from one or more GitHub repositories under the same owner, start a session with a precise instruction, and the agent works in a cloud-managed sandbox: it clones, plans, modifies, runs commands and tests, then prepares a branch or pull request for you to review in GitHub. No local copy is needed, and your machine can stay closed while the agent works. From the CLI, the /teleport command transfers an ongoing session to the web.
Choose the CLI or extension when the task depends on files, services, or secrets present only on your machine.
Comparing the three paths
| Criterion | Python API | Vibe Code (CLI, VS Code) | Vibe Code Web |
|---|---|---|---|
| Agentic loop | You write it | Built-in | Built-in |
| File access | Via your tools | Local working copy | Remote sandbox, GitHub repo |
| Model | The one you call | Medium 3.5 built-in, others optional | Vibe Code engine |
| Non-interactive mode | Yes | Yes (vibe --prompt, CLI only) | No |
| Use case | Pipelines, custom products | Daily development | Long-running tasks on a remote repo |
Read right to left, this table describes a gradient of control: the more you move toward the API, the more you decide everything, including what can break.
What makes the difference in practice
Result quality depends less on the model than on how you phrase your request. “Add validation” leaves the agent to invent the location, style, and rules; “Add email validation in src/auth/validators.py using the existing pattern” gives it the file, the convention, and the boundary. In the same spirit, explicitly cite relevant files and project constraints rather than hoping it guesses them.
Verification remains non-negotiable: a competent agent can still introduce a regression, especially when touching multiple files at once. Make it a habit to review the diff before accepting it, just as you would for a new hire’s pull request. And keep in mind the final setting: choosing the right tool. Use Vibe Code locally for daily development, Vibe Code Web for long-running tasks on a remote repo, and the API for your own pipelines.
Key takeaways
- The API gives total control: you write the tools and the agentic loop
- Vibe Code installs with
curl -LsSf https://mistral.ai/vibe/install.sh | bash(oruv tool install mistral-vibe) and ships with Mistral Medium 3.5 - The CLI and VS Code extension share configuration and sessions;
vibe --promptis for automation - Vibe Code Web runs the agent in a remote sandbox and produces branches and pull requests
- Precise instructions and diff review remain essential