Work with the AI Copilot Agent
Connect a provider, ask questions in chat, hand a task to the agent, control what it may do, add project memory and a safety hook, and undo a turn you do not like.
What you will do
Set up the Copilot, learn the difference between chat and agent mode, and put guardrails around the agent.
Before you start
- An API key for a supported provider (Anthropic, OpenAI, Google Gemini, DeepSeek, or a compatible service)
- A project with a Python file or two
Step 1: Connect a provider
Open Settings → AI Copilot → Provider and model. Pick the provider, choose the model and paste your key. Use Test connection. The key stays in your browser.
Step 2: Set spending limits
Under Spending limits set a small daily and monthly budget while you are learning. The footer in the Copilot shows the running cost, and /cost gives a breakdown.
Step 3: Ask in chat
Open the Explorer and choose AI Copilot (or press Ctrl+Shift+A). In Chat, open a file and ask a question about it. Chat answers in context, and nothing is changed.
Step 4: Give the agent a task
Switch to Agent. Try: "Read main.py and add a function that loads the CSV from the Data Hub and prints the column names." Each tool call shows as a card. Reads happen automatically; the first edit or the first Python run asks for your approval, with a diff for edits. Allow it once.
Step 5: Choose a permission mode
Under Settings → AI Copilot → Agent mode pick how far the agent acts alone: ask before every change, auto-approve edits and ask before running code, or approve everything. Keep the first until you trust a workflow. A denied call is reported to the agent, which adapts.
Step 6: Plan first
For a bigger job say "Plan this before changing anything". In plan mode only read-only tools are available, and the agent presents its plan for your approval. Watch the todo list as it works.
Step 7: Add project memory
Run /init to generate a DLWAY.md, then edit it to describe your conventions, for example "use pandas, not polars; keep functions under 40 lines". It is read at the start of every conversation.
Step 8: Add a hook
Add a hooks section to DLWAY.md:
## Hooks ### After write_file- Check types ### Before run_python- Block if the input contains `os.remove`Ask the agent to write a file, then to delete something with Python, and see the hook react.
Step 9: Undo
If a turn went the wrong way, type /undo to revert that turn's changes. Each file's original content is captured before the first edit of the turn.
Step 10: Make it yours
Create .dlway/commands/explain-data.md with a one-line description and a body using $ARGUMENTS, and it becomes the slash command /explain-data. Put a Markdown file in .dlway/agents/ with a name, tools and a system prompt to create a specialist subagent.
Pipelines and the agent
The agent can list your pipelines, inspect their runs and save a draft pipeline; saving a draft asks like any edit, and it never publishes or runs. Running a pipeline always asks first.